emacs-orgmode
[Top][All Lists]
Advanced

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

Re: Confused about what the COMMENT keyword means


From: Ihor Radchenko
Subject: Re: Confused about what the COMMENT keyword means
Date: Tue, 27 Sep 2022 09:55:31 +0800

Alain.Cochard@unistra.fr writes:

> Hello.  I have the file:
>
>    * COMMENT foo
>    #+EXPORT_FILE_NAME: foo.pdf
>    #+TITLE: foot
>    fofoo
>    * bar
>    #+EXPORT_FILE_NAME: bar.pdf
>    #+TITLE: bart
>    babar

#+EXPORT_FILE_NAME is an in-buffer export setting with global effect.
According to 13.2 Export Settings section of the Org manual,

       In-buffer settings may appear anywhere in the file, either directly
    or indirectly through a file included using ‘#+SETUPFILE: filename or
    URL’ syntax.

Because export settings are global, they have higher priority over the
COMMENTed heading.

Further, you have two instances of the #+EXPORT_FILE_NAME in your
buffer. The behaviour of Org is undefined in such scenario, but the
current implementation detail makes Org use the first instance found in
the file during export.

Do note that usage of #+EXPORT_FILE_NAME and #+TITLE like in your
example is erroneous - they do not apply to their subtrees. Please use
heading properties instead for the desired effect.

> By contrast, with this file
> 
>    # * foo
>    # #+EXPORT_FILE_NAME: foo.pdf
>    # #+TITLE: foot
>    # fofoo
>    * bar
>    #+EXPORT_FILE_NAME: bar.pdf
>    #+TITLE: bart
>    babar

This file contains no export settings.
# #+EXPORT_FILE_NAME: foo.pdf
line is not an export setting. It does not matter that it is a comment,
blah#+EXPORT_FILE_NAME: foo.pdf
would not work either.

--------

I think that the manual is not clear enough about applying in-buffer
settings and keywords. We may want to clarify this detail.

-- 
Ihor Radchenko,
Org mode contributor,
Learn more about Org mode at https://orgmode.org/.
Support Org development at https://liberapay.com/org-mode,
or support my work at https://liberapay.com/yantar92



reply via email to

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