Gnus development mailing list
 help / color / mirror / Atom feed
* Can I mark a mail as read and expired at the same time?
@ 2013-07-02  1:44 Trevor Murphy
  2013-07-02  7:58 ` Eric S Fraga
  0 siblings, 1 reply; 6+ messages in thread
From: Trevor Murphy @ 2013-07-02  1:44 UTC (permalink / raw)
  To: ding

I'm new to Gnus and utterly stumped here.  I think the answer is "No",
because all the "read" marks are mutually exclusive.

This may just be a frustration born of heavy Gmail use.  I'd like to do
the equivalent of the Gmail web interface's "archive the current
message", a/k/a having just marked the mail as read, now remove it from
the inbox.

I can't use total-expire because I don't want to automatically expire
*all* read messages.  Just some of the crappy ones.

I tried to find a way to limit the marks that total-expire acts on, but
I get the sense that's impossible.

I'm thinking I might be able to write a function to go in the
gnus-summary-article-expire-hook, but before diving down that rabbit
hole I figured I'd search the list, stack overflow, Google, etc.  

Weirdly, I couldn't find any mention of this problem in any of those
sources.  Am I missing something obvious?  Or does nobody else have the
same workflow?

Incidentally, I've asked the same question on superuser.  Not sure if
this community overlaps with those guys, given the low number of
Gnus-related questions I saw.

-- 
Trevor Murphy
GnuPG Key: 0xCB06EAAF




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

* Re: Can I mark a mail as read and expired at the same time?
  2013-07-02  1:44 Can I mark a mail as read and expired at the same time? Trevor Murphy
@ 2013-07-02  7:58 ` Eric S Fraga
  2013-07-02 12:52   ` Trevor Murphy
  0 siblings, 1 reply; 6+ messages in thread
From: Eric S Fraga @ 2013-07-02  7:58 UTC (permalink / raw)
  To: ding

Trevor Murphy <trevor.m.murphy@gmail.com> writes:

> I'm new to Gnus and utterly stumped here.  I think the answer is "No",
> because all the "read" marks are mutually exclusive.
>
> This may just be a frustration born of heavy Gmail use.  I'd like to do
> the equivalent of the Gmail web interface's "archive the current
> message", a/k/a having just marked the mail as read, now remove it from
> the inbox.
>
> I can't use total-expire because I don't want to automatically expire
> *all* read messages.  Just some of the crappy ones.

In most groups, I use total expire.  However, in some, where I want more
control, I do not.  Instead, I use 'E' (gnus-summary-mark-as-expirable)
in summary mode to mark those messages I want expired.  To me, this is
equivalent to Gmail's archive current message command.

-- 
: Eric S Fraga, GnuPG: 0xFFFCF67D
: in Emacs 24.3.50.1 + Ma Gnus v0.8 + evil 1.0-dev
: BBDB version 3.02 ($Date: 2013/05/15 13:17:58 $)




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

* Re: Can I mark a mail as read and expired at the same time?
  2013-07-02  7:58 ` Eric S Fraga
@ 2013-07-02 12:52   ` Trevor Murphy
  2013-07-03  9:14     ` Eric S Fraga
  0 siblings, 1 reply; 6+ messages in thread
From: Trevor Murphy @ 2013-07-02 12:52 UTC (permalink / raw)
  To: ding

Eric S Fraga <e.fraga@ucl.ac.uk> writes:

> In most groups, I use total expire.  However, in some, where I want more
> control, I do not.  Instead, I use 'E' (gnus-summary-mark-as-expirable)
> in summary mode to mark those messages I want expired.  To me, this is
> equivalent to Gmail's archive current message command.

Thanks for the suggestion, Eric.  I played around with the 'E' mark, as
well as auto-expire, but found that it didn't quite do what I expected.
Perhaps I'm missing something?

When I mark the mail as expirable with 'E', it does indeed archive in
the webmail interface.  A/k/a delete from my inbox in Gnus.

However the mail still shows up on the web as unread.  This is
noticeable in, trivially, the All Mail item.  It's also noticeable, less
trivially, if I've used a Gmail filter to apply a label to the mail.  

In that second case, the Gmail label syncs to an IMAP folder, and Gnus
still sees the mail as unread in the corresponding folder.  Which is
annoying and motivated my original question.

Does that make sense?  total-expire, because it lets me use an 'r' or
'R' mark on the mail, seems to both mark as read and archive the message
when I check via webmail.  It just also does too much for my use case.

-- 
Trevor Murphy
GnuPG Key: 0xCB06EAAF




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

* Re: Can I mark a mail as read and expired at the same time?
  2013-07-02 12:52   ` Trevor Murphy
@ 2013-07-03  9:14     ` Eric S Fraga
  2013-07-03 22:39       ` Trevor Murphy
  0 siblings, 1 reply; 6+ messages in thread
From: Eric S Fraga @ 2013-07-03  9:14 UTC (permalink / raw)
  To: ding

Trevor Murphy <trevor.m.murphy@gmail.com> writes:

[...]

> When I mark the mail as expirable with 'E', it does indeed archive in
> the webmail interface.  A/k/a delete from my inbox in Gnus.
>
> However the mail still shows up on the web as unread.  This is
> noticeable in, trivially, the All Mail item.  It's also noticeable, less
> trivially, if I've used a Gmail filter to apply a label to the mail.  
>
> In that second case, the Gmail label syncs to an IMAP folder, and Gnus
> still sees the mail as unread in the corresponding folder.  Which is
> annoying and motivated my original question.
>
> Does that make sense?  total-expire, because it lets me use an 'r' or
> 'R' mark on the mail, seems to both mark as read and archive the message
> when I check via webmail.  It just also does too much for my use case.

Yes, it does make sense.  Maybe the solution is to create your own
command that first marks the article as read and then marks it as
expirable?  Something along the lines of

#+begin_src emacs-lisp
  (defun esf/mark-read-and-expirable () 
    (interactive)
    (gnus-summary-mark-as-read)
    (gnus-summary-mark-as-expirable 1))
#+end_src
  
You can then assign this to a key in one of the gnus-summary key
maps.  I've tested this briefly but not with gmail so I don't know if
this does what you want.

-- 
: Eric S Fraga, GnuPG: 0xFFFCF67D
: in Emacs 24.3.50.1 + Ma Gnus v0.8 + evil 1.0.5
: BBDB version 3.02 ($Date: 2013/05/15 13:17:58 $)




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

* Re: Can I mark a mail as read and expired at the same time?
  2013-07-03  9:14     ` Eric S Fraga
@ 2013-07-03 22:39       ` Trevor Murphy
  2013-07-04 12:51         ` Eric S Fraga
  0 siblings, 1 reply; 6+ messages in thread
From: Trevor Murphy @ 2013-07-03 22:39 UTC (permalink / raw)
  To: ding

Eric S Fraga <e.fraga@ucl.ac.uk> writes:

> Yes, it does make sense.  Maybe the solution is to create your own
> command that first marks the article as read and then marks it as
> expirable?  Something along the lines of
>
> #+begin_src emacs-lisp
>   (defun esf/mark-read-and-expirable () 
>     (interactive)
>     (gnus-summary-mark-as-read)
>     (gnus-summary-mark-as-expirable 1))
> #+end_src

Thanks for the suggestion!  Unfortunately in my testing it still doesn't
do what I want.

After doing some digging, I've found the following:

1. The command `gnus-summary-expire-articles' will call
   `gnus-summary-update-info' before expiring articles *if* total-expire
   is on.  That sends the "read" mark from Gnus to Gmail before expiring
   the articles, which is why I was getting the desired behavior from
   total-expire.

2. Sounds like an interesting path would be a function like yours that
   marks as read, *then calls update-info*, then marks as expirable.
   But after this afternoon of reading source code I'm pooped and not up
   for making sure that my call to update-info doesn't accidentally mess
   with other articles.

3. Instead I "solved" the problem by changing my expectations.  I just
   set expiry-wait to 0 and use auto-expiry.  Any read articles I want
   to disappear will go away tomorrow.  That's good enough for me.

Thanks again for your interest and pointers.

-- 
Trevor Murphy
GnuPG Key: 0xCB06EAAF




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

* Re: Can I mark a mail as read and expired at the same time?
  2013-07-03 22:39       ` Trevor Murphy
@ 2013-07-04 12:51         ` Eric S Fraga
  0 siblings, 0 replies; 6+ messages in thread
From: Eric S Fraga @ 2013-07-04 12:51 UTC (permalink / raw)
  To: ding

Trevor Murphy <trevor.m.murphy@gmail.com> writes:


[...]

> After doing some digging, I've found the following:
>
> 1. The command `gnus-summary-expire-articles' will call
>    `gnus-summary-update-info' before expiring articles *if* total-expire
>    is on.  That sends the "read" mark from Gnus to Gmail before expiring

Interesting.  I would have thought that gnus-summary-update-info would
be useful to invoke whether or not total expire is set.  But, I have not
looked at the code in question at all so maybe there are some
ramifications from that.

Anyway, I'm glad you solved the problem!

-- 
: Eric S Fraga, GnuPG: 0xFFFCF67D
: in Emacs 24.3.50.1 + Ma Gnus v0.8 + evil 1.0.5
: BBDB version 3.02 ($Date: 2013/05/15 13:17:58 $)




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

end of thread, other threads:[~2013-07-04 12:51 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-02  1:44 Can I mark a mail as read and expired at the same time? Trevor Murphy
2013-07-02  7:58 ` Eric S Fraga
2013-07-02 12:52   ` Trevor Murphy
2013-07-03  9:14     ` Eric S Fraga
2013-07-03 22:39       ` Trevor Murphy
2013-07-04 12:51         ` Eric S Fraga

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 NNTP newsgroup(s).