From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sebastian Rose Subject: Re: [Patch] New implementation of the Org remember process ready for comments and testing Date: Wed, 23 Jun 2010 01:32:28 +0200 Message-ID: <871vby8wz7.fsf_-_@gmx.de> References: <87aaqm8y5n.fsf@gmx.de> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from [140.186.70.92] (port=40677 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ORCxE-0008Dm-Qn for emacs-orgmode@gnu.org; Tue, 22 Jun 2010 19:32:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1ORCx5-00088x-QS for emacs-orgmode@gnu.org; Tue, 22 Jun 2010 19:32:32 -0400 Received: from mail.gmx.net ([213.165.64.20]:34242) by eggs.gnu.org with smtp (Exim 4.69) (envelope-from ) id 1ORCx5-00087Q-Ee for emacs-orgmode@gnu.org; Tue, 22 Jun 2010 19:32:23 -0400 In-Reply-To: <87aaqm8y5n.fsf@gmx.de> (Sebastian Rose's message of "Wed, 23 Jun 2010 01:07:00 +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: Carsten Dominik Cc: Org Mode --=-=-= Sebastian Rose writes: > * Separate template files > > I'd like to use Org-mode to edit templates. > > I'm trying this: > > (setq org-capture-templates > ( > `( > ("l" "Lauf" entry (file+headline "notes/Laufen/Training.org" "Training") > ,(org-file-contents "~/emacs/org/capture-templates/training.org") > :empty-lines 1)))) > > But I get an error when calling `org-capture': Here is a patch that would do: --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=org-capture-file-templates.patch diff --git a/lisp/org-capture.el b/lisp/org-capture.el index 32db517..dfc7bb1 100644 --- a/lisp/org-capture.el +++ b/lisp/org-capture.el @@ -794,6 +794,8 @@ 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 (file-exists-p txt) + (setq txt (org-file-contents txt))) (when (or (not 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. --=-=-= Now I could use this: (setq org-capture-templates (quote (("l" "Lauf" entry (file+headline "notes/Laufen/Training.org" "Training") "~/emacs/org/capture-templates/training.org" :empty-lines 1)))) This patch ignores a possible clash headline <=> filename. Sebastian --=-=-= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode --=-=-=--