emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Capturing outgoing gnus e-mail
@ 2014-06-14  8:32 Ivan Kanis
  2014-06-14  9:05 ` Bastien
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Ivan Kanis @ 2014-06-14  8:32 UTC (permalink / raw)
  To: Gnus General, org mode

Hi,

I would like to capture outgoing e-mail in my org file.

I use the gcc mechanism in gnus with a nnml backend.

I think I have read on the org mailing list that someone has implemented
that feature. I did a search but could not find the article.

I tried implementing it myself. I had a look at the function
gnus-inews-do-gcc. It has the group and the article number. However org
link expect the Message-ID header. How do I get it?

Thanks,

Ivan
-- 
Software uses US measurements, but the OS is in metric...
    -- BOFH excuse #24

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

* Re: Capturing outgoing gnus e-mail
  2014-06-14  8:32 Capturing outgoing gnus e-mail Ivan Kanis
@ 2014-06-14  9:05 ` Bastien
  2014-12-15 12:08   ` Uwe Brauer
  2014-06-14 10:06 ` Eric Abrahamsen
  2014-09-24 21:04 ` Ted Zlatanov
  2 siblings, 1 reply; 9+ messages in thread
From: Bastien @ 2014-06-14  9:05 UTC (permalink / raw)
  To: Ivan Kanis; +Cc: org mode, Gnus General

Hi Ivan,

this is what I use :

========================================================================
;; Hack to store Org links upon sending Gnus messages

(defun bzg-message-send-and-org-gnus-store-link (&optional arg)
  "Send message with `message-send-and-exit' and store org link to message copy.
If multiple groups appear in the Gcc header, the link refers to
the copy in the last group."
  (interactive "P")
    (save-excursion
      (save-restriction
        (message-narrow-to-headers)
        (let ((gcc (car (last
                         (message-unquote-tokens
                          (message-tokenize-header
                           (mail-fetch-field "gcc" nil t) " ,")))))
              (buf (current-buffer))
              (message-kill-buffer-on-exit nil)
              id to from subject desc link newsgroup xarchive)
        (message-send-and-exit arg)
        (or
         ;; gcc group found ...
         (and gcc
              (save-current-buffer
                (progn (set-buffer buf)
                       (setq id (org-remove-angle-brackets
                                 (mail-fetch-field "Message-ID")))
                       (setq to (mail-fetch-field "To"))
                       (setq from (mail-fetch-field "From"))
                       (setq subject (mail-fetch-field "Subject"))))
              (org-store-link-props :type "gnus" :from from :subject subject
                                    :message-id id :group gcc :to to)
              (setq desc (org-email-link-description))
              (setq link (org-gnus-article-link
                          gcc newsgroup id xarchive))
              (setq org-stored-links
                    (cons (list link desc) org-stored-links)))
         ;; no gcc group found ...
         (message "Can not create Org link: No Gcc header found."))))))

(define-key message-mode-map [(control c) (control meta c)]
  'bzg-message-send-and-org-gnus-store-link)
========================================================================

Then, in a message, I use C-c C-M-c instead of C-c C-c to send the
message and create a link to it that I can reinsert later one.  This
is not really capturing, but it's good enough for my needs.

HTH,

-- 
 Bastien

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

* Re: Capturing outgoing gnus e-mail
  2014-06-14  8:32 Capturing outgoing gnus e-mail Ivan Kanis
  2014-06-14  9:05 ` Bastien
@ 2014-06-14 10:06 ` Eric Abrahamsen
  2014-06-16  2:08   ` Esben Stien
  2014-09-24 21:04 ` Ted Zlatanov
  2 siblings, 1 reply; 9+ messages in thread
From: Eric Abrahamsen @ 2014-06-14 10:06 UTC (permalink / raw)
  To: emacs-orgmode; +Cc: ding

Ivan Kanis <ivan@kanis.fr> writes:

> Hi,
>
> I would like to capture outgoing e-mail in my org file.
>
> I use the gcc mechanism in gnus with a nnml backend.
>
> I think I have read on the org mailing list that someone has implemented
> that feature. I did a search but could not find the article.
>
> I tried implementing it myself. I had a look at the function
> gnus-inews-do-gcc. It has the group and the article number. However org
> link expect the Message-ID header. How do I get it?
>
> Thanks,
>
> Ivan

Hi Ivan,

That's something that Gnorb[1] can do. Make a capture template that
you want to use for outgoing mail TODOs, and identify it:

(setq gnorb-gnus-new-todo-capture-key "O")

Then, while you're composing the email, call
`gnorb-gnus-outgoing-do-todo' in the message buffer, which I have bound
to "C-c t".

You can also call it *after* sending the message, if you forgot, and it
will initiate the same process from the last sent message.

It works best when you're using Gcc, as that means Org is able to make a
real link to the sent message. Gnorb will try to fake it, if you're not.

If you set (setq gnorb-gnus-hint-relevant-article t), Gnorb will even
notify you when you get a reply to your sent message.

It's early days for Gnorb, but this part of it works well for me. I'd
love a little more road-testing, if you're interested!

I'm going to stick it in ELPA in a month or so, but for now:

[1]: https://github.com/girzel/gnorb

Hope it helps!
E

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

* Re: Capturing outgoing gnus e-mail
  2014-06-14 10:06 ` Eric Abrahamsen
@ 2014-06-16  2:08   ` Esben Stien
  2014-06-16 13:29     ` Eric Abrahamsen
  0 siblings, 1 reply; 9+ messages in thread
From: Esben Stien @ 2014-06-16  2:08 UTC (permalink / raw)
  To: emacs-orgmode

Eric Abrahamsen <eric@ericabrahamsen.net> writes:

> [1]: https://github.com/girzel/gnorb

"Some way to create a TODO for an outgoing mail, saying 'this mail needs
a response, check in N days to see if we’ve got one.'"

That's really cool and I've been looking for ages for something like that;)

-- 
Esben Stien is b0ef@e     s      a             
         http://www. s     t    n m
          irc://irc.  b  -  i  .   e/%23contact
           sip:b0ef@   e     e 
           jid:b0ef@    n     n

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

* Re: Capturing outgoing gnus e-mail
  2014-06-16  2:08   ` Esben Stien
@ 2014-06-16 13:29     ` Eric Abrahamsen
  0 siblings, 0 replies; 9+ messages in thread
From: Eric Abrahamsen @ 2014-06-16 13:29 UTC (permalink / raw)
  To: emacs-orgmode

Esben Stien <b0ef@esben-stien.name> writes:

> Eric Abrahamsen <eric@ericabrahamsen.net> writes:
>
>> [1]: https://github.com/girzel/gnorb
>
> "Some way to create a TODO for an outgoing mail, saying 'this mail needs
> a response, check in N days to see if we’ve got one.'"
>
> That's really cool and I've been looking for ages for something like that;)

Give it a shot! gnorb-gnus-outgoing-do-todo, and then schedule the
resulting capture heading.

Hope it works for you,
E

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

* Re: Capturing outgoing gnus e-mail
  2014-06-14  8:32 Capturing outgoing gnus e-mail Ivan Kanis
  2014-06-14  9:05 ` Bastien
  2014-06-14 10:06 ` Eric Abrahamsen
@ 2014-09-24 21:04 ` Ted Zlatanov
  2014-12-14 22:58   ` Uwe Brauer
  2 siblings, 1 reply; 9+ messages in thread
From: Ted Zlatanov @ 2014-09-24 21:04 UTC (permalink / raw)
  To: ding; +Cc: emacs-orgmode

On Sat, 14 Jun 2014 10:32:49 +0200 Ivan Kanis <ivan@kanis.fr> wrote: 

IK> I would like to capture outgoing e-mail in my org file.

IK> I use the gcc mechanism in gnus with a nnml backend.

IK> I think I have read on the org mailing list that someone has implemented
IK> that feature. I did a search but could not find the article.

IK> I tried implementing it myself. I had a look at the function
IK> gnus-inews-do-gcc. It has the group and the article number. However org
IK> link expect the Message-ID header. How do I get it?

Well, I use the following to maintain a diary file. It's probably
equally easy to use a Org file:

(defun message-to-diary ()
  (make-diary-entry (concat
                     (format-time-string "%B %d, %Y %H:%M" (gnus-date-get-time (message-fetch-field "date")))
                     (if (message-fetch-field "newsgroups")
                         (concat " Sent news To: " (message-fetch-field "newsgroups"))
                       (concat " Sent mail To: " (message-fetch-field "to")))
                     " Subject: \"" (message-fetch-field "subject") "\""
                     " Message-ID: " (message-fetch-field "message-id")))
  (save-buffer "diary"))

(add-hook 'message-sent-hook 'message-to-diary)

HTH
Ted

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

* Re: Capturing outgoing gnus e-mail
  2014-09-24 21:04 ` Ted Zlatanov
@ 2014-12-14 22:58   ` Uwe Brauer
  0 siblings, 0 replies; 9+ messages in thread
From: Uwe Brauer @ 2014-12-14 22:58 UTC (permalink / raw)
  To: ding; +Cc: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 995 bytes --]

>> "Ted" == Ted Zlatanov <tzz@lifelogs.com> writes:

Hello 

I just saw your code.

   > Well, I use the following to maintain a diary file. It's probably
   > equally easy to use a Org file:

   > (defun message-to-diary ()
   >   (make-diary-entry (concat
   >                      (format-time-string "%B %d, %Y %H:%M" (gnus-date-get-time (message-fetch-field "date")))
   >                      (if (message-fetch-field "newsgroups")
   >                          (concat " Sent news To: " (message-fetch-field "newsgroups"))
   >                        (concat " Sent mail To: " (message-fetch-field "to")))
   >                      " Subject: \"" (message-fetch-field "subject") "\""
   >                      " Message-ID: " (message-fetch-field "message-id")))
   >   (save-buffer "diary"))

   > (add-hook 'message-sent-hook 'message-to-diary)

I cannot see the relevant group entry. So how are you supposed to jump
from the diary to the message.

Uwe Brauer 

[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5556 bytes --]

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

* Re: Capturing outgoing gnus e-mail
  2014-06-14  9:05 ` Bastien
@ 2014-12-15 12:08   ` Uwe Brauer
  0 siblings, 0 replies; 9+ messages in thread
From: Uwe Brauer @ 2014-12-15 12:08 UTC (permalink / raw)
  To: emacs-orgmode; +Cc: ding

[-- Attachment #1: Type: text/plain, Size: 1036 bytes --]

>> "Bastien" == Bastien  <bzg@gnu.org> writes:

Hi Bastien

I just saw your code
   > Hi Ivan,
   > this is what I use :

   > ========================================================================
   > ;; Hack to store Org links upon sending Gnus messages

   > (defun bzg-message-send-and-org-gnus-store-link (&optional arg)

   > (define-key message-mode-map [(control c) (control meta c)]
   >   'bzg-message-send-and-org-gnus-store-link)
   > ========================================================================

   > Then, in a message, I use C-c C-M-c instead of C-c C-c to send the
   > message and create a link to it that I can reinsert later one.  This
   > is not really capturing, but it's good enough for my needs.

I tried it out and it is nice, the only thing which is missing is to
insert automatically the link into an org file or the diary if you want.
When I call org-insert-link an interactive query started which is nice
but in this case time consuming

regards

Uwe Brauer 



[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5556 bytes --]

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

* Re: Capturing outgoing gnus e-mail
@ 2014-06-14 14:43 Marvin Doyley
  0 siblings, 0 replies; 9+ messages in thread
From: Marvin Doyley @ 2014-06-14 14:43 UTC (permalink / raw)
  Cc: eric, emacs-orgmode


I love it 
Thanks
Cheers,
M
Sent from my iPhone
** May contain typos**

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

end of thread, other threads:[~2014-12-15 12:09 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-14  8:32 Capturing outgoing gnus e-mail Ivan Kanis
2014-06-14  9:05 ` Bastien
2014-12-15 12:08   ` Uwe Brauer
2014-06-14 10:06 ` Eric Abrahamsen
2014-06-16  2:08   ` Esben Stien
2014-06-16 13:29     ` Eric Abrahamsen
2014-09-24 21:04 ` Ted Zlatanov
2014-12-14 22:58   ` Uwe Brauer
2014-06-14 14:43 Marvin Doyley

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.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).