[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] Easily adding notes to a TODO item
From: |
Matt Lundin |
Subject: |
Re: [O] Easily adding notes to a TODO item |
Date: |
Wed, 27 Apr 2011 13:19:26 -0400 |
User-agent: |
Gnus/5.110016 (No Gnus v0.16) Emacs/24.0.50 (gnu/linux) |
Shawn Willden <address@hidden> writes:
> On Wed, Apr 27, 2011 at 6:42 AM, Matt Lundin <address@hidden> wrote:
>> I'm not too familiar with invoking sexp expansion within capture
>> templates and am not sure whether you can expand an item within a sexp.
>
> It does work, sort of. My function is of the form:
>
> if path matches regexp
> return complicated link construction
> else
> return "[[file:" + path + "]]"
>
> What happens is that when called with the expanded %F the matching
> always fails so the "else" branch is always taken. When called from
> evaluated lisp code (e.g. (linkify "foo/bar")), the function works
> correctly.
>
[...]
>> Would the following work, or do you require something more complex?
>>
>> ("c" "Clock sibling" item (clock) "%T %a")
>
> I require something more complex. Our code repository has a pretty
> nifty web interface with a lot of very useful features. What I'm
> trying to do is arrange that if the file that I was working on when I
> created the note is from the source repository, I create a link to the
> web interface's rendition of the file, rather than to the file on the
> file system. If the file isn't from the code repository then I just
> create an ordinary file link.
Perhaps a simpler option would be to add a function to
org-store-link-functions. See the docstring of that variable for more
details.
The advantage of this approach is that your function would be called
whenever you are storing a link in one of the relevant files, instead of
only via a particular capture template.
Best,
Matt
Re: [O] Easily adding notes to a TODO item, Matt Lundin, 2011/04/26