emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] Bug: Capture template insertion fails with #+FOO [9.1.14 (9.1.14


From: Philip Hudson
Subject: Re: [O] Bug: Capture template insertion fails with #+FOO [9.1.14 (9.1.14-1-g4931fc-elpa @ /home/phil/.emacs.d/elpa/org-9.1.14/)]
Date: Thu, 1 Nov 2018 10:04:53 +0000

Two further thoughts:

1. That regexp works but it should really start with "^":

  (org-capture-verify-tree (replace-regexp-in-string "^#\+[^\n]*\n" ""
template))

2. The fix I propose is a kludge. The real problem is the semantics of
function `org-capture-insert-template-here'. My assertion: there is no
reason to believe that a completed template of type 'entry must be a
subtree in the sense of the contract of function
`org-kill-is-subtree-p'. In other words, function
`org-kill-is-subtree-p' is meant for something else. We either need a
similar-but-different special-purpose entry-template verification
function, defined in 'org-capture.el' itself, or, if we can do so
without introducing other regressions, we need to modify function
`org-kill-is-subtree-p' to accept "#+KEYWORD" in-buffer settings.
On Mon, 29 Oct 2018 at 22:47, Philip Hudson <address@hidden> wrote:
>
> Remember to cover the basics, that is, what you expected to happen and
> what in fact did happen.  You don't know how to make a good report?  See
>
>     https://orgmode.org/manual/Feedback.html#Feedback
>
> Your bug report will be posted to the Org mailing list.
> ------------------------------------------------------------------------
>
> Regression in org-capture template handling.
>
> I expected my (previously working) org-capture template to be
> inserted into a newly-created empty Org file. The file name and
> location are the output of a function specified in the template
> (sequentially numbered filename).
>
> Function `org-capture-insert-template-here' in file org-capture.el
> now errors if the template specifies that its type is 'entry and it
> begins with one or more lines of the general form "#+KEY value".
> The error traces to a call to `org-kill-is-subtree-p', defined in file
> org.el.
>
> Fix (sorry it's not a proper patch):
>
> Change line 1399 of org-capture.el from:
>
>    (org-capture-verify-tree (org-capture-get :template))
>
> to:
>
>    (org-capture-verify-tree (replace-regexp-in-string "#\+[^\n]*\n" ""
> template))
>
> (This includes a refactoring-out of that redundant call to `org-capture-get').
>
> NOTE: I have signed the FSF papers. In fact I've made small
> contributions to Org-mode previously.
>
> Emacs  : GNU Emacs 24.4.1 (x86_64-pc-linux-gnu, GTK+ Version 3.14.5)
> of 2017-09-12 on hullmann, modified by Debian
> Package: Org mode version 9.1.14 (9.1.14-1-g4931fc-elpa @
> /home/phil/.emacs.d/elpa/org-9.1.14/)
>
> --
> Phil Hudson                  http://hudson-it.ddns.net
> Pretty Good Privacy (PGP) ID: 0x4E482F85



-- 
Phil Hudson                  http://hudson-it.ddns.net
Pretty Good Privacy (PGP) ID: 0x4E482F85



reply via email to

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