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: Nicolas Goaziou
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: Mon, 05 Nov 2018 22:46:07 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux)

Hello,

Philip Hudson <address@hidden> writes:

> On Sun, 4 Nov 2018 at 14:03, Nicolas Goaziou <address@hidden> wrote:

>> No, it is not the case. AFAIU, in the minimal failing case, you capture
>>
>>     #+FOO: bar
>>     * Baz
>>
>> This is _not_ a node. A node starts with a headline and everything is
>> contained within that headline. So it doesn't qualify as a valid `entry'
>> capture type.
>
> That's disappointing, and, obviously, news to me. So I have not
> encountered a regression but rather a tightening of the existing
> documented contract. Is that a fair interpretation of what you're
> saying? If so, and not that I doubt you, do you have a reference for
> that?

It is not a tightening of anything. The function responsible for the
raised error is `org-capture-verify-tree'. It is called from the
function responsible for capturing `entry' types since December 2010:

    commit 8aacc708dd038fd0d351abbed04d49f813f8a7bf
    Author: Carsten Dominik <address@hidden>
    Date:   Thu Dec 16 16:51:04 2010 +0100

        Capture: Better error message for invalid entry-type templates

It seems to me the intent is clear, and from the documentation,
I wouldn't have thought about inserting data before the headline. I'm
surprised that your template even worked at some point.

I did my homework, though. I tried the following set-up

    (setq org-capture-templates
          '(("B" "BUG" entry (file "/tmp/bug-capture.org") "#+BAR: baz\n* Foo"
             :immediate-finish t)))

Even in Org 8.2.10, which is old in my book, I got an error mentioning
the template was invalid.

> The idea of 'entry type for templates, and of a node as we are
> discussing it, is that a well-formed and valid Org file is composed
> exclusively of these entities and nothing else. Correct?

Not at all. I'm absolutely not talking about what is a valid Org file.
See <https://orgmode.org/worg/dev/org-syntax.html> for this.

I'm talking about what can be captured using an `entry' template, i.e.,
a node/heading/entry and that's it.

> Sorry if this is getting tiresome. At this point I'm content for you
> to close this issue and move on if you'd rather. I'll change my
> template type to 'plain, or find some other workaround. But if you'd
> like to keep going for the sake of clarifying what the right and
> proper meaning of 'entry and "node" are then I'm glad to participate.

Entry, node, and heading (and to some extent, headline) are synonyms.
They mean star(s) at the beginning of line, followed by a space, and
optionally other stuff of that line.

Contents can be anything as long as no line starts with as many or less
stars followed by a space, i.e., there is no headline of a lesser or
equal level.

In any case, if documentation needs to be clarified, please let me know.

Regards,

-- 
Nicolas Goaziou



reply via email to

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