unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Re: Unseen attribute doesn't get saved in rmail
@ 2021-01-11 12:28 Andrea G. Monaco
  2021-01-11 15:34 ` Eli Zaretskii
  0 siblings, 1 reply; 8+ messages in thread
From: Andrea G. Monaco @ 2021-01-11 12:28 UTC (permalink / raw)
  To: emacs-devel


  > I'm asking why is it important for your purposes to know whether the
  > mail was read for the first time or not.  Because if it isn't very
  > important, the solution I proposed should work for you.

My mailboxes get pretty big, some gigabytes usually, so saving the
buffer takes some seconds. I only want to save it if it got modified, for
example because I read some messages for the first time and thus changed
their unseen flag.


  > That's the reason Rmail doesn't already have the feature you
  > want: I guess no one else uses it as you do

Some features are more or less used than others. But saying that some
use case is completely nonexistent is pretty strong: can you
substantiate this claim?  Unless you are arguing that a feature being
absent means that no one wants it: I would obviously disagree with that
claim.

There's at least one person (probably more) who is unhappy with that
behavior of rmail, and that's me.


Cheers,
Andrea Monaco



^ permalink raw reply	[flat|nested] 8+ messages in thread
* Re: Unseen attribute doesn't get saved in rmail
@ 2021-01-08 21:33 Andrea G. Monaco
  2021-01-09  7:44 ` Eli Zaretskii
  0 siblings, 1 reply; 8+ messages in thread
From: Andrea G. Monaco @ 2021-01-08 21:33 UTC (permalink / raw)
  To: emacs-devel


  > Why does it matter for your purposes?


I usually don't delete my mail, I just read it, so it's important for me
to keep track of read mail. For this use case, which I think is pretty
common, clearing the unseen flag in a message should set the modified
flag for the RMAIL buffer.

Otherwise I have to manually set the flag in order to save the file, if
I understand correctly. That seems like an unnecessary workaround.


Warmly,
Andrea Monaco




^ permalink raw reply	[flat|nested] 8+ messages in thread
* Re: Unseen attribute doesn't get saved in rmail
@ 2021-01-02 20:05 Andrea G. Monaco
  2021-01-02 20:20 ` Eli Zaretskii
  0 siblings, 1 reply; 8+ messages in thread
From: Andrea G. Monaco @ 2021-01-02 20:05 UTC (permalink / raw)
  To: emacs-devel


  > I think you can use rmail-show-message-hook to call a function that
  > sets the buffer's modified flag, then reading a message will leave
  > that set.


Thanks, I didn't know about that hook.

But I wonder if that workaround is enough: I saw that the hook is called
at the end of the function rmail-show-message-1, but after the snippet
that I posted the information I care about is lost: we don't know if the
mail was just read for the first time or not; so we can't set the
modified flag meaningfully.

Is that correct?


Andrea Monaco



^ permalink raw reply	[flat|nested] 8+ messages in thread
* Unseen attribute doesn't get saved in rmail
@ 2020-12-31 14:03 Andrea G. Monaco
  2020-12-31 16:31 ` Eli Zaretskii
  0 siblings, 1 reply; 8+ messages in thread
From: Andrea G. Monaco @ 2020-12-31 14:03 UTC (permalink / raw)
  To: emacs-devel

Hello everyone,


there's a behavior in rmail I can't quite understand.
I never delete my mail, I just read it. So here's the problem: when some
messages are read and marked as such, the modified flag of the RMAIL
buffer apparently stays cleared, so Emacs doesn't offer to save it when I
close the editor.
This way I lose track of read mail every time.

I think these are the relevant lines in rmail.el inside
rmail-show-message-1: 


  ;; Mark the message as seen, but preserve buffer modified flag.
  (let ((modiff (buffer-modified-p)))
    (rmail-set-attribute rmail-unseen-attr-index nil)
    (unless modiff
      (restore-buffer-modified-p modiff)))


So the modified flag is explicitly cleared after reading a new message.
Is there some reason I can't see for this behavior? Maybe we could add a
configuration option to let the user choose.


Let me know,
Andrea Monaco



^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2021-01-11 15:34 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-11 12:28 Unseen attribute doesn't get saved in rmail Andrea G. Monaco
2021-01-11 15:34 ` Eli Zaretskii
  -- strict thread matches above, loose matches on Subject: below --
2021-01-08 21:33 Andrea G. Monaco
2021-01-09  7:44 ` Eli Zaretskii
2021-01-02 20:05 Andrea G. Monaco
2021-01-02 20:20 ` Eli Zaretskii
2020-12-31 14:03 Andrea G. Monaco
2020-12-31 16:31 ` Eli Zaretskii

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).