emacs-devel
[Top][All Lists]
Advanced

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

Re: address@hidden: highlight-changes-rotate-faces sets buffer modified


From: martin rudalics
Subject: Re: address@hidden: highlight-changes-rotate-faces sets buffer modified flag]
Date: Wed, 09 May 2007 08:44:15 +0200
User-agent: Mozilla Thunderbird 1.0 (Windows/20041206)

> I don't know how to use this feature, but looking at the code suggests
> that this bug still exists.  Can anyone verify that?
>
> It should be pretty easy to prevent this code from changing the
> modified flag (and perhaps bind buffer-undo-list to t).  I am not sure
> where the change should be made, though.  Would someone familiar with
> this package please take a look and DTRT?

At second sight I would _not_ change the code at all.

(1) With the current code the first undo after saving a buffer would
undo the change done by `highlight-changes-rotate-faces' and incorrectly
make the buffer appear modified.  Changing the code by resetting the
buffer-modified flag and _not_ let-binding `buffer-undo-list' wouldn't
ameliorate anything here.

(2) Suppose I reset the buffer-modified flag and bind `buffer-undo-list'
to t as in my patch.  In this case I would not be able to undo the
change caused by `highlight-changes-rotate-faces' and end up with quite
confusing colors after an arbitrary sequence of undos and saves.

`highlight-changes-rotate-faces' is supposed to run by a hook within
code that resets the buffer-modified flag.  We could say so in the
doc-string of that function to avoid confusion for the case that the
function is called interactively (the OP's problem, IIUC).

The problem described in (1) could be probably resolved by setting undo
boundaries around the last "real" buffer change(s) and the subsequent
color rotation but I doubt that it's worth the trouble.





reply via email to

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