emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nick Dokos <ndokos@gmail.com>
To: emacs-orgmode@gnu.org
Subject: [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/)]
Date: Thu, 21 Mar 2024 14:41:11 -0400	[thread overview]
Message-ID: <87bk77ig1k.fsf@pierrot.dokosmarshall.org> (raw)


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




             reply	other threads:[~2024-03-21 18:42 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-21 18:41 Nick Dokos [this message]
2024-03-21 18:55 ` [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/)] Ihor Radchenko
2024-03-22  1:52   ` Nick Dokos
2024-03-22 12:42     ` Ihor Radchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87bk77ig1k.fsf@pierrot.dokosmarshall.org \
    --to=ndokos@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).