トップ «前の日記(2006-06-12 (Mon)) 最新 次の日記(2006-09-27 (Wed))» 編集 RSS feed

継続にっき

2004|06|07|08|09|10|11|12|
2005|01|02|03|04|05|06|07|08|09|10|12|
2006|01|03|05|06|08|09|10|12|
2007|01|02|03|05|07|12|
2008|10|
2009|01|05|12|
2010|04|05|11|
2011|01|09|12|
2012|02|03|05|09|12|
2013|02|03|
2014|05|09|
2015|12|
2017|09|

2006-08-13 (Sun)

))) dabbrev-highlightもどき on xyzzy

(require "dabbrev")

(defvar *dabbrev-expand-highlight-face* '(:bold t :foreground 1))

(defun dabbrev-expand-highlight (&optional arg)
  (interactive "*p")
  (let ((initial-point (point)))
    (dabbrev-expand arg)
    (let* ((text ed::*last-dabbrevs-text*)
           (location ed::*last-dabbrevs-text-location*)
           (buffer (or ed::*last-dabbrevs-last-buffer* (selected-buffer)))
           (current-buffer (selected-buffer))
           (visible-in-window-p (and (get-buffer-window buffer)
                                     (pos-visible-in-window-p location (get-buffer-window buffer)))))
      (when location
        (save-excursion
          (set-buffer buffer)
          (if visible-in-window-p
              (let ((dabbreves-text-from (+ location (if (and (eq buffer current-buffer)
                                                              (> location initial-point))
                                                         (- (point) initial-point) 0))))
                (apply #'set-text-attribute dabbreves-text-from
                       (+ dabbreves-text-from (length text))
                       'dabbrev-expand-highlight *dabbrev-expand-highlight-face*)
                (add-hook '*pre-command-hook* 'delete-dabbrev-expand-highlight-attribute))
            (save-excursion
              (goto-char location)
              (message "~A" (format nil "~A(~D): ~A"
                                    (buffer-name buffer)
                                    (current-line-number)
                                    (buffer-substring (progn (goto-bol) (point))
                                                      (progn (goto-eol) (point))))))))))))

(defun delete-dabbrev-expand-highlight-attribute ()
  (delete-hook '*pre-command-hook* 'delete-dabbrev-expand-highlight-attribute)
  (save-excursion
    (set-buffer (or ed::*last-dabbrevs-last-buffer* (selected-buffer)))
    (delete-text-attributes 'dabbrev-expand-highlight)))

(global-set-key #\M-/ 'dabbrev-expand-highlight)

2007/05/19 修正

-               (message (format nil "~A(~D): ~A"
+               (message "~A" (format nil "~A(~D): ~A"

))) RSS feed

生成するようにしました。


2004|06|07|08|09|10|11|12|
2005|01|02|03|04|05|06|07|08|09|10|12|
2006|01|03|05|06|08|09|10|12|
2007|01|02|03|05|07|12|
2008|10|
2009|01|05|12|
2010|04|05|11|
2011|01|09|12|
2012|02|03|05|09|12|
2013|02|03|
2014|05|09|
2015|12|
2017|09|
トップ «前の日記(2006-06-12 (Mon)) 最新 次の日記(2006-09-27 (Wed))» 編集 RSS feed