From mboxrd@z Thu Jan 1 00:00:00 1970 From: Johan Friis Subject: Re: [PATCH] org-capture - using `file' as template Date: Wed, 14 Jul 2010 19:58:49 +0100 Message-ID: <87sk3l99g6.fsf@alterecco.net> References: <87bpaavlpo.fsf@alterecco.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from [140.186.70.92] (port=41955 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OZ7AE-0004nm-Bi for emacs-orgmode@gnu.org; Wed, 14 Jul 2010 14:58:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OZ7AD-0004qF-6p for emacs-orgmode@gnu.org; Wed, 14 Jul 2010 14:58:38 -0400 Received: from lo.gmane.org ([80.91.229.12]:33459) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OZ7AC-0004qB-Tj for emacs-orgmode@gnu.org; Wed, 14 Jul 2010 14:58:37 -0400 Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1OZ7AA-0004C2-L0 for emacs-orgmode@gnu.org; Wed, 14 Jul 2010 20:58:34 +0200 Received: from 212.red-88-19-72.staticip.rima-tde.net ([88.19.72.212]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 14 Jul 2010 20:58:34 +0200 Received: from mail by 212.red-88-19-72.staticip.rima-tde.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 14 Jul 2010 20:58:34 +0200 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: emacs-orgmode@gnu.org Hi Carsten, I did not have time to try out capture until now, and there is still a bug. When providing (file "...") as template `org-capture-set-plist' still generates a default template. Using the patch from David seems to work fine. Here is a diff against current head. - Johan diff --git a/lisp/org-capture.el b/lisp/org-capture.el index f79a20b..0f3a29b 100644 --- a/lisp/org-capture.el +++ b/lisp/org-capture.el @@ -981,7 +981,7 @@ Point will remain at the first line after the inserted text." (org-capture-put :key (car entry) :description (nth 1 entry) :target (nth 3 entry)) (let ((txt (nth 4 entry)) (type (or (nth 2 entry) 'entry))) - (when (or (not (stringp txt)) (not (string-match "\\S-" txt))) + (when (or (not txt) (and (stringp txt) (not (string-match "\\S-" txt)))) ;; The template may be empty or omitted for special types. ;; Here we insert the default templates for such cases. (cond