From mboxrd@z Thu Jan 1 00:00:00 1970 From: lists@wilkesley.net Subject: Re: Capture template to capture in current buffer Date: Mon, 14 Nov 2016 10:06:16 +0000 Message-ID: <9ac329e581e9a10bf05704f44fcd68e2@wilkesley.net> References: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:37006) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c6E9j-0006Jb-2t for emacs-orgmode@gnu.org; Mon, 14 Nov 2016 05:06:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c6E9i-0006Fg-1q for emacs-orgmode@gnu.org; Mon, 14 Nov 2016 05:06:27 -0500 In-Reply-To: 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" To: Rainer M Krug Cc: Emacs-orgmode , emacs-orgmode@gnu.org On 2016-11-10 11:35, Rainer M Krug wrote: > Hi > > I am trying to get an in-buffer logging to work. I want to log some > changes in the file and I am using the following template, which was > working some (longer?) time ago: > > --8<---------------cut here---------------start------------->8--- > (setq org-capture-templates > `( > ;; ;;;;;;;;;;;;;;;;:: > ;; In File Logging :: > ;; ;;;;;;;;;;;;;;;;:: > ("c" "Changes to be logged in buffer" > entry (file+headline (buffer-file-name) "CHANGES Log") > "* %^{Header of CHANGES item}\nLOGGED: %T \n- link :: %a > \n- author :: Rainer M Krug, email: Rainer@krugs.de\n %?") > )) > --8<---------------cut here---------------end--------------->8--- > > But now I get the following error message when using the capture > template: > > ,---- > | if: Target buffer ".notes" for file+headline should be in Org mode > `---- > I had a similar problem. Have a look at: https://www.reddit.com/r/emacs/comments/5b3mtr/orgmode_capture_template_issue_after_updating_to/ I fixed my problem by: ("c" "New blog post (cycling.ianbarton.net)" plain (file (lambda() (capture-pelican-draft-file "~/Documents/emacs/web_sites/cycling.ianbarton.net/org/_posts"))) "#+AUTHOR: Ian Barton\n#+DATE: %u\n#+PROPERTY: MODIFIED: \n#+TITLE\n#+CATEGORY: Blog \n#+PROPERTY: TAGS \n#+PROPERTY: SUMMARY \n") capture-pelican-draft-file is a function that gets the file name. So entry (file+headline (lambda() buffer-file-name)) "CHANGES Log") "* %^{Header of CHANGES item}\nLOGGED: %T \n- link :: %a \n- author :: Rainer M Krug, email: Rainer@krugs.de\n %?") may fix your problem (not tested). Ian.