diff options
| author | Martin Rudalics | 2007-05-17 08:42:29 +0000 |
|---|---|---|
| committer | Martin Rudalics | 2007-05-17 08:42:29 +0000 |
| commit | 10e3e762bf0c91e3dbbbbc18a72c7e4a57ea118b (patch) | |
| tree | 4837f0b2670e10328c72ee40b8f6d2013ed2fdb0 | |
| parent | e92552706ed7987d6f75efa000e793f5ec0d7991 (diff) | |
| download | emacs-10e3e762bf0c91e3dbbbbc18a72c7e4a57ea118b.tar.gz emacs-10e3e762bf0c91e3dbbbbc18a72c7e4a57ea118b.zip | |
(highlight-changes-rotate-faces): Don't set
modified flag of buffer. Use `inhibit-modification-hooks'.
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/hilit-chg.el | 42 |
2 files changed, 36 insertions, 11 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 679659bbe35..bca021e7add 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2007-05-17 Martin Rudalics <rudalics@gmx.at> | ||
| 2 | |||
| 3 | * hilit-chg.el (highlight-changes-rotate-faces): Don't set | ||
| 4 | modified flag of buffer. Use `inhibit-modification-hooks'. | ||
| 5 | |||
| 1 | 2007-05-16 Richard Stallman <rms@gnu.org> | 6 | 2007-05-16 Richard Stallman <rms@gnu.org> |
| 2 | 7 | ||
| 3 | * buff-menu.el (Buffer-menu-sort-column): Doc fix. | 8 | * buff-menu.el (Buffer-menu-sort-column): Doc fix. |
diff --git a/lisp/hilit-chg.el b/lisp/hilit-chg.el index c867bcfaf08..19cecb1c8be 100644 --- a/lisp/hilit-chg.el +++ b/lisp/hilit-chg.el | |||
| @@ -790,17 +790,37 @@ this, eval the following in the buffer to be saved: | |||
| 790 | (interactive) | 790 | (interactive) |
| 791 | ;; If not in active mode do nothing but don't complain because this | 791 | ;; If not in active mode do nothing but don't complain because this |
| 792 | ;; may be bound to a hook. | 792 | ;; may be bound to a hook. |
| 793 | (if (eq highlight-changes-mode 'active) | 793 | (when (eq highlight-changes-mode 'active) |
| 794 | (let ((after-change-functions nil)) | 794 | (let ((modified (buffer-modified-p)) |
| 795 | ;; ensure hilit-chg-list is made and up to date | 795 | (inhibit-modification-hooks t)) |
| 796 | (hilit-chg-make-list) | 796 | ;; The `modified' related code tries to combine two goals: (1) Record the |
| 797 | ;; remove our existing overlays | 797 | ;; rotation in `buffer-undo-list' and (2) avoid setting the modified flag |
| 798 | (hilit-chg-hide-changes) | 798 | ;; of the current buffer due to the rotation. We do this by inserting (in |
| 799 | ;; for each change text property, increment it | 799 | ;; `buffer-undo-list') entries restoring buffer-modified-p to nil before |
| 800 | (hilit-chg-map-changes 'hilit-chg-bump-change) | 800 | ;; and after the entry for the rotation. |
| 801 | ;; and display them all if active | 801 | (unless modified |
| 802 | (if (eq highlight-changes-mode 'active) | 802 | ;; Install the "before" entry. |
| 803 | (hilit-chg-display-changes)))) | 803 | (setq buffer-undo-list |
| 804 | (cons '(apply restore-buffer-modified-p nil) | ||
| 805 | buffer-undo-list))) | ||
| 806 | (unwind-protect | ||
| 807 | (progn | ||
| 808 | ;; ensure hilit-chg-list is made and up to date | ||
| 809 | (hilit-chg-make-list) | ||
| 810 | ;; remove our existing overlays | ||
| 811 | (hilit-chg-hide-changes) | ||
| 812 | ;; for each change text property, increment it | ||
| 813 | (hilit-chg-map-changes 'hilit-chg-bump-change) | ||
| 814 | ;; and display them all if active | ||
| 815 | (if (eq highlight-changes-mode 'active) | ||
| 816 | (hilit-chg-display-changes))) | ||
| 817 | (unless modified | ||
| 818 | ;; Install the "after" entry. | ||
| 819 | (setq buffer-undo-list | ||
| 820 | (cons '(apply restore-buffer-modified-p nil) | ||
| 821 | buffer-undo-list)) | ||
| 822 | |||
| 823 | (restore-buffer-modified-p nil))))) | ||
| 804 | ;; This always returns nil so it is safe to use in write-file-functions | 824 | ;; This always returns nil so it is safe to use in write-file-functions |
| 805 | nil) | 825 | nil) |
| 806 | 826 | ||