diff options
| author | Juri Linkov | 2014-12-28 02:48:05 +0200 |
|---|---|---|
| committer | Juri Linkov | 2014-12-28 02:48:05 +0200 |
| commit | d143df5a4ecff352470f09019364310ec8e2202b (patch) | |
| tree | 4b60eeac502d9a904bd8d5d1c0ca8ea52c97f53d /lisp | |
| parent | 2cb7592275bce47e44916134223b994a75e4b861 (diff) | |
| download | emacs-d143df5a4ecff352470f09019364310ec8e2202b.tar.gz emacs-d143df5a4ecff352470f09019364310ec8e2202b.zip | |
Use diff faces for compare-windows
* lisp/vc/compare-w.el: Require diff-mode for diff faces.
(compare-windows-removed, compare-windows-added): New faces
inheriting from diff faces.
(compare-windows): Define obsolete face alias.
(compare-windows-highlight): Replace face `compare-windows' with
new faces `compare-windows-added' and `compare-windows-removed'.
(compare-windows-get-recent-window): Signal an error when
no other window is found.
Fixes: debbugs:19451
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/ChangeLog | 12 | ||||
| -rw-r--r-- | lisp/vc/compare-w.el | 25 |
2 files changed, 30 insertions, 7 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 57103be22a0..bfe2dfb6f2e 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,15 @@ | |||
| 1 | 2014-12-28 Juri Linkov <juri@linkov.net> | ||
| 2 | |||
| 3 | * vc/compare-w.el: Require diff-mode for diff faces. | ||
| 4 | (compare-windows-removed, compare-windows-added): New faces | ||
| 5 | inheriting from diff faces. | ||
| 6 | (compare-windows): Define obsolete face alias. | ||
| 7 | (compare-windows-highlight): Replace face `compare-windows' with | ||
| 8 | new faces `compare-windows-added' and `compare-windows-removed' | ||
| 9 | (bug#19451). | ||
| 10 | (compare-windows-get-recent-window): Signal an error when | ||
| 11 | no other window is found (bug#19170). | ||
| 12 | |||
| 1 | 2014-12-27 Dmitry Gutov <dgutov@yandex.ru> | 13 | 2014-12-27 Dmitry Gutov <dgutov@yandex.ru> |
| 2 | 14 | ||
| 3 | * progmodes/elisp-mode.el (elisp--xref-identifier-file): | 15 | * progmodes/elisp-mode.el (elisp--xref-identifier-file): |
diff --git a/lisp/vc/compare-w.el b/lisp/vc/compare-w.el index 3b8293cda24..454139e9025 100644 --- a/lisp/vc/compare-w.el +++ b/lisp/vc/compare-w.el | |||
| @@ -30,6 +30,8 @@ | |||
| 30 | 30 | ||
| 31 | ;;; Code: | 31 | ;;; Code: |
| 32 | 32 | ||
| 33 | (require 'diff-mode) ; For diff faces. | ||
| 34 | |||
| 33 | (defgroup compare-windows nil | 35 | (defgroup compare-windows nil |
| 34 | "Compare text between windows." | 36 | "Compare text between windows." |
| 35 | :prefix "compare-" | 37 | :prefix "compare-" |
| @@ -128,11 +130,19 @@ out all highlighting later with the command `compare-windows-dehighlight'." | |||
| 128 | :group 'compare-windows | 130 | :group 'compare-windows |
| 129 | :version "22.1") | 131 | :version "22.1") |
| 130 | 132 | ||
| 131 | (defface compare-windows | 133 | (defface compare-windows-removed |
| 132 | '((t :inherit lazy-highlight)) | 134 | '((t :inherit diff-removed)) |
| 133 | "Face for highlighting of compare-windows difference regions." | 135 | "Face for highlighting of compare-windows removed regions." |
| 134 | :group 'compare-windows | 136 | :group 'compare-windows |
| 135 | :version "22.1") | 137 | :version "25.1") |
| 138 | |||
| 139 | (defface compare-windows-added | ||
| 140 | '((t :inherit diff-added)) | ||
| 141 | "Face for highlighting of compare-windows added regions." | ||
| 142 | :group 'compare-windows | ||
| 143 | :version "25.1") | ||
| 144 | |||
| 145 | (define-obsolete-face-alias 'compare-windows 'compare-windows-added "25.1") | ||
| 136 | 146 | ||
| 137 | (defvar compare-windows-overlay1 nil) | 147 | (defvar compare-windows-overlay1 nil) |
| 138 | (defvar compare-windows-overlay2 nil) | 148 | (defvar compare-windows-overlay2 nil) |
| @@ -158,7 +168,8 @@ then try to get a window on an iconified frame, and finally | |||
| 158 | consider all existing frames." | 168 | consider all existing frames." |
| 159 | (or (get-mru-window 'visible t t) | 169 | (or (get-mru-window 'visible t t) |
| 160 | (get-mru-window 0 t t) | 170 | (get-mru-window 0 t t) |
| 161 | (get-mru-window t t t))) | 171 | (get-mru-window t t t) |
| 172 | (error "No other window"))) | ||
| 162 | 173 | ||
| 163 | (defun compare-windows-get-next-window () | 174 | (defun compare-windows-get-next-window () |
| 164 | "Return the window next in the cyclic ordering of windows. | 175 | "Return the window next in the cyclic ordering of windows. |
| @@ -393,13 +404,13 @@ on third call it again advances points to the next difference and so on." | |||
| 393 | (if compare-windows-overlay1 | 404 | (if compare-windows-overlay1 |
| 394 | (move-overlay compare-windows-overlay1 beg1 end1 b1) | 405 | (move-overlay compare-windows-overlay1 beg1 end1 b1) |
| 395 | (setq compare-windows-overlay1 (make-overlay beg1 end1 b1)) | 406 | (setq compare-windows-overlay1 (make-overlay beg1 end1 b1)) |
| 396 | (overlay-put compare-windows-overlay1 'face 'compare-windows) | 407 | (overlay-put compare-windows-overlay1 'face 'compare-windows-added) |
| 397 | (overlay-put compare-windows-overlay1 'priority 1000)) | 408 | (overlay-put compare-windows-overlay1 'priority 1000)) |
| 398 | (overlay-put compare-windows-overlay1 'window w1) | 409 | (overlay-put compare-windows-overlay1 'window w1) |
| 399 | (if compare-windows-overlay2 | 410 | (if compare-windows-overlay2 |
| 400 | (move-overlay compare-windows-overlay2 beg2 end2 b2) | 411 | (move-overlay compare-windows-overlay2 beg2 end2 b2) |
| 401 | (setq compare-windows-overlay2 (make-overlay beg2 end2 b2)) | 412 | (setq compare-windows-overlay2 (make-overlay beg2 end2 b2)) |
| 402 | (overlay-put compare-windows-overlay2 'face 'compare-windows) | 413 | (overlay-put compare-windows-overlay2 'face 'compare-windows-removed) |
| 403 | (overlay-put compare-windows-overlay2 'priority 1000)) | 414 | (overlay-put compare-windows-overlay2 'priority 1000)) |
| 404 | (overlay-put compare-windows-overlay2 'window w2) | 415 | (overlay-put compare-windows-overlay2 'window w2) |
| 405 | (if (not (eq compare-windows-highlight 'persistent)) | 416 | (if (not (eq compare-windows-highlight 'persistent)) |