Gnus development mailing list
 help / color / mirror / Atom feed
* send reply email from gnus and archive original
@ 2014-06-19 13:20 John Kitchin
  2014-06-19 23:36 ` Eric Abrahamsen
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: John Kitchin @ 2014-06-19 13:20 UTC (permalink / raw)
  To: ding

Hi everyone,

I am trying to switch from the web interface of gmail to gnus. I have
succeeded in getting gnus to read my mail!

("nnimap gmail:INBOX")

A feature of the web interface I really liked was the ability to reply
to an email, and upon sending it, archive the original email. Is there a
way to do that in gnus? Using a hook or something? Basically I want to
move the replied to email from the INBOX to the [Gmail]/All Mail folder
after I repply to it.

Thanks!

-- 
-----------------------------------
John Kitchin





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

* Re: send reply email from gnus and archive original
  2014-06-19 13:20 send reply email from gnus and archive original John Kitchin
@ 2014-06-19 23:36 ` Eric Abrahamsen
  2014-09-24 21:00 ` Ted Zlatanov
  2014-09-25  7:42 ` Steinar Bang
  2 siblings, 0 replies; 4+ messages in thread
From: Eric Abrahamsen @ 2014-06-19 23:36 UTC (permalink / raw)
  To: ding

John Kitchin <jkitchin@andrew.cmu.edu> writes:

> Hi everyone,
>
> I am trying to switch from the web interface of gmail to gnus. I have
> succeeded in getting gnus to read my mail!
>
> ("nnimap gmail:INBOX")
>
> A feature of the web interface I really liked was the ability to reply
> to an email, and upon sending it, archive the original email. Is there a
> way to do that in gnus? Using a hook or something? Basically I want to
> move the replied to email from the INBOX to the [Gmail]/All Mail folder
> after I repply to it.
>
> Thanks!

I guess I'd recommend using the message-sent-hook: that way you know the
message has successfully sent, but you're still in the message buffer.

In the message buffer, you can get the X-Draft-From header, which tells
you how to find the message you're replying to (there's also the
message-reply-headers variable, but that doesn't have the group
information). Then you can ask gnus to move the article. My guess is you
could call `nnimap-request-move-article' directly, but it would probably
be safer to visit the original in its summary buffer and then use
`gnus-summary-move-article'. The following is very, very lightly tested:

(defun archive-original-gmail (&optional to-group)
  (save-window-excursion
    (save-restriction
     (message-narrow-to-headers-or-head)
     (let ((draft-from (read (message-fetch-field "X-Draft-From")))
	   group article-number)
       (when draft-from
	 (setq group (car draft-from)
	       article-number (cadr draft-from))
	 (gnus-activate-group group)
	 (when (member (cadr (gnus-find-method-for-group group))
                        ;; only activate for some servers
		       '("Applicable" "Server" "Names"))
	   (gnus-group-read-group t nil group
				  (list article-number))
	   (gnus-summary-move-article nil "\[Gmail\]/All Mail")))))))

You'd put that in the message-sent-hook. I'd love to hear if anyone had
a better solution!

E




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

* Re: send reply email from gnus and archive original
  2014-06-19 13:20 send reply email from gnus and archive original John Kitchin
  2014-06-19 23:36 ` Eric Abrahamsen
@ 2014-09-24 21:00 ` Ted Zlatanov
  2014-09-25  7:42 ` Steinar Bang
  2 siblings, 0 replies; 4+ messages in thread
From: Ted Zlatanov @ 2014-09-24 21:00 UTC (permalink / raw)
  To: ding

On Thu, 19 Jun 2014 09:20:59 -0400 John Kitchin <jkitchin@andrew.cmu.edu> wrote: 

JK> Hi everyone,
JK> I am trying to switch from the web interface of gmail to gnus. I have
JK> succeeded in getting gnus to read my mail!

JK> ("nnimap gmail:INBOX")

JK> A feature of the web interface I really liked was the ability to reply
JK> to an email, and upon sending it, archive the original email. Is there a
JK> way to do that in gnus? Using a hook or something? Basically I want to
JK> move the replied to email from the INBOX to the [Gmail]/All Mail folder
JK> after I repply to it.

Can you define "archive" better?  I use GMail and don't really
understand the consequences of that action.

(Also, their handling of groups as labels is really frustrating.)

Ted




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

* Re: send reply email from gnus and archive original
  2014-06-19 13:20 send reply email from gnus and archive original John Kitchin
  2014-06-19 23:36 ` Eric Abrahamsen
  2014-09-24 21:00 ` Ted Zlatanov
@ 2014-09-25  7:42 ` Steinar Bang
  2 siblings, 0 replies; 4+ messages in thread
From: Steinar Bang @ 2014-09-25  7:42 UTC (permalink / raw)
  To: ding

>>>>> John Kitchin <jkitchin@andrew.cmu.edu>:

> Hi everyone,
> I am trying to switch from the web interface of gmail to gnus. I have
> succeeded in getting gnus to read my mail!

> ("nnimap gmail:INBOX")

I don't understand this configuration.  Could you provide some more
context?

I would have thought you would need something like this...?
 (setq gnus-secondary-select-methods '((nnimap "gmail" (nnimap-address "imap.gmail.com"))))

Alternatively, type press '^' (without the quotes) to get to the server
buffer and then do 'a' (again without the quotes) to add a server with
nnimap as the server method, and imap.gmail.com as the server.  You can
then do RET to explore the folders on the server, and type 'u' (without
the quotes) to subscribe the ones you want.

When you're finished subscribing, just type 'q' twice (yep, still
without the quotes), and you should be back in the Group buffer, with
the subscribed folders showing up as nnimap groups.




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

end of thread, other threads:[~2014-09-25  7:42 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-19 13:20 send reply email from gnus and archive original John Kitchin
2014-06-19 23:36 ` Eric Abrahamsen
2014-09-24 21:00 ` Ted Zlatanov
2014-09-25  7:42 ` Steinar Bang

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