emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [BUG] `org-html-head-include-scripts' default value should be `t' but it's nil instead [9.7-pre (release_9.6.20-1267-gb0c3c9 @ /home/nick/src/emacs/org/org-mode/lisp/)]
@ 2024-03-21 18:41 Nick Dokos
  2024-03-21 18:55 ` Ihor Radchenko
  0 siblings, 1 reply; 4+ messages in thread
From: Nick Dokos @ 2024-03-21 18:41 UTC (permalink / raw)
  To: emacs-orgmode


------------------------------------------------------------------------
If you load `ox-html`, the default value of
`org-html-head-include-scripts` is nil, despite the defcustom:

    (defcustom org-html-head-include-scripts t ...

The reason is that `org-expot-define-backend`, which is called earlier
in the file, contains the following line in the options alist:

       (:html-head-include-scripts nil "html-scripts" org-html-head-include-scripts)

and the call apparently binds `org-html-head-include-scripts' to nil, so
by the time the defcustom is evaluated, it's too late. I was confused by
that, but the description of `defcustom' in the Emacs Lisp Ref manual
states:

     The argument STANDARD is an expression that specifies the standard
     value for OPTION.  Evaluating the ‘defcustom’ form evaluates
     STANDARD, but does not necessarily bind the option to that value.
     If OPTION already has a default value, it is left unchanged.  If
     the user has already saved a customization for OPTION, the user’s
     customized value is installed as the default value.  Otherwise, the
     result of evaluating STANDARD is installed as the default value.

I verified that if I move the `defcustom' to before the
`org-export-defined-backend' call, everything works as expected.

See

   https://emacs.stackexchange.com/questions/80783/org-mode-export-to-html-onmouseover-highlighting-of-referenced-code-lines

for the original question and the analysis.

Emacs  : GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.38, cairo version 1.17.8)
 of 2023-12-28
Package: Org mode version 9.7-pre (release_9.6.20-1267-gb0c3c9 @ /home/nick/src/emacs/org/org-mode/lisp/)

-- 
Nick




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [BUG] `org-html-head-include-scripts' default value should be `t' but it's nil instead [9.7-pre (release_9.6.20-1267-gb0c3c9 @ /home/nick/src/emacs/org/org-mode/lisp/)]
  2024-03-21 18:41 [BUG] `org-html-head-include-scripts' default value should be `t' but it's nil instead [9.7-pre (release_9.6.20-1267-gb0c3c9 @ /home/nick/src/emacs/org/org-mode/lisp/)] Nick Dokos
@ 2024-03-21 18:55 ` Ihor Radchenko
  2024-03-22  1:52   ` Nick Dokos
  0 siblings, 1 reply; 4+ messages in thread
From: Ihor Radchenko @ 2024-03-21 18:55 UTC (permalink / raw)
  To: Nick Dokos; +Cc: emacs-orgmode

Nick Dokos <ndokos@gmail.com> writes:

> If you load `ox-html`, the default value of
> `org-html-head-include-scripts` is nil, despite the defcustom:
>
>     (defcustom org-html-head-include-scripts t ...

Are you sure? What I am seeing in lisp/ox-html.el is

(defcustom org-html-head-include-scripts nil
  "Non-nil means include the JavaScript snippets in exported HTML files.
The actual script is defined in `org-html-scripts'."
  :group 'org-export-html
  :version "24.4"
  :package-version '(Org . "8.0")
  :type 'boolean)

The default value is nil.

-- 
Ihor Radchenko // yantar92,
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>


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [BUG] `org-html-head-include-scripts' default value should be `t' but it's nil instead [9.7-pre (release_9.6.20-1267-gb0c3c9 @ /home/nick/src/emacs/org/org-mode/lisp/)]
  2024-03-21 18:55 ` Ihor Radchenko
@ 2024-03-22  1:52   ` Nick Dokos
  2024-03-22 12:42     ` Ihor Radchenko
  0 siblings, 1 reply; 4+ messages in thread
From: Nick Dokos @ 2024-03-22  1:52 UTC (permalink / raw)
  To: emacs-orgmode

Ihor Radchenko <yantar92@posteo.net> writes:

> Nick Dokos <ndokos@gmail.com> writes:
>
>> If you load `ox-html`, the default value of
>> `org-html-head-include-scripts` is nil, despite the defcustom:
>>
>>     (defcustom org-html-head-include-scripts t ...
>
> Are you sure? What I am seeing in lisp/ox-html.el is
>
> (defcustom org-html-head-include-scripts nil
>   "Non-nil means include the JavaScript snippets in exported HTML files.
> The actual script is defined in `org-html-scripts'."
>   :group 'org-export-html
>   :version "24.4"
>   :package-version '(Org . "8.0")
>   :type 'boolean)
>
> The default value is nil.

You are right (I was playing in an old branch and did not notice it at
the time). And although the theoretical possibility still exists, I
don't know of any other manifestation, so the question is moot at this
point.

Sorry for the noise.
-- 
Nick



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [BUG] `org-html-head-include-scripts' default value should be `t' but it's nil instead [9.7-pre (release_9.6.20-1267-gb0c3c9 @ /home/nick/src/emacs/org/org-mode/lisp/)]
  2024-03-22  1:52   ` Nick Dokos
@ 2024-03-22 12:42     ` Ihor Radchenko
  0 siblings, 0 replies; 4+ messages in thread
From: Ihor Radchenko @ 2024-03-22 12:42 UTC (permalink / raw)
  To: Nick Dokos; +Cc: emacs-orgmode

Nick Dokos <ndokos@gmail.com> writes:

>> The default value is nil.
>
> You are right...

Canceled.

-- 
Ihor Radchenko // yantar92,
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>


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-03-22 12:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-21 18:41 [BUG] `org-html-head-include-scripts' default value should be `t' but it's nil instead [9.7-pre (release_9.6.20-1267-gb0c3c9 @ /home/nick/src/emacs/org/org-mode/lisp/)] Nick Dokos
2024-03-21 18:55 ` Ihor Radchenko
2024-03-22  1:52   ` Nick Dokos
2024-03-22 12:42     ` Ihor Radchenko

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).