emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] org-capture-template: How to correctly capture email addresses?


From: Christian Moe
Subject: Re: [O] org-capture-template: How to correctly capture email addresses?
Date: Wed, 09 Nov 2011 10:34:45 +0100
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:5.0) Gecko/20110624 Thunderbird/5.0

Hi,

If org-contacts-template-email doesn't find an address, it doesn't insert a simple text prompt, it inserts a property prompt, which sets the property. A property prompt does not need to be positioned in an explicit property drawer in the template -- in fact, it looks like that will not work.

Removing the EMAIL property and moving the "%(org-contacts-template-email)" field out of the property drawer works:

(setq org-capture-templates
'(("t" "TODO in ~/org/agenda.org -> Tasks" entry (file+headline "~/org/agenda.org" "Tasks")
        "* TODO %?\nSCHEDULED: %^t\n%U %a")
("c" "Contact in ~/org/contacts.org -> Contact" entry (file+headline "~/org/contacts.org" "Contact") "* %?%(org-contacts-template-name) %^g %(org-contacts-template-email)
:PROPERTIES:
:URL:
:WORK:
:HOME:
:MOBILE:
:LOCATION:
:BIRTHDAY:
:NOTE:
:END:")))

You still get EMAIL at the end of the property drawer, but the order is arbitrary anyway. You could replace the whole properties drawer with property prompts:


(setq org-capture-templates
'(("t" "TODO in ~/org/agenda.org -> Tasks" entry (file+headline "~/org/agenda.org" "Tasks")
        "* TODO %?\nSCHEDULED: %^t\n%U %a")
("c" "Contact in ~/org/contacts.org -> Contact" entry (file+headline "~/org/contacts.org" "Contact")
        "* %?%(org-contacts-template-name) %^g
%(org-contacts-template-email)
%^{URL}p %^{WORK}p %^{HOME}p %^{MOBILE}p
%^{LOCATION}p %^{BIRTHDAY}p %^{NOTE}p")))

...but then you'd be prompted for everything, each time; you may not want that.


Yours,
Christian



reply via email to

[Prev in Thread] Current Thread [Next in Thread]