(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)
- (message (format nil "~A(~D): ~A" + (message "~A" (format nil "~A(~D): ~A"
生成するようにしました。