[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: highlight-changes-rotate-faces sets buffer modified flag

From: martin rudalics
Subject: Re: highlight-changes-rotate-faces sets buffer modified flag
Date: Tue, 08 May 2007 08:10:45 +0200
User-agent: Mozilla Thunderbird 1.0 (Windows/20041206)

> 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

reply via email to

[Prev in Thread] Current Thread [Next in Thread]