aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuanma Barranquero2008-05-02 08:51:17 +0000
committerJuanma Barranquero2008-05-02 08:51:17 +0000
commit7ebafc09f9b95f00816d6f694900fb1bf16510a8 (patch)
tree908611a1b549a4153f01fbf070c13a7abcfdaabf
parent6208735524881fbcecb67ca9d2a43eadf4c2fa3f (diff)
downloademacs-7ebafc09f9b95f00816d6f694900fb1bf16510a8.tar.gz
emacs-7ebafc09f9b95f00816d6f694900fb1bf16510a8.zip
(highlight-changes-mode): Removed references to hooks that no longer exist.
Because define-minor-mode is used the hook highlight-changes-mode-hook exists and can do what both the old hooks used to do. The documentation at the top of the file was updated to demonstrate this. (highlight-changes-mode): Remove commented out call to a hook function that is no longer there. (hilit-chg-set): Remove running of highlight-changes-enable-hook.
-rw-r--r--lisp/ChangeLog11
-rw-r--r--lisp/hilit-chg.el42
2 files changed, 26 insertions, 27 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 90017503bae..334ffe154a8 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,14 @@
12008-05-02 Richard Sharman <rsharman@pobox.com>
2
3 * hilit-chg.el (highlight-changes-mode): Removed references to
4 hooks that no longer exist. Because define-minor-mode is used the
5 hook highlight-changes-mode-hook exists and can do what both the
6 old hooks used to do. The documentation at the top of the file
7 was updated to demonstrate this.
8 (highlight-changes-mode): Remove commented out call to a hook
9 function that is no longer there.
10 (hilit-chg-set): Remove running of highlight-changes-enable-hook.
11
12008-05-02 Eric S. Raymond <esr@snark.thyrsus.com> 122008-05-02 Eric S. Raymond <esr@snark.thyrsus.com>
2 13
3 * vc.el (vc-default-dired-state-info): Change name of primitive 14 * vc.el (vc-default-dired-state-info): Change name of primitive
diff --git a/lisp/hilit-chg.el b/lisp/hilit-chg.el
index 5d85bc37615..5d2531d6e66 100644
--- a/lisp/hilit-chg.el
+++ b/lisp/hilit-chg.el
@@ -62,24 +62,17 @@
62;; You can automatically rotate faces when the buffer is saved; 62;; You can automatically rotate faces when the buffer is saved;
63;; see function `highlight-changes-rotate-faces' for how to do this. 63;; see function `highlight-changes-rotate-faces' for how to do this.
64 64
65;; There are two hooks used by `highlight-changes-mode': 65;; The hook `highlight-changes-mode-hook' is called when
66;; `highlight-changes-enable-hook' - is run when Highlight Changes mode 66;; Highlight Changes mode is turned on or off.
67;; is enabled for a buffer. 67;; When it called, variable `highlight-changes-mode' has been updated
68;; `highlight-changes-disable-hook' - is run when Highlight Changes mode 68;; to the new value.
69;; is disabled for a buffer.
70
71;; Example usage:
72;; (defun my-highlight-changes-enable-hook ()
73;; (add-hook 'write-file-functions 'highlight-changes-rotate-faces nil t)
74;; )
75;;
76;; (defun my-highlight-changes-disable-hook ()
77;; (remove-hook 'write-file-functions 'highlight-changes-rotate-faces t)
78;; )
79;; 69;;
80;; (add-hook 'highlight-changes-enable-hook 'my-highlight-changes-enable-hook) 70;; Example usage:
81;; (add-hook 'highlight-changes-disable-hook 71;; (defun my-highlight-changes-mode-hook ()
82;; 'my-highlight-changes-disable-hook) 72;; (if highlight-changes-mode
73;; (add-hook 'write-file-functions 'highlight-changes-rotate-faces nil t)
74;; (remove-hook 'write-file-functions 'highlight-changes-rotate-faces t)
75;; ))
83 76
84 77
85;; Automatically enabling Highlight Changes mode 78;; Automatically enabling Highlight Changes mode
@@ -175,7 +168,9 @@
175;; previous active/passive aspect of highlight-changes-mode. 168;; previous active/passive aspect of highlight-changes-mode.
176;; - Removed highlight-changes-toggle-hook 169;; - Removed highlight-changes-toggle-hook
177;; - Put back eval-and-compile inadvertently dropped 170;; - Put back eval-and-compile inadvertently dropped
178 171;; May 2008
172;; - Removed highlight-changes-disable-hook and highlight-changes-enable-hook
173;; because highlight-changes-mode-hook can do both.
179 174
180;;; Code: 175;;; Code:
181 176
@@ -353,11 +348,7 @@ Other functions for buffers in this mode include:
353through various faces. 348through various faces.
354\\[highlight-compare-with-file] - mark text as changed by comparing this 349\\[highlight-compare-with-file] - mark text as changed by comparing this
355buffer with the contents of a file 350buffer with the contents of a file
356\\[highlight-compare-buffers] highlights differences between two buffers. 351\\[highlight-compare-buffers] highlights differences between two buffers."
357
358Hook variables:
359`highlight-changes-enable-hook': called when enabling Highlight Changes mode.
360`highlight-changes-disable-hook': called when disabling Highlight Changes mode."
361 nil ;; init-value 352 nil ;; init-value
362 hilit-chg-string ;; lighter 353 hilit-chg-string ;; lighter
363 nil ;; keymap 354 nil ;; keymap
@@ -372,8 +363,6 @@ Hook variables:
372 (setq highlight-changes-mode (not highlight-changes-mode))) 363 (setq highlight-changes-mode (not highlight-changes-mode)))
373 (if highlight-changes-mode 364 (if highlight-changes-mode
374 ;; it is being turned on 365 ;; it is being turned on
375 ;; the hook has been moved into hilit-chg-set
376 ;; (run-hooks 'highlight-changes-enable-hook))
377 (hilit-chg-set) 366 (hilit-chg-set)
378 ;; mode is turned off 367 ;; mode is turned off
379 (hilit-chg-clear))) 368 (hilit-chg-clear)))
@@ -634,8 +623,7 @@ This allows you to manually remove highlighting from uninteresting changes."
634 (setq highlight-changes-visible-mode highlight-changes-visibility-initial-state) 623 (setq highlight-changes-visible-mode highlight-changes-visibility-initial-state)
635 (hilit-chg-update) 624 (hilit-chg-update)
636 (force-mode-line-update) 625 (force-mode-line-update)
637 (add-hook 'after-change-functions 'hilit-chg-set-face-on-change nil t) 626 (add-hook 'after-change-functions 'hilit-chg-set-face-on-change nil t))
638 (run-hooks 'highlight-changes-enable-hook))
639 627
640(defun hilit-chg-clear () 628(defun hilit-chg-clear ()
641 "Remove Highlight Changes mode for this buffer. 629 "Remove Highlight Changes mode for this buffer.