From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id YBC+F67zYWMdBQAAbAwnHQ (envelope-from ) for ; Wed, 02 Nov 2022 05:35:58 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id 4Ga6F67zYWMhBwAA9RJhRA (envelope-from ) for ; Wed, 02 Nov 2022 05:35:58 +0100 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 F33CA6ABF for ; Wed, 2 Nov 2022 05:35:57 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oq5Sp-0007r6-4D; Wed, 02 Nov 2022 00:34:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oq5Si-0007qE-Ql for emacs-orgmode@gnu.org; Wed, 02 Nov 2022 00:34:50 -0400 Received: from mout01.posteo.de ([185.67.36.65]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oq5Se-0005km-Gq for emacs-orgmode@gnu.org; Wed, 02 Nov 2022 00:34:46 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id A7DCC240026 for ; Wed, 2 Nov 2022 05:34:41 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1667363681; bh=XDwcdE7wDrEvq/lyxmikk4rInU5xuj31ZcjrNEUgiBo=; h=From:To:Cc:Subject:Date:From; b=O7TkSL3v8oukRUIBRNUoKPH03JycmCV1U24yYAimQHckG2tJnuIFgMTrMA84ZudAD aEu1xczbXudCXXqJ87NKXTIXRgB9qRm30sbXbm/DUaFNtm46HC79AzZ//Bsk1hH5eC oHvQVs9mIEjTrFzsU4k5+GNEupie/8SdjaFhADWyWFajsDS5uzcuSXLxAU9TWFq9ib KOsT5+5+X3YryQPIi7pCsIkbBidbFKOoZWaJsxHpEGBqhhim1lp67ue3Yl0UzgnRmR wcNABEbdq7htLj14bKk4qqGG3m/08QDjx04JGspqUc+5gJFHVbfFd90XNjH435AswK 2MeuLluFIWlPw== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4N2DZ768xXz9rxG; Wed, 2 Nov 2022 05:34:39 +0100 (CET) From: Ihor Radchenko To: Tim Cross Cc: Ihor Radchenko , emacs-orgmode@gnu.org Subject: Re: Bug: html-postamble string does not allow space [9.4.4 (release_9.4.4 @ /usr/local/share/emacs/27.2/lisp/org/)] In-Reply-To: <86wn8gbvk0.fsf@gmail.com> References: <87pmjduuzf.fsf@gmail.com> <877d1ckqhp.fsf@localhost> <861qqpc5p1.fsf@gmail.com> <87cza8n5wm.fsf@localhost> <86wn8gbvk0.fsf@gmail.com> Date: Wed, 02 Nov 2022 04:35:16 +0000 Message-ID: <87wn8ekm7v.fsf@localhost> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=185.67.36.65; envelope-from=yantar92@posteo.net; helo=mout01.posteo.de X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_FILL_THIS_FORM_SHORT=0.01 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: , Sender: "Emacs-orgmode" Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1667363758; 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:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=Ths8f1gI+RnujTsnUhCS/OLH4uVQRXZJqwM7XtUwKS4=; b=VNppv/jsWmpg+n08DSCeJJP9qm5H4KNASoLyUUd90m2fcDB1neKoCnHCNLos5UpN8u/5XT c68zo9E/kBzEnXMegmQlP8E+gDSH+MyVEtuqABO8duy1Ws9cHOUv+IFwawLnV96j/tHVTh 7s3XUx2B1mP1FOojIahZ1hRdhYDkZUMG+VvjOE8bN5jvFNA/9ivLMDxuGDUCMwocPTsENU SGjab8cUmMnf2J3cDT9rok3+Z/3goWvnoa4x6Yrojzid7Bvy6gBChr1H1po1cjxoS81U5j xwDwZ8F/eaAUq42mbKzxGH6QkosSem5hw3BXpepzUG463Vy2Ew0FyNcJZodxrg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1667363758; a=rsa-sha256; cv=none; b=tTTB7NncfL9cDKkWBn4HC53WBxlqCVDiax1aXTVITvDxNTgxw/b1EIeQj50wajCv5i+H/8 Xm/3M7Zbi5Hf8ZJYEJbgEt+sDftlPxj5VV9+QTCHrcBoeoVaGqmfxLLkTdnyGyciLvbTyi VRPUCaf7YJw51x7da4YZLAA74mS2CBxsOocjUy1/TpQWI6ywX71jyBRMl4K0FJmaBgCRz3 ZZtYhlRrP1igpoVBR61rBJkd9PVucGwZm9XIXgUHMcrmtUq8UEmFbe66HHTvu2HfXPfukc Zfx+S8A8S3KsEP3xOI9h4/miqkqxg9KwcheAdGcp1ojO900dBEK0P+A1XMFISw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=O7TkSL3v; dmarc=pass (policy=none) header.from=posteo.net; 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: -4.78 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=O7TkSL3v; dmarc=pass (policy=none) header.from=posteo.net; 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: F33CA6ABF X-Spam-Score: -4.78 X-Migadu-Scanner: scn0.migadu.com X-TUID: hWKN4/T2qvjb --=-=-= Content-Type: text/plain Tim Cross writes: >>> What probably needs clarifying is >>> >>> 1. mention the string option in the manual >> >> It is documented in the manual: 13.9.4 HTML preamble and postamble >> > > You snipped out the relevant paragraph I copied from the manual. If you > look at it, you will see that it does not mention string as an option > for org-html-postamble. I see. I tried to clarify similarities and differences between pre- and postamble in the manual. See the attached. > Furthermore, the previous paragraph, which talks > about org-html-preamble, which does mention string, states that if the > string matches the name of a function, it will be called 9and expected > to return a string). That's wrong on the manual part. `org-html-preamble' can be set to a function. When it is set to string, the string is only treated as a format string. No function names. See the attached patches. > This is not mentioned at all in the doc string for > org-html-postamble. Fixed in the attached. > Therefore, I still think there is inconsistency between what the doc > string of the variable states and what the manual states. There is no > mention of function matching against strings in the cod string of the > variable. There is no mention of string as an option in the paragraph > referring to org-html-postamble in the manual. I hope I clarified the actual situation in the attached patches. Also, I fixed the actual code allowing org-html-preamble to be set to 'auto (the same code is used to format preamble and postamble). It does not make sense. >>> 2. If spaces are not allowed in the string, clearly document >>> that. Currently, the doc string just says that if set to a string, use >>> that string as the postamble, which I think implies spaces are OK. >> >> They are allowed. It is just #+OPTIONS keyword that does not allow >> strings as values. I have no idea why. > > This is all an aside to the actual bug, so please don't miss that > (unless it has been fixed) i.e. a org-html-postamble string with a space > in it does not work. I am confused here. The original bug talked specifically about situation like #+options: html-postamble:"test with spaces" Are you saying that you cannot have spaces in org-html-postamble variable? If yes, could you please provide a reproducer? --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-ox-html-Do-not-allow-org-html-preamble-to-be-auto.patch >From fecd0a1af6eba4099e31295fc3e00b003f538d45 Mon Sep 17 00:00:00 2001 Message-Id: From: Ihor Radchenko Date: Wed, 2 Nov 2022 12:21:01 +0800 Subject: [PATCH 1/3] ox-html: Do not allow `org-html-preamble' to be 'auto * lisp/ox-html.el (org-html--build-pre/postamble): Avoid building date/author/email info line when `org-html-preamble' is set to 'auto. This is only meaningful in `org-html-postamble'. --- lisp/ox-html.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/ox-html.el b/lisp/ox-html.el index cad06aebf..36fcd536c 100644 --- a/lisp/ox-html.el +++ b/lisp/ox-html.el @@ -1993,7 +1993,7 @@ (defun org-html--build-pre/postamble (type info) (if (functionp section) (funcall section info) (cond ((stringp section) (format-spec section spec)) - ((eq section 'auto) + ((and (eq section 'auto) (eq type 'postamble)) (let ((date (cdr (assq ?d spec))) (author (cdr (assq ?a spec))) (email (cdr (assq ?e spec))) -- 2.35.1 --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0002-org-manual-Clarify-similarities-and-differences-betw.patch >From 93cff0b3849c97300d979d3f95fcc5eb2a6b917c Mon Sep 17 00:00:00 2001 Message-Id: <93cff0b3849c97300d979d3f95fcc5eb2a6b917c.1667363392.git.yantar92@posteo.net> In-Reply-To: References: From: Ihor Radchenko Date: Wed, 2 Nov 2022 12:22:36 +0800 Subject: [PATCH 2/3] org-manual: Clarify similarities and differences between HTML pre/postamble * doc/org-manual.org (HTML preamble and postamble): Clarify that `org-html-postamble' can take the same values with `org-html-preamble'. Highlight, that `org-html-postamble' can also be set to `auto'. Reported-by: Tim Cross Link: https://orgmode.org/list/86wn8gbvk0.fsf@gmail.com --- doc/org-manual.org | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/doc/org-manual.org b/doc/org-manual.org index dc2fc57cd..f07466dff 100644 --- a/doc/org-manual.org +++ b/doc/org-manual.org @@ -13027,17 +13027,17 @@ *** HTML preamble and postamble ~org-html-preamble-format~ for the format string. Set ~org-html-preamble~ to a string to override the default format -string. If the string is a function, the HTML exporter expects the -function to return a string upon execution. The HTML exporter inserts -this string in the preamble. The HTML exporter does not insert -a preamble if ~org-html-preamble~ is set ~nil~. - -The default value for ~org-html-postamble~ is ~auto~, which makes the -HTML exporter build a postamble from looking up author's name, email -address, creator's name, and date. Set ~org-html-postamble~ to ~t~ to -insert the postamble in the format specified in the -~org-html-postamble-format~ variable. The HTML exporter does not -insert a postamble if ~org-html-postamble~ is set to ~nil~. +string. If set to a function, the HTML exporter expects the function +to return a string upon execution. The HTML exporter inserts this +string in the preamble. The HTML exporter does not insert a preamble +if ~org-html-preamble~ is set ~nil~. + +The above also applies to ~org-html-postamble~ and +~org-html-postamble-format~. In addition, ~org-html-postamble~ can be +set to ~auto~ (its default value), which makes the HTML exporter build +a postamble from looking up author's name, email address, creator's +name, and date. + *** Quoting HTML tags :PROPERTIES: -- 2.35.1 --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0003-org-html-postamble-Clarify-that-string-value-is-form.patch >From a87629f416f9a06099f6ce78aeeffb9a4233e5c1 Mon Sep 17 00:00:00 2001 Message-Id: In-Reply-To: References: From: Ihor Radchenko Date: Wed, 2 Nov 2022 12:28:52 +0800 Subject: [PATCH 3/3] org-html-postamble: Clarify that string value is format string * lisp/ox-html.el (org-html-postamble): Clarify that string value of the variable is not inserted verbatim, but used as format string. Reported-by: Tim Cross Link: https://orgmode.org/list/86wn8gbvk0.fsf@gmail.com --- lisp/ox-html.el | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lisp/ox-html.el b/lisp/ox-html.el index 36fcd536c..81f192d46 100644 --- a/lisp/ox-html.el +++ b/lisp/ox-html.el @@ -1276,9 +1276,11 @@ (defcustom org-html-postamble 'auto When set to `auto', check against the `org-export-with-author/email/creator/date' variables to set the -content of the postamble. When set to a string, use this string -as the postamble. When t, insert a string as defined by the -formatting string in `org-html-postamble-format'. +content of the postamble. When t, insert a string as defined by the +formatting string in `org-html-postamble-format'. When set to a +string, use this formatting string instead (see +`org-html-postamble-format' for an example of such a formatting +string). When set to a function, apply this function and insert the returned string. The function takes the property list of export -- 2.35.1 --=-=-= Content-Type: text/plain -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at --=-=-=--