Announcements and discussions for Gnus, the GNU Emacs Usenet newsreader
 help / color / mirror / Atom feed
* Making mail unread when moved
@ 2010-04-23 14:52 Sébastien Vauban
  2010-04-26  1:25 ` Katsumi Yamaoka
  0 siblings, 1 reply; 5+ messages in thread
From: Sébastien Vauban @ 2010-04-23 14:52 UTC (permalink / raw)
  To: info-gnus-english-mXXj517/zsQ

Hello,

Would there be some way to make a mail become unread when moving it to some
nnimap folder?

I currently try to move mails I have to follow, but I need to make sure I'll
see them whenever I'm opening the folder in question.

Currently:
- `M-u' to make it unread
- `B m' to move it to (for example) "nnimap:INBOX.FOLLOW-UP"

Well, maybe another alternative as well would be that, for that particular
folder, all read and unread mails are shown, whenever entering -- not forcing
me doing it with `C-u RET'.

What are you thinking?

Best regards,
  Seb

-- 
Sébastien Vauban

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

* Re: Making mail unread when moved
  2010-04-23 14:52 Making mail unread when moved Sébastien Vauban
@ 2010-04-26  1:25 ` Katsumi Yamaoka
  2010-04-26  1:34   ` Katsumi Yamaoka
                     ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Katsumi Yamaoka @ 2010-04-26  1:25 UTC (permalink / raw)
  To: info-gnus-english

>>>>> Sébastien Vauban wrote:
> Would there be some way to make a mail become unread when moving it to some
> nnimap folder?

Try this advice, that makes articles to be moved to the group
nnimap:INBOX.FOLLOW-UP unread:

--8<---------------cut here---------------start------------->8---
(defadvice gnus-summary-move-article (before make-articles-unread-when-
moving
					     (&optional n to-newsgroup
							select-method action)
					     activate)
  "Make articles to be moved to certain groups unread."
  (when (memq action '(nil move))
    (let ((articles (gnus-summary-work-articles n))
	  case-fold-search)
      (unless to-newsgroup
	(setq to-newsgroup (gnus-read-move-group-name
			    "Move" gnus-current-move-group
			    articles
			    (if (gnus-check-backend-function
				 'request-move-article gnus-newsgroup-name)
				(funcall gnus-move-group-prefix-function
					 gnus-newsgroup-name)
			      "")))
	(when (string-match "\\`nnimap:INBOX\\.FOLLOW-UP\\'" to-newsgroup)
	  (dolist (article articles)
	    (gnus-summary-mark-article article gnus-unread-mark)))))))
--8<---------------cut here---------------end--------------->8---

Adjust the regexp "\\`nnimap:INBOX\\.FOLLOW-UP\\'" as you like.
If it is "", articles to be moved to any group will be made all
unread.

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

* Re: Making mail unread when moved
  2010-04-26  1:25 ` Katsumi Yamaoka
@ 2010-04-26  1:34   ` Katsumi Yamaoka
  2010-04-28 10:31   ` Making mail ticked " Sébastien Vauban
  2010-05-05  7:25   ` Making mail unread " Sébastien Vauban
  2 siblings, 0 replies; 5+ messages in thread
From: Katsumi Yamaoka @ 2010-04-26  1:34 UTC (permalink / raw)
  To: info-gnus-english

>>>>> Katsumi Yamaoka wrote:
> Try this advice, that makes articles to be moved to the group
> nnimap:INBOX.FOLLOW-UP unread:

> (defadvice gnus-summary-move-article (before make-articles-unread-when-
> moving

Google did it, but don't break the symbol in the first line:

make-articles-unread-when-moving

(I'm unable to post articles to this group using any news server
except for Google today. :<)

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

* Re: Making mail ticked when moved
  2010-04-26  1:25 ` Katsumi Yamaoka
  2010-04-26  1:34   ` Katsumi Yamaoka
@ 2010-04-28 10:31   ` Sébastien Vauban
  2010-05-05  7:25   ` Making mail unread " Sébastien Vauban
  2 siblings, 0 replies; 5+ messages in thread
From: Sébastien Vauban @ 2010-04-28 10:31 UTC (permalink / raw)
  To: info-gnus-english-mXXj517/zsQ

Hi Katsumi,

Katsumi Yamaoka wrote:
> Sébastien Vauban wrote:
>> Would there be some way to make a mail become unread when moving it to some
>> nnimap folder?
>
> Try this advice, that makes articles to be moved to the group
> nnimap:INBOX.FOLLOW-UP unread:
>
> [...]
>
> Adjust the regexp "\\`nnimap:INBOX\\.FOLLOW-UP\\'" as you like. If it is "",
> articles to be moved to any group will be made all unread.

My high ELisp abilities ;-) allowed me to slightly change your code:

--8<---------------cut here---------------start------------->8---
(defadvice gnus-summary-move-article (before make-articles-unread-when-moving
                                             (&optional n to-newsgroup
                                                        select-method action)
                                             activate)
  "Make articles ticked when moved to certain groups."
  (when (memq action '(nil move))
    (let ((articles (gnus-summary-work-articles n))
          case-fold-search)
      (unless to-newsgroup
        (setq to-newsgroup (gnus-read-move-group-name
                            "Move" gnus-current-move-group
                            articles
                            (if (gnus-check-backend-function
                                 'request-move-article gnus-newsgroup-name)
                                (funcall gnus-move-group-prefix-function
                                         gnus-newsgroup-name)
                              "")))
        (when (string-match "INBOX\\.@" to-newsgroup) ; groups beginning with
                                                      ; the `@' symbol
          (dolist (article articles)
            (gnus-summary-mark-article article gnus-ticked-mark)))))))
--8<---------------cut here---------------end--------------->8---

In clear, here are my changes:

1. apply the below rule for all groups beginning with the `@' symbol
2. make articles ticked (instead of unread)

The latter makes more sense, as these are for mails to be followed up. I've
read them, I simply want to tag them in some way.

Thank you very, very, very much for your code. It is simply great like this...

Though, now that I've changed my mind from "unread" to "ticked", I'd be happy
to see the groups with ticked articles to be highlighted more than it
currently is (`*' mark in front of the group's name).

I tried to find faces for really highlighting the groups containing ticked
articles, but found nothing. I only see faces for groups containing unread
articles.

Is it possible to work around this somehow?

Best regards,
  Seb

-- 
Sébastien Vauban

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

* Re: Making mail unread when moved
  2010-04-26  1:25 ` Katsumi Yamaoka
  2010-04-26  1:34   ` Katsumi Yamaoka
  2010-04-28 10:31   ` Making mail ticked " Sébastien Vauban
@ 2010-05-05  7:25   ` Sébastien Vauban
  2 siblings, 0 replies; 5+ messages in thread
From: Sébastien Vauban @ 2010-05-05  7:25 UTC (permalink / raw)
  To: info-gnus-english-mXXj517/zsQ

Hi Katsumi,

Katsumi Yamaoka wrote:
>>>>>> Sébastien Vauban wrote:
>> Would there be some way to make a mail become unread when moving it to some
>> nnimap folder?
>
> Try this advice, that makes articles to be moved to the group
> nnimap:INBOX.FOLLOW-UP unread:
>
> (defadvice gnus-summary-move-article (before make-articles-unread-when-
> moving
> 					     (&optional n to-newsgroup
> 							select-method action)
> 					     activate)
>   "Make articles to be moved to certain groups unread."
>   (when (memq action '(nil move))
>     (let ((articles (gnus-summary-work-articles n))
> 	  case-fold-search)
>       (unless to-newsgroup
> 	(setq to-newsgroup (gnus-read-move-group-name
> 			    "Move" gnus-current-move-group
> 			    articles
> 			    (if (gnus-check-backend-function
> 				 'request-move-article gnus-newsgroup-name)
> 				(funcall gnus-move-group-prefix-function
> 					 gnus-newsgroup-name)
> 			      "")))
> 	(when (string-match "\\`nnimap:INBOX\\.FOLLOW-UP\\'" to-newsgroup)
> 	  (dolist (article articles)
> 	    (gnus-summary-mark-article article gnus-unread-mark)))))))
>
> Adjust the regexp "\\`nnimap:INBOX\\.FOLLOW-UP\\'" as you like.
> If it is "", articles to be moved to any group will be made all
> unread.

Just a tiny problem. When selecting multiple articles to be moved
simultaneously, they get all ticked, but only the one where the point is gets
moved.

Any idea?

Best regards,
  Seb

-- 
Sébastien Vauban

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

end of thread, other threads:[~2010-05-05  7:25 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-04-23 14:52 Making mail unread when moved Sébastien Vauban
2010-04-26  1:25 ` Katsumi Yamaoka
2010-04-26  1:34   ` Katsumi Yamaoka
2010-04-28 10:31   ` Making mail ticked " Sébastien Vauban
2010-05-05  7:25   ` Making mail unread " Sébastien Vauban

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