help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: Rmail does not mark buffer modified when unread message is shown


From: Göktuğ Kayaalp
Subject: Re: Rmail does not mark buffer modified when unread message is shown
Date: Mon, 07 May 2018 22:30:57 +0300

On 2018-05-07 20:41 +03, Eli Zaretskii <eliz@gnu.org> wrote:
>> From: Göktuğ Kayaalp <self@gkayaalp.com>
>> Cc: help-gnu-emacs@gnu.org
>> Date: Mon, 07 May 2018 01:17:43 +0300
>> 
>> On 2018-05-06 05:41 +03, Eli Zaretskii <eliz@gnu.org> wrote:
>> > If you start Emacs as "emacs -Q" and then invoke "C-u M-x rmail RET"
>> > on an mbox file, do the problems go away?  For this experiment, please
>> > try an mbox file that wasn't converted as you described, but came from
>> > somewhere else, for example from the archives of this list.
>> 
>> I tried this, the buffer modified flag is not flipped and thus ‘s’ and
>> ‘C-x C-s’ don't work, the latter causing the message «(No changes need
>> to be saved)» to be displayed.
>
> Yes, I remember now: this is a feature.  Just reading a message
> doesn't mark the inbox buffer modified, although it does remove the
> "unseen" attribute from the message (you can see that, e.g., in the
> Summary buffer, where unseen messages have their summary line
> highlighted).
>
> The reasons for this behavior are largely historical now: they have to
> do with the move from Babyl to mbox format for storing messages in
> files.  We could change this behavior, but I guess at this point it's
> burnt into too many muscle memories.  In practice, this never presents
> a problem, because it's a rare case that you read your new mail and
> don't delete or file away even a single message.  The latter two
> operations do mark the inbox buffer modified.  So to wqork around
> this, just do 'd', then 'u', and you will be able to save your inbox.

Thank you for the explanation!  I have written the following function to
help with that after reading this message, thought I'd include it for
anyone who may end up here searching for this:

(defun gk-rmail-force-expunge-and-save ()
  (interactive)
  (set-buffer-modified-p t)
  (rmail-expunge-and-save))

I've bound this to ‘S’ to which Rmail does not bind anything.

All the best!

-- 
İ. Göktuğ Kayaalp       <https://www.gkayaalp.com/>
                         024C 30DD 597D 142B 49AC
                         40EB 465C D949 B101 2427



reply via email to

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