From mboxrd@z Thu Jan 1 00:00:00 1970 From: Juan Subject: [PATCH] org-capture on file+regexp Date: Fri, 25 Jun 2010 11:37:10 -0300 Message-ID: <20100625143710.GA27109@soloJazz.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from [140.186.70.92] (port=45934 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OSCy4-0003iE-B2 for emacs-orgmode@gnu.org; Fri, 25 Jun 2010 13:45:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OSA1r-0001sF-V0 for emacs-orgmode@gnu.org; Fri, 25 Jun 2010 10:37:16 -0400 Received: from cpoproxy1-pub.bluehost.com ([69.89.21.11]:57339) by eggs.gnu.org with smtp (Exim 4.69) (envelope-from ) id 1OSA1r-0001ro-Kz for emacs-orgmode@gnu.org; Fri, 25 Jun 2010 10:37:15 -0400 Content-Disposition: inline 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: carsten.dominik@gmail.com Cc: emacs-orgmode@gnu.org 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))))