unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* converting notmuch email to 'TODO' entry in org-mode
@ 2013-05-24  7:22 David Belohrad
  2013-05-24 11:38 ` David Bremner
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: David Belohrad @ 2013-05-24  7:22 UTC (permalink / raw)
  To: notmuch

Dear All,

i'm constantly facing a task: someone sends me an email to do
something, and I'm manually copying contents of email into org-mode
task using org-mode templates. The template itself only enters the
'default' todo line and when it was entered, but I'd like to copy the
contents of the email I'm currently in into that buffer.

This would allow me to get e.g. exchange meeting request and seamlessly
copy it into my agenda.

is there any way how to get 'current email' (not current thread)
contents into kill ring so I could write a small script to paste it into
org-mode template?

thanks

.d.

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

* Re: converting notmuch email to 'TODO' entry in org-mode
  2013-05-24  7:22 converting notmuch email to 'TODO' entry in org-mode David Belohrad
@ 2013-05-24 11:38 ` David Bremner
  2013-05-24 11:58   ` Tomi Ollila
  2013-05-24 12:07 ` Rainer M. Krug
  2013-05-24 17:29 ` Nicholas Peihl
  2 siblings, 1 reply; 8+ messages in thread
From: David Bremner @ 2013-05-24 11:38 UTC (permalink / raw)
  To: David Belohrad, notmuch

David Belohrad <david@belohrad.ch> writes:
>
> is there any way how to get 'current email' (not current thread)
> contents into kill ring so I could write a small script to paste it into
> org-mode template?

Here is what I came up with by canibalizing existing functions. 
Probably there is a more elegant way to do this.

(defun notmuch-show-stash-body ()
  (interactive)
  (let ((all (buffer-substring (notmuch-show-message-top)
		     (notmuch-show-message-bottom))))
    (with-temp-buffer
      (insert all)
      ;; Remove the original header.
      (goto-char (point-min))
      (re-search-forward "^$" (point-max) nil)
      (delete-region (point-min) (point))
      (notmuch-common-do-stash
       (buffer-string)))))

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

* Re: converting notmuch email to 'TODO' entry in org-mode
  2013-05-24 11:38 ` David Bremner
@ 2013-05-24 11:58   ` Tomi Ollila
  0 siblings, 0 replies; 8+ messages in thread
From: Tomi Ollila @ 2013-05-24 11:58 UTC (permalink / raw)
  To: David Bremner, David Belohrad, notmuch

On Fri, May 24 2013, David Bremner <david@tethera.net> wrote:

> David Belohrad <david@belohrad.ch> writes:
>>
>> is there any way how to get 'current email' (not current thread)
>> contents into kill ring so I could write a small script to paste it into
>> org-mode template?
>
> Here is what I came up with by canibalizing existing functions. 
> Probably there is a more elegant way to do this.
>
> (defun notmuch-show-stash-body ()
>   (interactive)
>   (let ((all (buffer-substring (notmuch-show-message-top)
> 		     (notmuch-show-message-bottom))))

(copy-region-as-kill (notmuch-show-message-top) (notmuch-show-message-bottom)) ?

Sorry didn't do any experiments whether this approach works (and thought
whether any save-excursions. etc are needed (or not!))

Anyway, this was easy to come by after David's example withouth much
thinking :D

Tomi



>     (with-temp-buffer
>       (insert all)
>       ;; Remove the original header.
>       (goto-char (point-min))
>       (re-search-forward "^$" (point-max) nil)
>       (delete-region (point-min) (point))
>       (notmuch-common-do-stash
>        (buffer-string)))))

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

* Re: converting notmuch email to 'TODO' entry in org-mode
  2013-05-24  7:22 converting notmuch email to 'TODO' entry in org-mode David Belohrad
  2013-05-24 11:38 ` David Bremner
@ 2013-05-24 12:07 ` Rainer M. Krug
  2013-05-24 16:37   ` Peter Feigl
  2013-05-24 21:03   ` Robert Horn
  2013-05-24 17:29 ` Nicholas Peihl
  2 siblings, 2 replies; 8+ messages in thread
From: Rainer M. Krug @ 2013-05-24 12:07 UTC (permalink / raw)
  To: notmuch

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


David Belohrad <david@belohrad.ch> writes:

> Dear All,
>
> i'm constantly facing a task: someone sends me an email to do
> something, and I'm manually copying contents of email into org-mode
> task using org-mode templates. The template itself only enters the
> 'default' todo line and when it was entered, but I'd like to copy the
> contents of the email I'm currently in into that buffer.
>
> This would allow me to get e.g. exchange meeting request and seamlessly
> copy it into my agenda.
>
> is there any way how to get 'current email' (not current thread)
> contents into kill ring so I could write a small script to paste it into
> org-mode template?

I would probably ask at the org list, as this would be very useful not
only for notmuch, but also for gnus and other mail clients. I.e. a
function which extracts from the current buffer the headers, puts them
into org properties and puts the (selected) text in the body text
underneath would be very useful.

Rainer


>
> thanks
>
> .d.


-- 
Rainer M. Krug

[-- Attachment #2: Type: application/pgp-signature, Size: 489 bytes --]

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

* Re: converting notmuch email to 'TODO' entry in org-mode
  2013-05-24 12:07 ` Rainer M. Krug
@ 2013-05-24 16:37   ` Peter Feigl
  2013-05-24 21:03   ` Robert Horn
  1 sibling, 0 replies; 8+ messages in thread
From: Peter Feigl @ 2013-05-24 16:37 UTC (permalink / raw)
  To: notmuch

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

This is rather bad but working code I use to import meeting requests
into org. I've been wanting to improve it and put it on github, but
haven't gotten around to doing that yet :-/
Just (require '..) both of them, then you should have an additional
button for vCalendar attachments, allowing you to import it.
Replying, Accepting and Rejecting are WIP, parts are there, but they
don't work reliably with Microsoft Outlook yet (which doesn't really
honour the standards at all :-/)

Good luck with it :)

Peter

[-- Attachment #2: notmuch-ical.el --]
[-- Type: application/emacs-lisp, Size: 6939 bytes --]

[-- Attachment #3: org-ical.el --]
[-- Type: application/emacs-lisp, Size: 9349 bytes --]

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

* Re: converting notmuch email to 'TODO' entry in org-mode
  2013-05-24  7:22 converting notmuch email to 'TODO' entry in org-mode David Belohrad
  2013-05-24 11:38 ` David Bremner
  2013-05-24 12:07 ` Rainer M. Krug
@ 2013-05-24 17:29 ` Nicholas Peihl
  2 siblings, 0 replies; 8+ messages in thread
From: Nicholas Peihl @ 2013-05-24 17:29 UTC (permalink / raw)
  To: notmuch


[-- Attachment #1.1: Type: text/plain, Size: 1147 bytes --]

Hi David,

When you say org-mode template are you referring to Capture templates
for creating TODO items? Does having the %i variable in the Capture
template copy the email text you are looking for?

http://orgmode.org/manual/Template-expansion.html#Template-expansion

Nick Peihl


On 5/24/2013 12:22 AM, David Belohrad wrote:
> Dear All,
>
> i'm constantly facing a task: someone sends me an email to do
> something, and I'm manually copying contents of email into org-mode
> task using org-mode templates. The template itself only enters the
> 'default' todo line and when it was entered, but I'd like to copy the
> contents of the email I'm currently in into that buffer.
>
> This would allow me to get e.g. exchange meeting request and seamlessly
> copy it into my agenda.
>
> is there any way how to get 'current email' (not current thread)
> contents into kill ring so I could write a small script to paste it into
> org-mode template?
>
> thanks
>
> .d.
> _______________________________________________
> notmuch mailing list
> notmuch@notmuchmail.org
> http://notmuchmail.org/mailman/listinfo/notmuch


[-- Attachment #1.2: Type: text/html, Size: 2358 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 553 bytes --]

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

* Re: converting notmuch email to 'TODO' entry in org-mode
  2013-05-24 12:07 ` Rainer M. Krug
  2013-05-24 16:37   ` Peter Feigl
@ 2013-05-24 21:03   ` Robert Horn
  2013-05-25  1:25     ` David Bremner
  1 sibling, 1 reply; 8+ messages in thread
From: Robert Horn @ 2013-05-24 21:03 UTC (permalink / raw)
  To: Rainer M. Krug; +Cc: notmuch


Rainer M. Krug writes:

> David Belohrad <david@belohrad.ch> writes:
>
>> is there any way how to get 'current email' (not current thread)
>> contents into kill ring so I could write a small script to paste it into
>> org-mode template?
>

It's not the same thing, but org-capture with the mu4e buffers captures
an active link to the email as the current context.  I find this to be
sufficient for many tasks. It does mean I have to follow that link to
look at the message itself.

R Horn

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

* Re: converting notmuch email to 'TODO' entry in org-mode
  2013-05-24 21:03   ` Robert Horn
@ 2013-05-25  1:25     ` David Bremner
  0 siblings, 0 replies; 8+ messages in thread
From: David Bremner @ 2013-05-25  1:25 UTC (permalink / raw)
  To: Robert Horn, Rainer M. Krug; +Cc: notmuch

Robert Horn <rjhorn@alum.mit.edu> writes:

>> David Belohrad <david@belohrad.ch> writes:
>>
>>> is there any way how to get 'current email' (not current thread)
>>> contents into kill ring so I could write a small script to paste it into
>>> org-mode template?
>>
>
> It's not the same thing, but org-capture with the mu4e buffers captures
> an active link to the email as the current context.  I find this to be
> sufficient for many tasks. It does mean I have to follow that link to
> look at the message itself.

org-notmuch (shipped with org-mode in contrib) provides the same
facilities for notmuch-show and notmuch-search buffers.

d

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

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

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-24  7:22 converting notmuch email to 'TODO' entry in org-mode David Belohrad
2013-05-24 11:38 ` David Bremner
2013-05-24 11:58   ` Tomi Ollila
2013-05-24 12:07 ` Rainer M. Krug
2013-05-24 16:37   ` Peter Feigl
2013-05-24 21:03   ` Robert Horn
2013-05-25  1:25     ` David Bremner
2013-05-24 17:29 ` Nicholas Peihl

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

	https://yhetil.org/notmuch.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).