From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id ALcBGqe0MmNiHwEAbAwnHQ (envelope-from ) for ; Tue, 27 Sep 2022 10:30:31 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id uGEmGqe0MmMFaAEA9RJhRA (envelope-from ) for ; Tue, 27 Sep 2022 10:30:31 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 4FEE43889D for ; Tue, 27 Sep 2022 10:30:29 +0200 (CEST) Received: from localhost ([::1]:60292 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1od5z2-0002Tf-CK for larch@yhetil.org; Tue, 27 Sep 2022 04:30:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38096) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1od5CM-00025u-Qj for emacs-orgmode@gnu.org; Tue, 27 Sep 2022 03:40:10 -0400 Received: from mail-pf1-x431.google.com ([2607:f8b0:4864:20::431]:33565) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1od5CK-0002i3-R7 for emacs-orgmode@gnu.org; Tue, 27 Sep 2022 03:40:10 -0400 Received: by mail-pf1-x431.google.com with SMTP id w2so9004302pfb.0 for ; Tue, 27 Sep 2022 00:40:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:from:to:cc:subject:date; bh=YunoJBgWvw6s7t78+pkfPdD/oRWynEKAphPsukER4Ic=; b=YyTv2gb8jqIAeXE42vOPlC9Tb5tGIPVEILA/eK2gXrWGSQvFBc/XvhqQIQKK2ZUvup zTNoVZ+1mGTh3OAXUU1LJ9o/VMrHFsz3zPGbzLlrKAT56tSzxBhNyfiD7raApEXjYBUS uVCr6JwGfNbuKZScLcOVnaUgTBvR3eaI1VJInBmvb5AviGzpW2ZTOn6ePYcAor0SsPqX 46OcciY7cLGSKiQ4xulAwVYln8fYPa7C6ct4BMQzcS/N2eNeLzfQHvRU2nkskDWdyLSj iZIqTLXG7Rn5xCQsxsbnGR+Tiwee2lQxJtO4/qi720TZgg38WQobqqaH/cFXdFCr8J7w JtYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=YunoJBgWvw6s7t78+pkfPdD/oRWynEKAphPsukER4Ic=; b=Q7Bq3p9MTay7GgPuh4NM7+jJKBZSJ8LUCziT5ZRVwdX7Aey1lN/0xNrBVGu7Or0CcC 8Q75MGPO93rskGabmc8p6uADGl7xG0lIVINt0MxbdBT96xydWgAcR4tqikV7/YCaWIPP jmJBEGtSmEmtPus1ZbRkw3ZjaorirYJIkktvXHGOgCg9LHptd0yLVa0vo/tj/Jd1hM+U hHuMANHVGfil4xwK/kj9v/dCt5kIJLC09Iv/XmM14M2GF3v6gp5d4ibGUUGi7XFGbdVk wKIN6rJvTJhLY0EqpOH/4J/shigvRBojmHuwI2nNU/lHBrx0wAK2EXCMj4jscvY/Jj9X eQ2w== X-Gm-Message-State: ACrzQf0CBL7VuBGp5dnbiZbfyUJ/bi/hEMCiAhFpCWMUdXsGAFybRFUL ICMcAxQea5z7hzN8r2kTTVE= X-Google-Smtp-Source: AMsMyM4DkC3O2SZt3xr+HXmjnqni8R+cwIJ7pP8XNoCwCj04jsk0+y9sAVQQOIb8LICC30kJBhan1Q== X-Received: by 2002:a65:58cc:0:b0:43c:2fc6:e7d7 with SMTP id e12-20020a6558cc000000b0043c2fc6e7d7mr20826485pgu.478.1664264407027; Tue, 27 Sep 2022 00:40:07 -0700 (PDT) Received: from localhost ([2409:8970:a80:3a4:8ec6:81ff:fe70:339d]) by smtp.gmail.com with ESMTPSA id l19-20020a170902f69300b001755ac7dd0asm741522plg.290.2022.09.27.00.40.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Sep 2022 00:40:06 -0700 (PDT) From: Ihor Radchenko To: Alain.Cochard@unistra.fr Cc: emacs-orgmode@gnu.org Subject: Re: Confused about what the COMMENT keyword means In-Reply-To: <25394.40867.872373.589874@gargle.gargle.HOWL> References: <25393.61240.135445.401251@gargle.gargle.HOWL> <87leq5pomk.fsf@localhost> <25394.40867.872373.589874@gargle.gargle.HOWL> Date: Tue, 27 Sep 2022 15:40:57 +0800 Message-ID: <87o7v1nu2e.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=2607:f8b0:4864:20::431; envelope-from=yantar92@gmail.com; helo=mail-pf1-x431.google.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1664267429; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=YunoJBgWvw6s7t78+pkfPdD/oRWynEKAphPsukER4Ic=; b=emixILGzkEAhWIaK3BlLy+oz209U/ouFcSpvN3iN3ZnqneXfdL8Nxgm11N7leHY7FRF5xY 7h4Nmv4ncwtkwTspT23LGcrCHXe9cltz/M+C/Jv8B0hxFaGAk8K3UO4uJp3TLDIHRrKbM4 9IrvONvHybyV3/u0n7V6TY8xqvGlNAJ0Yj8viY8FUQyiuCqqhcrhWAS4eFCcICMBr987a/ MRDX7HtQ+ht5b57zMtV++XmnoNNFEGMRc+3JESFlGWp0ngWQ1jdLr0ZryeciHl2DBeCE+w GZFHi3ntPf80ZG4gZXrwkMD67w13deWJgVkmQoWHcAqlvDV3wWJubNgnx6Hz2A== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1664267429; a=rsa-sha256; cv=none; b=UIbjzj+EvH4FwLS3uuFH2P4Lo23V6ltEQymUJ3z4hggkMpfo7tLHFCJH16GdeQjKDPwzNU vHzmsd9mha5JTKhJGcg50rle9FlILSBGwgo9D8eQkeqV4zEc6gs5DgLawaFJML1mxlE3Eo LwclawRvyLC2hpnDA0hIWyqnY35woRFStrfTpx2tYmd7HHjKyW1mqdbUpsTh65ME8j06B8 Bl1nPJssxhUpEpurEtmuYYceZFt5vBNBm0IojSmwYbgxhM/QdrBWNoSdMXJE7fWn/Y19mz z4pEQCyhscrAkQbpnKFiXIA5YXDNyLTxcT16skEHvZdH8TkYJ73icyzeBCE5eg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=YyTv2gb8; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -1.84 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=YyTv2gb8; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 4FEE43889D X-Spam-Score: -1.84 X-Migadu-Scanner: scn1.migadu.com X-TUID: Gjw1XEsX6KUF Alain.Cochard@unistra.fr writes: > > In-buffer settings may appear anywhere in the file, either dire= ctly > > or indirectly through a file included using =E2=80=98#+SETUPFILE: = filename or > > URL=E2=80=99 syntax. > >=20 > > Because export settings are global, they have higher priority over the > > COMMENTed heading. > > OK, I can understand that but if, as I now see in 13.2, both TITLE and > EXPORT_FILE_NAME are export settings, why does it behaves as I expect > for TITLE (the title I get is indeed 'bart') but not for > EXPORT_FILE_NAME? This is a valid observation. I checked the code more closely, and I have to admit that I was wrong. Commented subtrees are, in fact, obeyed. Obeyed for all the keywords _but_ the EXPORT_FILE_NAME! Basically, including files, removing commented subtrees, and other excluded elements is done in `org-export-as' function. It is done before setting export options. However, `org-export-as' is generally called inside `org-export-to-file' and `org-export-to-file' needs to know which file to export to in advance; before the buffer is stripped of commented trees. That's why there is the observed inconsistency between EXPORT_FILE_NAME and TITLE settings. > > > By contrast, with this file > > >=20 > > > # * foo > > > # #+EXPORT_FILE_NAME: foo.pdf > > > # #+TITLE: foot > > > # fofoo > > > * bar > > > #+EXPORT_FILE_NAME: bar.pdf > > > #+TITLE: bart > > > babar > >=20 > > This file contains no export settings. > > I don't understand that: what about the line '#+EXPORT_FILE_NAME: > bar.pdf'?? Sorry, I was referring to the commented part only. Let me clarify what I was referring to. If you have a keyword like #+KEYWORD: value Org parses it like (keyword) syntax. and if you comment the keyword as # #+KEYWORD: value Org will _not_ parse something like (comment (keyword)) It will stop by seeing a (comment) and will not look further. Such keyword will be ignored all the times and no special arrangement is required during the export process. * COMMENT headings are different. If you have something like * COMMENT heading #+KEYWORD: value Org does look inside: (heading (:commentedp t) (keyword)) Then, such keyword can contribute to calculation of buffer settings. It is only `org-export-as' that makes special arrangement and physically removes COMMENTed subtrees before exporting the buffer. Hope it is now more clear. --=20 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