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

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