ちょっとした差分(その2)
昨日少し使ってみて、こっちの方が見やすいかなぁと思ったので適当に変える。
(defun compare-windows++ () "画面が分割されてない時は分割する.色も少し付ける。" (interactive) (when (< (count-windows nil) 2) (let ((curbuf (selected-buffer)) buf) (setq buf (buffer-selector)) ;read-file-nameでもいいかもしれない。 (when buf (split-window-vertically) (other-window) (set-buffer buf))) (return-from compare-windows++)) (compare-windows) (unless (eobp) (apply #'set-text-attribute (point) (and (goto-eol) (point)) 'diff-point *compare-windows-diff-color*) (other-window) (apply #'set-text-attribute (point) (and (goto-eol) (point)) 'diff-point *compare-windows-diff-color*) (other-window) (sit-for 5) (delete-text-attributes 'diff-point) ))
まあ、xyzzyにはDiffが使える拡張があるので普通の比較はDiffでやると良いような気もするけど、自分の場合はDiffとか殆ど使ってない。何か操作とか面倒だし。そんな難しい比較もしないし。
なんか2回もset-text-attributeするのが微妙な木がするけど、まあ良いことにした。