emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Using Properties in Capture Templates.
@ 2013-01-19  8:32 Ian Barton
  2013-01-23 14:33 ` Bastien
  0 siblings, 1 reply; 2+ messages in thread
From: Ian Barton @ 2013-01-19  8:32 UTC (permalink / raw)
  To: emacs-orgmode

I want to create a capture template which prompts for certain properties 
in a property draw, but alos creates some other properties without 
prompting for a value. However, I am having trouble mixing properties 
which are entered by the user and blank properties. The following 
example shows what I mean:

#+begin_src emacs-lisp
(defun capture-letter-file (path)
   (let ((name (read-string "File name: ")))
     (expand-file-name (format "%s-%s.org"
                               (format-time-string "%Y-%m-%d")
                               name) path)))

    "Letter template"
    (file (capture-letter-file  "~/dropbox/org/org_files/letters"))
    "#+STARTUP: showall indent\n#+STARTUP: hidestars\n#+OPTIONS: H:2 
num:nil tags:nil toc:nil timestamps:nil\n* 
Letter\n:PROPERTIES:\n:to_address:%^{salutation}p %^{to_name}p 
%^{subject}p %^{the_closing}p:END:\n

This produces:

#+STARTUP: showall indent
#+STARTUP: hidestars
#+OPTIONS: H:2 num:nil tags:nil toc:nil timestamps:nil
* Letter
:salutation: aaa
:to_name:  bbb
:subject:  ccc
:the_closing: zzz
:to_address:   :END:

Note the two :END: values and the :to_address: is placed outside the 
values for which the user was prompted. I have tried omitting the 
:PROPERTIES: and :END: from the template and letting org create them, 
but still end up with the :to_address: property being placed outside the 
property draw.


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

end of thread, other threads:[~2013-01-23 14:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-19  8:32 Using Properties in Capture Templates Ian Barton
2013-01-23 14:33 ` Bastien

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


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