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: rai...@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: rai...@krugs.de\n %?")

may fix your problem (not tested).

Ian.


Reply via email to