[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Is this correct?
From: |
Eli Zaretskii |
Subject: |
Re: Is this correct? |
Date: |
Sun, 27 Feb 2011 06:00:24 +0200 |
> From: Tim X <timx@nospam.dev.null>
> Date: Sun, 27 Feb 2011 09:38:14 +1100
>
> > I gets better: `(set-buffer-modified-p (buffer-modified-p))'
> > apparently does nothing, because it sets the buffer's modified flag to
> > the same value it has already. So this function actually does nothing
> > at all, right?
> >
>
> I looked at the C code that implements set-buffer-modified-p at it seems
> to me (who freely admits not understanding the low C level of emacs!)
> that as a side effect, the function updates mode-lines etc regardless of
> the setting/value for buffer-modified-p. Therefore, my interpretation
> was that this would call the function without actually changing the
> state of the modified flag and by side effect, result in an update of
> the mode-line.
Yes. My text was ironic: it was supposed to hint that there _is_ some
magic here.
> I do agree it doesn't look right and personally don't like code which
> does something via a non-intuitive/obvious side effect. While possibly
> convenient, from a maintenance standpoint, it would be better if it was
> more deliberate/obvious IMO.
Nothing about the Emacs redisplay is intuitive or obvious.
- Re: Is this correct?, (continued)
Re: Is this correct?, Uday Reddy, 2011/02/26
Message not available