From: "Göktuğ Kayaalp" <self@gkayaalp.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: help-gnu-emacs@gnu.org
Subject: Re: Rmail does not mark buffer modified when unread message is shown
Date: Mon, 07 May 2018 22:30:57 +0300 [thread overview]
Message-ID: <ygm7eofl0um.fsf@gkayaalp.com> (raw)
In-Reply-To: <83in7zqs6s.fsf@gnu.org> (message from Eli Zaretskii on Mon, 07 May 2018 20:41:31 +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
prev parent reply other threads:[~2018-05-07 19:30 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-05 21:02 Rmail does not mark buffer modified when unread message is shown Göktuğ Kayaalp
2018-05-06 2:41 ` Eli Zaretskii
2018-05-06 22:17 ` Göktuğ Kayaalp
2018-05-07 17:41 ` Eli Zaretskii
2018-05-07 19:30 ` Göktuğ Kayaalp [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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ygm7eofl0um.fsf@gkayaalp.com \
--to=self@gkayaalp.com \
--cc=eliz@gnu.org \
--cc=help-gnu-emacs@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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.