[Top][All Lists]

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

Re: Include lines in setupfile are not evaluated: bug or feature?

From: Nicolas Goaziou
Subject: Re: Include lines in setupfile are not evaluated: bug or feature?
Date: Sat, 07 Dec 2019 12:19:27 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux)

Jarmo Hurri <address@hidden> writes:

> Greetings.
> I am (still) trying to figure out a SINGLE common setup/include file for
> all settings for a large batch of files.
> I found out recently that common #properties can be set in a setup file
> (but not in an included file). However, now it seems that in a setup
> file I can not include all common included files. Is this intended
> behaviour?
> Below is an example that demonstrates this. First the main (exported
> file):
> # ----------------------- file main-file.org ----------------------------
> #+setupfile: setup-file.org
> src_elisp[:exports results :results raw]{(org-entry-get nil "MY_PROPERTY" t)}
> # -----------------------------------------------------------------------
> Then the setup file:
> # ------------------ file setup-file.org ----------------------------
> #+property: MY_PROPERTY true
> #+include: setup-included.org
> # -----------------------------------------------------------------------
> Then the file that is supposed to be included in the setup file (and,
> consequently, in the main file):
> # ------------------ file setup-included.org ----------------------------
> Some text to be included.
> # -----------------------------------------------------------------------
> But the text is not included in the main file. Documentation of
> #setupfile says that
> "Org parses the contents of this document as if it was included in the
> buffer."
> https://orgmode.org/manual/In_002dbuffer-settings.html
> But that does not seem to be the case.

SETUPFILE and INCLUDE are orthogonal. There is no point in mixing them.

SETUPFILE keyword recursively loads configuration from other files,
without inserting anything. INCLUDE keyword recursively inserts contents
from other files in the current document, but there is no guarantee that
configuration from these files will be inherited.

As a rule of thumb, if you want to access to metadata (i.e., keywords),
use SETUPFILE, if you are interested in contents, use INCLUDE. Note that
you can have both for a single file.


Nicolas Goaziou

reply via email to

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