Re: Bug: html-postamble string does not allow space [9.4.4 (release_9.4.4 @ /usr/local/share/emacs/27.2/lisp/org/)]

2022-11-16 Thread Ihor Radchenko
Tim Cross  writes:

>> Are you saying that you cannot have spaces in org-html-postamble
>> variable? If yes, could you please provide a reproducer?
>>
>
> To be honest, it was so long ago when I looked into verifying this
> issue, I no longer recall the precise details. My memory was that just
> having a space in the footer triggered the issue - it didn't have to be
> only when the value was set via #+options, but I could be wrong. If you
> cannot reproduce the bug just using spaces set, for example, with a
> setting in org-publish-project-alist, then I'd say the issue is
> resolved.

I do not see in the code how space could matter once the variable/option
is set.

> My main concern here was that it wasn't clear whether the underlying
> issue had been addressed and while the doc improvements are great, I
> didn't want the actual triggering issue to get lost amongst all the
> rest.

Fixed already. Do not worry. I just wanted to address more recent
comments first.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: Bug: html-postamble string does not allow space [9.4.4 (release_9.4.4 @ /usr/local/share/emacs/27.2/lisp/org/)]

2022-11-16 Thread Ihor Radchenko
Pierre Balayé  writes:

> #+options: html-postamble:"TEST SPACE"
> ```
>
> it raises this error I cannot solve:
> `org-export--parse-option-keyword: End of file during parsing`

Fixed on main.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=ad623799849177cc837e344d89bbfc654bf389dd

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: Bug: html-postamble string does not allow space [9.4.4 (release_9.4.4 @ /usr/local/share/emacs/27.2/lisp/org/)]

2022-11-16 Thread Tim Cross


Ihor Radchenko  writes:

>>
>> 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?
>

To be honest, it was so long ago when I looked into verifying this
issue, I no longer recall the precise details. My memory was that just
having a space in the footer triggered the issue - it didn't have to be
only when the value was set via #+options, but I could be wrong. If you
cannot reproduce the bug just using spaces set, for example, with a
setting in org-publish-project-alist, then I'd say the issue is
resolved.

My main concern here was that it wasn't clear whether the underlying
issue had been addressed and while the doc improvements are great, I
didn't want the actual triggering issue to get lost amongst all the
rest.

Tim



Re: Bug: html-postamble string does not allow space [9.4.4 (release_9.4.4 @ /usr/local/share/emacs/27.2/lisp/org/)]

2022-11-15 Thread Ihor Radchenko
Ihor Radchenko  writes:

> Fixed in the attached.

Applied onto main.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=84b487868
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=d4299eeac
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=5c247fb27


-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: Bug: html-postamble string does not allow space [9.4.4 (release_9.4.4 @ /usr/local/share/emacs/27.2/lisp/org/)]

2022-11-01 Thread Ihor Radchenko
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?

>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

>From 93cff0b3849c97300d979d3f95fcc5eb2a6b917c Mon Sep 17 00:00:00 2001
Message-Id: <93cff0b3849c97300d979d3f95fcc5eb2a6b917c.1667363392.git.yanta...@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@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 

Re: Bug: html-postamble string does not allow space [9.4.4 (release_9.4.4 @ /usr/local/share/emacs/27.2/lisp/org/)]

2022-10-30 Thread Tim Cross


Ihor Radchenko  writes:

> 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. 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). This is not mentioned at all in the doc string for
org-html-postamble.

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. 


>> 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.




Re: Bug: html-postamble string does not allow space [9.4.4 (release_9.4.4 @ /usr/local/share/emacs/27.2/lisp/org/)]

2022-10-30 Thread Ihor Radchenko
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

> 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.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: Bug: html-postamble string does not allow space [9.4.4 (release_9.4.4 @ /usr/local/share/emacs/27.2/lisp/org/)]

2022-10-30 Thread Tim Cross


Ihor Radchenko  writes:

> Tim Cross  writes:
>
>> Confirm.
>>
>> I am able to reproduce this issue with 
>
> I might be missing something, but does
> `org-export--parse-option-keyword' even support spaces inside values?
>
>> I also feel the manual page could be improved as it doesn't actually
>> mention setting the html-postamble to a string (that is only mentioned
>> in the variable docstring).
>
> The manual does even mention the "html-postamble" option. Just the
> variable. I am confused. Was it removed at some point? (I do not see any
> commits doing so)

Sorry for late response. Only just noticed this amongst all the items in
my org mailbox.

It was a while ago. I do recall I was able to reproduce the issue, so
there was a bug here. Either it is a code bug or a documentation bug.

My error was in omitting the leading org- for the variable name. Correct
name is org-html-postamble. Apologies. 

With regards to the documentation, the section in the manual is

   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’.

Note no mention of string, although the previous paragraph talking about
org-html-preamble does mention string.

and the doc string for the variable is

Non-nil means insert a postamble in HTML export.

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’.

When set to a function, apply this function and insert the
returned string.  The function takes the property list of export
options as its only argument.

Setting :html-postamble in publishing projects will take
precedence over this variable.

What probably needs clarifying is

1. mention the string option in the manual

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. 




Re: Bug: html-postamble string does not allow space [9.4.4 (release_9.4.4 @ /usr/local/share/emacs/27.2/lisp/org/)]

2022-10-07 Thread Ihor Radchenko
Tim Cross  writes:

> Confirm.
>
> I am able to reproduce this issue with 

I might be missing something, but does
`org-export--parse-option-keyword' even support spaces inside values?

> I also feel the manual page could be improved as it doesn't actually
> mention setting the html-postamble to a string (that is only mentioned
> in the variable docstring).

The manual does even mention the "html-postamble" option. Just the
variable. I am confused. Was it removed at some point? (I do not see any
commits doing so)

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: Bug: html-postamble string does not allow space [9.4.4 (release_9.4.4 @ /usr/local/share/emacs/27.2/lisp/org/)]

2022-06-12 Thread Tim Cross


Confirm.

I am able to reproduce this issue with 

GNU Emacs 28.1.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.33,
cairo version 1.16.0) of 2022-05-29

Org mode version 9.5.4 (9.5.4-gc02c0d @ 
/home/tim/.emacs.husky/straight/build/org/)

I also feel the manual page could be improved as it doesn't actually
mention setting the html-postamble to a string (that is only mentioned
in the variable docstring).

Pierre Balayé  writes:
> I am using html export feature for org files and I want to change the value 
> of html-postamble (see [doc]
> (https://orgmode.org/manual/HTML-preamble-and-postamble.html)).
>
> Here is the `index.org` file:
> ```
> #+title: Home
>
> Welcome
>
> #+options: html-postamble:"TESTSPACE"
> ```
>
> When I export with `M-x org-html-export-as-html` everything is all right and 
> I have the following at the end of the html produced
> buffer:
>
> ```html
> 
> TESTSPACE
> 
> ```
>
> But if I add a space:
> ```
> #+title: Home
>
> Welcome
>
> #+options: html-postamble:"TEST SPACE"
> ```
>
> it raises this error I cannot solve:
> `org-export--parse-option-keyword: End of file during parsing`
>
> Emacs  : GNU Emacs 27.2 (build 1, x86_64-pc-linux-gnu, X toolkit, Xaw scroll 
> bars)
>  of 2022-05-10
> Package: Org mode version 9.4.4 (release_9.4.4 @ 
> /usr/local/share/emacs/27.2/lisp/org/)
>
> current state:
> ==
> (setq
>  org-src-mode-hook '(org-src-babel-configure-edit-buffer 
> org-src-mode-configure-edit-buffer)
>  org-link-shell-confirm-function 'yes-or-no-p
>  org-metadown-hook '(org-babel-pop-to-session-maybe)
>  org-clock-out-hook '(org-clock-remove-empty-clock-drawer)
>  org-html-format-inlinetask-function 
> 'org-html-format-inlinetask-default-function
>  org-odt-format-headline-function 'org-odt-format-headline-default-function
>  org-ascii-format-inlinetask-function 'org-ascii-format-inlinetask-default
>  org-mode-hook '(#[0 "\301\211 \207" [imenu-create-index-function 
> org-imenu-get-tree] 2]
> #[0 "\300\301\302\303\304$\207"
>   [add-hook change-major-mode-hook org-show-all append local] 5]
> #[0 "\300\301\302\303\304$\207"
>   [add-hook change-major-mode-hook org-babel-show-result-all append local]
>   5]
> org-babel-result-hide-spec org-babel-hide-all-hashes)
>  org-odt-format-drawer-function #[514 "\207" [] 3 "\n\n(fn NAME CONTENTS)"]
>  org-archive-hook '(org-attach-archive-delete-maybe)
>  org-confirm-elisp-link-function 'yes-or-no-p
>  org-agenda-before-write-hook '(org-agenda-add-entry-text)
>  org-metaup-hook '(org-babel-load-in-session-maybe)
>  org-bibtex-headline-format-function #[257 "\300 \236A\207" [:title] 3 
> "\n\n(fn ENTRY)"]
>  org-latex-format-drawer-function #[514 "\207" [] 3 "\n\n(fn _ CONTENTS)"]
>  org-babel-pre-tangle-hook '(save-buffer)
>  org-tab-first-hook '(org-babel-hide-result-toggle-maybe 
> org-babel-header-arg-expand)
>  org-ascii-format-drawer-function #[771 " \207" [] 4 "\n\n(fn NAME CONTENTS 
> WIDTH)"]
>  org-agenda-loop-over-headlines-in-active-region nil
>  org-occur-hook '(org-first-headline-recenter)
>  org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-hide-drawers
>  org-cycle-show-empty-lines org-optimize-window-after-visibility-change)
>  org-speed-command-hook '(org-speed-command-activate 
> org-babel-speed-command-activate)
>  org-odt-format-inlinetask-function 
> 'org-odt-format-inlinetask-default-function
>  org-export-before-parsing-hook '(org-attach-expand-links)
>  org-confirm-shell-link-function 'yes-or-no-p
>  org-link-parameters '(("attachment" :follow org-attach-follow :complete
> org-attach-complete-link)
>   ("id" :follow org-id-open)
>   ("eww" :follow org-eww-open :store org-eww-store-link)
>   ("rmail" :follow org-rmail-open :store org-rmail-store-link)
>   ("mhe" :follow org-mhe-open :store org-mhe-store-link)
>   ("irc" :follow org-irc-visit :store org-irc-store-link :export
> org-irc-export)
>   ("info" :follow org-info-open :export org-info-export :store
> org-info-store-link)
>   ("gnus" :follow org-gnus-open :store org-gnus-store-link)
>   ("docview" :follow org-docview-open :export org-docview-export
> :store org-docview-store-link)
>   ("bibtex" :follow org-bibtex-open :store org-bibtex-store-link)
>   ("bbdb" :follow org-bbdb-open :export org-bbdb-export :complete
> org-bbdb-complete-link :store org-bbdb-store-link)
>   ("w3m" :store org-w3m-store-link) ("file+sys") ("file+emacs")
>   ("shell" :follow org-link--open-shell)
>   ("news" :follow
> #[514 "\301\300\302 Q \"\207" ["news" browse-url ":"] 6
>  "\n\n(fn URL ARG)"]
> )
>   ("mailto" :follow
> #[514 "\301\300\302 Q \"\207" ["mailto" browse-url ":"] 6
>  "\n\n(fn URL ARG)"]
> )
>   ("https" :follow
> #[514 "\301\300\302 Q \"\207" ["https" browse-url ":"] 6
>  "\n\n(fn URL ARG)"]
> )
>   ("http" :follow
> #[514 "\301\300\302 Q \"\207" ["http" browse-url ":"] 6
>  "\n\n(fn URL ARG)"]
> )
>   ("ftp" :follow
> #[514 "\301\300\302 Q \"\207" ["ftp" browse-url ":"] 6