From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: [PATCH] org-capture on file+regexp Date: Fri, 25 Jun 2010 20:53:30 +0200 Message-ID: References: <20100625143710.GA27109@soloJazz.com> Mime-Version: 1.0 (Apple Message framework v936) Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Return-path: Received: from [140.186.70.92] (port=52787 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OSE2D-0004Ka-IM for emacs-orgmode@gnu.org; Fri, 25 Jun 2010 14:54:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OSE1y-0007R7-CY for emacs-orgmode@gnu.org; Fri, 25 Jun 2010 14:53:39 -0400 Received: from mail-ww0-f41.google.com ([74.125.82.41]:49816) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OSE1y-0007Pl-7J for emacs-orgmode@gnu.org; Fri, 25 Jun 2010 14:53:38 -0400 Received: by wwf26 with SMTP id 26so1368145wwf.0 for ; Fri, 25 Jun 2010 11:53:34 -0700 (PDT) In-Reply-To: <20100625143710.GA27109@soloJazz.com> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Juan Cc: emacs-orgmode@gnu.org Applied, thanks. - Carsten On Jun 25, 2010, at 4:37 PM, Juan wrote: > Hi, > > Below is a patch for capturing on file+regexp (was using the file > name as regexp). > > Regards, > .j. > > P.S. Now I have to figure out why org-capture-place-entry inserts a > new level 1 if (not target-entry-p) instead of keeping the point where > it was (i.e. regexp match). > > 8<------------------------------------------------------------ > > diff --git a/lisp/org-capture.el b/lisp/org-capture.el > index 879dd25..03387c0 100644 > --- a/lisp/org-capture.el > +++ b/lisp/org-capture.el > @@ -556,7 +556,7 @@ already gone." > ((eq (car target) 'file+regexp) > (set-buffer (org-capture-target-buffer (nth 1 target))) > (goto-char (point-min)) > - (if (re-search-forward (nth 1 target) nil t) > + (if (re-search-forward (nth 2 target) nil t) > (progn > (goto-char (match-beginning 0)) > (setq target-entry-p (and (org-mode-p) (org-at-heading- > p)))) - Carsten