* org-capture question/suggestion
@ 2010-06-22 19:45 Tassilo Horn
2010-06-23 7:31 ` Sébastien Vauban
2010-06-23 8:05 ` Carsten Dominik
0 siblings, 2 replies; 4+ messages in thread
From: Tassilo Horn @ 2010-06-22 19:45 UTC (permalink / raw)
To: emacs-orgmode
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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: org-capture question/suggestion
2010-06-22 19:45 org-capture question/suggestion Tassilo Horn
@ 2010-06-23 7:31 ` Sébastien Vauban
2010-06-23 12:53 ` Tassilo Horn
2010-06-23 8:05 ` Carsten Dominik
1 sibling, 1 reply; 4+ messages in thread
From: Sébastien Vauban @ 2010-06-23 7:31 UTC (permalink / raw)
To: emacs-orgmode-mXXj517/zsQ
Hi Tassilo,
Tassilo Horn wrote:
> 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,
The same applies (or, applied) for me with Bernt's config for clocking
automatically when editing a task/note/etc. via the (old) remember interface:
when it lasted for less than one minute, the `CLOCK' line disappeared (thanks
to `org-clock-out-remove-zero-time-clocks'), but `:LOGBOOK:' and `:END:'
stayed:
--8<---------------cut here---------------start------------->8---
* Task added via remember
:LOGBOOK:
:END:
--8<---------------cut here---------------end--------------->8---
> and that I have to deal with indentation in the template is another
> inconvenience.
Regarding indentation, it is the same when a region is preselected: the first
line of the region is correctly indented; others, not. What would be nice is
that every line of the region would be prefixed by the same amount of spaces.
> 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.
Just for me to understand, what would you expect when you say that properties
should be appended?
- multiple creation dates?
- multiple links?
Maybe, even, you would want different behaviors for the different properties?
- creation dates not "append-able": the first one is kept?
- links appended in sequence?
> 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?
Interesting..
Best regards,
Seb
--
Sébastien Vauban
_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode-mXXj517/zsQ@public.gmane.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: org-capture question/suggestion
2010-06-22 19:45 org-capture question/suggestion Tassilo Horn
2010-06-23 7:31 ` Sébastien Vauban
@ 2010-06-23 8:05 ` Carsten Dominik
1 sibling, 0 replies; 4+ messages in thread
From: Carsten Dominik @ 2010-06-23 8:05 UTC (permalink / raw)
To: Tassilo Horn; +Cc: emacs-orgmode
On Jun 22, 2010, at 9:45 PM, Tassilo Horn wrote:
> 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.
James wrote to me that he will try to adapt his template-filling code
so that org-capture can use it. Among other things, this will make use
of the normal property API, and it will make the entire template stuff
extensible so that you can even write your own special functions.
This will be very useful, I am looking forward to a lot.
>
> 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")))
His looks very good. James, are you seeing this? THis would be an
interesting way to specify values for some properties, and then prompt
for others.
- Carsten
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: org-capture question/suggestion
2010-06-23 7:31 ` Sébastien Vauban
@ 2010-06-23 12:53 ` Tassilo Horn
0 siblings, 0 replies; 4+ messages in thread
From: Tassilo Horn @ 2010-06-23 12:53 UTC (permalink / raw)
To: emacs-orgmode
Sébastien Vauban <wxhgmqzgwmuf@spammotel.com>
writes:
Hi Sébastien,
> Just for me to understand, what would you expect when you say that
> properties should be appended?
>
> - multiple creation dates?
> - multiple links?
Hm, good question. I use properties as a kind of metadata hashtable, so
I'd expect that existing properties get overridden and new properties
get appended to an already existing properties block.
But appending to the existing value might also be nice in some
situations...
In any way, I'm against creating many equally named properties for an
entry, because although `org-entry-properties' states that keys
(property names) may occur many times, `org-entry-get' returns only the
value of the first, right?
> Maybe, even, you would want different behaviors for the different
> properties?
>
> - creation dates not "append-able": the first one is kept?
> - links appended in sequence?
Rename :created: to :edited: and then it's appendable, too. ;-)
But the suggestion is good. There should be a new property API function
`org-append-property PROP VAL' which appends VAL to the existing values,
and that could be used in property templates then.
So that slightly contrieved example would override the :lastedit: date,
and append to :edited: and :link:.
("x" "Add some text" plain
(id "bkeirkbeikboeiceibkebiknbk")
"Hello! %i"
:properties (("lastedit" "%U")
("edited" "%U" :append)
("link" "%a" :append)))
Bye,
Tassilo
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-06-23 12:54 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-22 19:45 org-capture question/suggestion Tassilo Horn
2010-06-23 7:31 ` Sébastien Vauban
2010-06-23 12:53 ` Tassilo Horn
2010-06-23 8:05 ` Carsten Dominik
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).