all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Re: highlight-changes-rotate-faces sets buffer modified flag
@ 2007-05-08  6:10 martin rudalics
  2007-05-09  9:29 ` Reindert-Jan Ekker
  0 siblings, 1 reply; 6+ messages in thread
From: martin rudalics @ 2007-05-08  6:10 UTC (permalink / raw)
  To: R.Ekker; +Cc: bug-gnu-emacs

 > Running the function highlight-changes-rotate-faces sets the buffer's
 > modified flag. It seems to me that this should not happen, since only
 > some faces are changed.

Thank you for sending a report on this.  In principle a "face change"
may change the buffer-modified state and can be undone as well.  In the
present case I agree with you that the buffer-modified state should not
change.  I believe that most of theses face changes were obscured by
changes in the buffer text, hence probably people didn't notice.

 > As a workaround, I use the following advice:
 >
 >
 > ;; advice for highlight-changes-rotate-faces
 > ;; so that it does not change the modified flag for the buffer
 > (defadvice highlight-changes-rotate-faces (around around-rotate-faces)
 >   (let ((was-modified (buffer-modified-p)))
 >         ad-do-it
 >         (unless was-modified
 >           (set-buffer-modified-p nil))))
 > (ad-activate 'highlight-changes-rotate-faces)

You proably do not want adding an entry to `buffer-undo-list' either.

 >
 >
 > The version string of my emacs:
 > "GNU Emacs 21.3.1 (i386-mingw-nt5.1.2600) of 2004-03-10 on NYAUMO"

AFAICT this problem is still present in Emacs 22.  In addition, it seems
to me that turning off `highlight-changes-mode' may set the
buffer-modified state as well.  Could you please verify this on your
system?

^ permalink raw reply	[flat|nested] 6+ messages in thread
* highlight-changes-rotate-faces sets buffer modified flag
@ 2007-05-07 15:30 Reindert-Jan Ekker
  0 siblings, 0 replies; 6+ messages in thread
From: Reindert-Jan Ekker @ 2007-05-07 15:30 UTC (permalink / raw)
  To: bug-gnu-emacs

L.S.

Running the function highlight-changes-rotate-faces sets the buffer's 
modified flag. It seems to me that this should not happen, since only some 
faces are changed. As a workaround, I use the following advice:

;; advice for highlight-changes-rotate-faces
;; so that it does not change the modified flag for the buffer
(defadvice highlight-changes-rotate-faces (around around-rotate-faces)
   (let ((was-modified (buffer-modified-p)))
 	ad-do-it
 	(unless was-modified
 	  (set-buffer-modified-p nil))))
(ad-activate 'highlight-changes-rotate-faces)

The version string of my emacs:
"GNU Emacs 21.3.1 (i386-mingw-nt5.1.2600) of 2004-03-10 on NYAUMO"

With kind regards,

Reindert-Jan Ekker

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2007-05-09 16:53 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-05-08  6:10 highlight-changes-rotate-faces sets buffer modified flag martin rudalics
2007-05-09  9:29 ` Reindert-Jan Ekker
2007-05-09 12:24   ` martin rudalics
2007-05-09 13:41     ` Reindert-Jan Ekker
2007-05-09 16:53       ` martin rudalics
  -- strict thread matches above, loose matches on Subject: below --
2007-05-07 15:30 Reindert-Jan Ekker

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.