emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Christian Moe <mail@christianmoe.com>
To: Marius Hofert <marius.hofert@math.ethz.ch>
Cc: Emacs help <emacs-orgmode@gnu.org>
Subject: Re: org-capture-template: How to correctly capture email addresses?
Date: Wed, 09 Nov 2011 10:34:45 +0100	[thread overview]
Message-ID: <4EBA4935.20208@christianmoe.com> (raw)
In-Reply-To: <F527DFA7-E611-4DDE-9B11-0A94221E70E0@math.ethz.ch>

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	other threads:[~2011-11-09  9:31 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-06 10:49 org-capture-template: How to correctly capture email addresses? Marius Hofert
2011-11-08 21:04 ` Marius Hofert
2011-11-09  9:34   ` Christian Moe [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4EBA4935.20208@christianmoe.com \
    --to=mail@christianmoe.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=marius.hofert@math.ethz.ch \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).