emacs-devel
[Top][All Lists]
Advanced

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

Re: Misunderstanding set-buffer-modified-p?


From: Eric Abrahamsen
Subject: Re: Misunderstanding set-buffer-modified-p?
Date: Sat, 02 Jan 2021 11:04:34 -0800
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Lars Ingebrigtsen <larsi@gnus.org> writes:

> Eric Abrahamsen <eric@ericabrahamsen.net> writes:
>
>> It "doesn't work", in the sense that the buffer modeline is still marked
>> modified after the function completes. It's not just a redisplay issue,
>> either: running M-: (buffer-modified-p) returns t.
>
> [...]
>
>> Can anyone tell me if I'm doing something wrong, or I've understood
>> something incorrectly?
>
> I think what you're doing should work, so I'm wondering whether
> something in the code is changing the current buffer, and you're calling
> (set-buffer-modified-p nil) in the wrong buffer?  Not that any of the
> functions between `with-current-buffer' and setting the modified flag
> look suspicious, but...

Sheesh, that was the right hint, and I should have been able to see that
myself. `sieve-buffer' isn't the script buffer, it's the "control panel"
buffer, so the call to `set-buffer-modified-p' belongs outside the
`with-current-buffer'. Thanks for the nudge.

Eric




reply via email to

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