unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Eric Abrahamsen <eric@ericabrahamsen.net>
To: emacs-devel@gnu.org
Subject: Re: Misunderstanding set-buffer-modified-p?
Date: Sat, 02 Jan 2021 11:04:34 -0800	[thread overview]
Message-ID: <87o8i7kvnh.fsf@ericabrahamsen.net> (raw)
In-Reply-To: 87zh1r98r4.fsf@gnus.org

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	other threads:[~2021-01-02 19:04 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-02  0:39 Misunderstanding set-buffer-modified-p? Eric Abrahamsen
2021-01-02  6:02 ` Lars Ingebrigtsen
2021-01-02 19:04   ` Eric Abrahamsen [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87o8i7kvnh.fsf@ericabrahamsen.net \
    --to=eric@ericabrahamsen.net \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).