emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] Capture template to capture in current buffer


From: lists
Subject: Re: [O] Capture template to capture in current buffer
Date: Mon, 14 Nov 2016 10:06:16 +0000
User-agent: Roundcube Webmail/1.2.1

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: address@hidden %?")
        ))
--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: address@hidden %?")

may fix your problem (not tested).

Ian.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]