* Rmail does not mark buffer modified when unread message is shown
@ 2018-05-05 21:02 Göktuğ Kayaalp
2018-05-06 2:41 ` Eli Zaretskii
0 siblings, 1 reply; 5+ messages in thread
From: Göktuğ Kayaalp @ 2018-05-05 21:02 UTC (permalink / raw)
To: help-gnu-emacs
I'm considering a switch to Rmail from Gnus. I've converted my nnml
boxes to mboxes using a couple python scripts [1], and am fetching new
mail via mpop. My Rmail configuraiton is found below. When browsing the
Rmail buffer, after viewing unseen messages, the buffer is not marked
modified, and neither ‘s’ nor ‘C-x C-s’ save anythign. When I look at
the Rmail header in the mbox itself, I see that the unseen attribute is
not changed, it is always U (understandably given I can't save the
buffer). The only way to actually preserve the changes is to manually
toggle the buffer modified bit and hitting ‘s’. What is going wrong?
BTW I've narrowed the problem down to the last two ifs in
‘rmail-set-attribute’, the then branch of the outer one is executed for
a reason that IDK. And I've used Rmail with mpop before without
problems.
Rmail config:
gk-mail-home is a path to a directory.
(setf
rmail-primary-inbox-list
(list (getenv "MAIL")
(expand-file-name "inbox" gk-mail-home))
rmail-secondary-file-directory gk-mail-home
rmail-file-name (expand-file-name "current" gk-mail-home))
[1] nnml2mbox.py and splitmbox.py here:
https://github.com/cadadr/configuration/tree/master/bin
Thanks in advance!
--
İ. Göktuğ Kayaalp <https://www.gkayaalp.com/>
024C 30DD 597D 142B 49AC
40EB 465C D949 B101 2427
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Rmail does not mark buffer modified when unread message is shown
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
0 siblings, 1 reply; 5+ messages in thread
From: Eli Zaretskii @ 2018-05-06 2:41 UTC (permalink / raw)
To: help-gnu-emacs
> From: Göktuğ Kayaalp <self@gkayaalp.com>
> Date: Sun, 06 May 2018 00:02:47 +0300
>
> I'm considering a switch to Rmail from Gnus. I've converted my nnml
> boxes to mboxes using a couple python scripts [1], and am fetching new
> mail via mpop. My Rmail configuraiton is found below. When browsing the
> Rmail buffer, after viewing unseen messages, the buffer is not marked
> modified, and neither ‘s’ nor ‘C-x C-s’ save anythign. When I look at
> the Rmail header in the mbox itself, I see that the unseen attribute is
> not changed, it is always U (understandably given I can't save the
> buffer). The only way to actually preserve the changes is to manually
> toggle the buffer modified bit and hitting ‘s’. What is going wrong?
> BTW I've narrowed the problem down to the last two ifs in
> ‘rmail-set-attribute’, the then branch of the outer one is executed for
> a reason that IDK. And I've used Rmail with mpop before without
> problems.
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.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Rmail does not mark buffer modified when unread message is shown
2018-05-06 2:41 ` Eli Zaretskii
@ 2018-05-06 22:17 ` Göktuğ Kayaalp
2018-05-07 17:41 ` Eli Zaretskii
0 siblings, 1 reply; 5+ messages in thread
From: Göktuğ Kayaalp @ 2018-05-06 22:17 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: help-gnu-emacs
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.
BTW I currently use Emacs built from master branch commit 6464a8d70, and
when I sent the initial message I was using a build of master from last
Sunday.
--
İ. Göktuğ Kayaalp <https://www.gkayaalp.com/>
024C 30DD 597D 142B 49AC
40EB 465C D949 B101 2427
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Rmail does not mark buffer modified when unread message is shown
2018-05-06 22:17 ` Göktuğ Kayaalp
@ 2018-05-07 17:41 ` Eli Zaretskii
2018-05-07 19:30 ` Göktuğ Kayaalp
0 siblings, 1 reply; 5+ messages in thread
From: Eli Zaretskii @ 2018-05-07 17:41 UTC (permalink / raw)
To: help-gnu-emacs
> 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.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Rmail does not mark buffer modified when unread message is shown
2018-05-07 17:41 ` Eli Zaretskii
@ 2018-05-07 19:30 ` Göktuğ Kayaalp
0 siblings, 0 replies; 5+ messages in thread
From: Göktuğ Kayaalp @ 2018-05-07 19:30 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: help-gnu-emacs
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
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2018-05-07 19:30 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 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).