Commit 10e3e762 authored by Martin Rudalics's avatar Martin Rudalics
Browse files

(highlight-changes-rotate-faces): Don't set

modified flag of buffer.  Use `inhibit-modification-hooks'.
parent e9255270
2007-05-17 Martin Rudalics <rudalics@gmx.at>
* hilit-chg.el (highlight-changes-rotate-faces): Don't set
modified flag of buffer. Use `inhibit-modification-hooks'.
2007-05-16 Richard Stallman <rms@gnu.org> 2007-05-16 Richard Stallman <rms@gnu.org>
   
* buff-menu.el (Buffer-menu-sort-column): Doc fix. * buff-menu.el (Buffer-menu-sort-column): Doc fix.
...@@ -790,17 +790,37 @@ this, eval the following in the buffer to be saved: ...@@ -790,17 +790,37 @@ this, eval the following in the buffer to be saved:
(interactive) (interactive)
;; If not in active mode do nothing but don't complain because this ;; If not in active mode do nothing but don't complain because this
;; may be bound to a hook. ;; may be bound to a hook.
(if (eq highlight-changes-mode 'active) (when (eq highlight-changes-mode 'active)
(let ((after-change-functions nil)) (let ((modified (buffer-modified-p))
;; ensure hilit-chg-list is made and up to date (inhibit-modification-hooks t))
(hilit-chg-make-list) ;; The `modified' related code tries to combine two goals: (1) Record the
;; remove our existing overlays ;; rotation in `buffer-undo-list' and (2) avoid setting the modified flag
(hilit-chg-hide-changes) ;; of the current buffer due to the rotation. We do this by inserting (in
;; for each change text property, increment it ;; `buffer-undo-list') entries restoring buffer-modified-p to nil before
(hilit-chg-map-changes 'hilit-chg-bump-change) ;; and after the entry for the rotation.
;; and display them all if active (unless modified
(if (eq highlight-changes-mode 'active) ;; Install the "before" entry.
(hilit-chg-display-changes)))) (setq buffer-undo-list
(cons '(apply restore-buffer-modified-p nil)
buffer-undo-list)))
(unwind-protect
(progn
;; ensure hilit-chg-list is made and up to date
(hilit-chg-make-list)
;; remove our existing overlays
(hilit-chg-hide-changes)
;; for each change text property, increment it
(hilit-chg-map-changes 'hilit-chg-bump-change)
;; and display them all if active
(if (eq highlight-changes-mode 'active)
(hilit-chg-display-changes)))
(unless modified
;; Install the "after" entry.
(setq buffer-undo-list
(cons '(apply restore-buffer-modified-p nil)
buffer-undo-list))
(restore-buffer-modified-p nil)))))
;; This always returns nil so it is safe to use in write-file-functions ;; This always returns nil so it is safe to use in write-file-functions
nil) nil)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment