emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Tassilo Horn <tassilo@member.fsf.org>
To: emacs-orgmode@gnu.org
Subject: org-capture question/suggestion
Date: Tue, 22 Jun 2010 21:45:31 +0200	[thread overview]
Message-ID: <877hlqetr8.fsf@thinkpad.tsdh.de> (raw)

Hi,

as already said, I really like the new org-capture interface.  But
there's one thing concerning the templates, which might be optimized a
bit.

I want to add certain information accessible with template escapes as
properties.  So as an example, I have a template like this:

 ("t" "TODO" entry
  (file "/home/horn/repos/org/remember.org")
  "* TODO %?\n  :PROPERTIES:\n  :created: %U\n  :link: %a\n  :END:\n  %i")

The creation date %U is always there, so that's no problem.  But the
link accessible with %a may be nil.  Then, I really don't want to have a
:link: property.  Currently, I simply delete that line before filing the
item.  That's a bit inconvenient, and that I have to deal with
indentation in the template is another inconvenience.  And it won't work
when my capture template doesn't create a new entry, but appends to an
existing one.  In that case, properties should be appended to existing
properties, too.

So what I would love to see was a possibility to have property escapes,
which use the property API and only add properties that have a value.
Then the property API would handle the correct indentation and
everything else.

Maybe, a good syntax would be %:propname:X, where X is one of the normal
escapes without the leading %.  Then I could write the template above
like that:

 ("t" "TODO" entry
  (file "/home/horn/repos/org/remember.org")
  "* TODO %?\n  %i %:created:U %:link:a")

Well, I don't really care about the syntax.  Maybe it's better to
specify properties outside the template, because they won't be inserted
at the exact position defined in the template anyway, especially if type
is not 'entry.  So how about something like that:

 ("t" "TODO" entry
  (file "/home/horn/repos/org/remember.org")
  "* TODO %?\n  %i"
  :properties (("created" "%U")
               ("link"    "%a")))

What do you think?

Bye,
Tassilo

             reply	other threads:[~2010-06-22 19:45 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-22 19:45 Tassilo Horn [this message]
2010-06-23  7:31 ` org-capture question/suggestion Sébastien Vauban
2010-06-23 12:53   ` Tassilo Horn
2010-06-23  8:05 ` Carsten Dominik

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=877hlqetr8.fsf@thinkpad.tsdh.de \
    --to=tassilo@member.fsf.org \
    --cc=emacs-orgmode@gnu.org \
    /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).