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 08:42:56 -0400 Message-ID: <87zknblvan.fsf@fastmail.fm> References: <87wrihrmov.fsf@fastmail.fm> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([140.186.70.92]:37376) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QF45A-0005mL-E5 for emacs-orgmode@gnu.org; Wed, 27 Apr 2011 08:43:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QF455-0006wR-8p for emacs-orgmode@gnu.org; Wed, 27 Apr 2011 08:43:04 -0400 Received: from out2.smtp.messagingengine.com ([66.111.4.26]:46711) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QF455-0006wN-0Q for emacs-orgmode@gnu.org; Wed, 27 Apr 2011 08:42:59 -0400 In-Reply-To: (Shawn Willden's message of "Tue, 26 Apr 2011 16:23:53 -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 Tue, Apr 26, 2011 at 10:40 AM, Matt Lundin wrote: >> Shawn Willden writes: >>> I'd also like to be able to easily take notes using something like >>> "remember", but with the notes by default automatically appended to >>> the text under the task I'm currently clocked into, with an attached >>> timestamp. > >> You can also use a capture template for this, e.g.: > > I had to update org-mode to get a working org-capture, and it looks > like I can't get plain text automatically placed in the correct spot > (though list entries work fine, which is acceptable), and I've created > a custom function to take the current file path and linkify it nicely, > with some variation depending on the contents of the path. > > ... but that last bit isn't working. > > I have a function "linkify-path" which takes a path as a parameter and > properly converts the path into an org-mode link in the way I want. > But the function doesn't work correctly when I call it from my > template. > > My template looks like: > > ("c" "Clock sibling" item (clock) "%T %(linkify-path \"%F\")") > > It almost works. The first think linkify-path does is call > string-match to look for a particular substring that I want to handle > specially. When I call linkify-path normally, this works. When it's > invoked by the expansion of the template, the match appears always to > fail, so I never get the special handling. > 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. I imagine other community members might have some ideas. (I'm Cc'ing the ML on this reply.) Would the following work, or do you require something more complex? ("c" "Clock sibling" item (clock) "%T %a") Best, Matt