From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matt Lundin Subject: Re: Easily adding notes to a TODO item Date: Wed, 27 Apr 2011 13:19:26 -0400 Message-ID: <87ei4n7gtd.fsf@fastmail.fm> References: <87wrihrmov.fsf@fastmail.fm> <87zknblvan.fsf@fastmail.fm> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([140.186.70.92]:46333) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QF8Oh-0006kG-5h for emacs-orgmode@gnu.org; Wed, 27 Apr 2011 13:19:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QF8Og-0003Pe-3g for emacs-orgmode@gnu.org; Wed, 27 Apr 2011 13:19:31 -0400 Received: from out3.smtp.messagingengine.com ([66.111.4.27]:55973) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QF8Of-0003PI-U5 for emacs-orgmode@gnu.org; Wed, 27 Apr 2011 13:19:30 -0400 In-Reply-To: (Shawn Willden's message of "Wed, 27 Apr 2011 07:49:54 -0600") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Shawn Willden Cc: Org Mode Shawn Willden writes: > On Wed, Apr 27, 2011 at 6:42 AM, Matt Lundin 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