From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: Include lines in setupfile are not evaluated: bug or feature? Date: Sat, 07 Dec 2019 12:19:27 +0100 Message-ID: <8736dwwfgg.fsf@nicolasgoaziou.fr> References: <87fthwsh1d.fsf@iki.fi> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:33175) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1idY7b-0004NR-IK for emacs-orgmode@gnu.org; Sat, 07 Dec 2019 06:19:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1idY7a-00047b-CW for emacs-orgmode@gnu.org; Sat, 07 Dec 2019 06:19:35 -0500 Received: from relay12.mail.gandi.net ([217.70.178.232]:52661) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1idY7a-00044W-67 for emacs-orgmode@gnu.org; Sat, 07 Dec 2019 06:19:34 -0500 In-Reply-To: <87fthwsh1d.fsf@iki.fi> (Jarmo Hurri's message of "Sat, 07 Dec 2019 09:58:54 +0200") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: Jarmo Hurri Cc: emacs-orgmode@gnu.org Jarmo Hurri 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. Regards, -- Nicolas Goaziou