GNU bug report logs -
#79629
31.0.50; Cannot customize holiday-other-holidays using setopt
Previous Next
To reply to this bug, email your comments to 79629 AT debbugs.gnu.org.
There is no need to reopen the bug first.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-gnu-emacs <at> gnu.org:
bug#79629; Package
emacs.
(Tue, 14 Oct 2025 21:40:03 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Amin Bandali <bandali <at> gnu.org>:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org.
(Tue, 14 Oct 2025 21:40:03 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
I noticed that I'm unable to customize the holiday-other-holidays
variable using the setopt macro: my change does not seem to take
effect, or perhaps gets "overwritten" somehow.
Currently, the following does not have the intended effect:
(setopt
holiday-other-holidays
'((holiday-float 10 1 2 "Canadian Thanksgiving")))
With the above in my user-init-file, if I do M-x calendar then
move the cursor to Monday October 13 and press 'h', I do not see
Canadian Thanksgiving as a holiday for that day.
Whereas either of the following snippets work as expected:
(setq ; before `holidays' is loaded
holiday-other-holidays
'((holiday-float 10 1 2 "Canadian Thanksgiving")))
(use-package holidays
:custom
(holiday-other-holidays
'((holiday-float 10 1 2 "Canadian Thanksgiving"))))
The reason I guess my customization may be getting overwritten is that
when setting holiday-other-holidays using setopt, checking the value
of the calendar-holidays variable using describe-variable shows that
the current value of calendar-holidays does not include the Canadian
Thanksgiving, but under the "Original value was" section I see that
the entry for Canadian Thanksgiving was supposedly present.
In GNU Emacs 31.0.50 (build 39, x86_64-pc-linux-gnu, GTK+ Version
3.24.49, cairo version 1.18.4) of 2025-10-14 built on marita
Repository revision: 171c7fd6df861ab71f6cc8faedb8ff68bfac4bae
Repository branch: master
System Description: Debian GNU/Linux 13 (trixie)
Configured using:
'configure --prefix=/home/bandali/.local --without-compress-install
--without-gpm --with-pgtk --with-native-compilation'
Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GSETTINGS HARFBUZZ JPEG
LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 MODULES NATIVE_COMP NOTIFY
INOTIFY PDUMPER PGTK PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF
TOOLKIT_SCROLL_BARS TREE_SITTER WEBP XIM GTK3 ZLIB
Important settings:
value of $LC_COLLATE: C
value of $LANG: en_CA.UTF-8
locale-coding-system: utf-8-unix
Major mode: Group
Minor modes in effect:
gnus-topic-mode: t
gnus-undo-mode: t
server-mode: t
winner-mode: t
windmove-mode: t
pixel-scroll-mode: t
hyperbole-mode: t
recentf-mode: t
savehist-mode: t
save-place-mode: t
global-display-fill-column-indicator-mode: t
global-auto-revert-mode: t
auto-compile-on-load-mode: t
auto-compile-on-save-mode: t
vertico-mode: t
marginalia-mode: t
corfu-popupinfo-mode: t
global-corfu-mode: t
global-diff-hl-mode: t
minibuffer-depth-indicate-mode: t
tooltip-mode: t
global-eldoc-mode: t
eldoc-mode: t
show-paren-mode: t
electric-indent-mode: t
mouse-wheel-mode: t
file-name-shadow-mode: t
global-font-lock-mode: t
font-lock-mode: t
minibuffer-nonselected-mode: t
minibuffer-regexp-mode: t
buffer-read-only: t
column-number-mode: t
line-number-mode: t
transient-mark-mode: t
auto-composition-mode: t
auto-encryption-mode: t
auto-compression-mode: t
temp-buffer-resize-mode: t
Load-path shadows:
/home/bandali/.emacs.d/lisp/compat/compat hides /home/bandali/.local/share/emacs/31.0.50/lisp/emacs-lisp/compat
Features:
(shadow flyspell ispell help-fns emacsbug vertico-sort cursor-sensor
consult cal-china lunar solar cal-dst cal-bahai cal-islam cal-hebrew
holidays holiday-loaddefs diary-lib diary-loaddefs cal-move vc-git
smiley gnus-cite mail-extr textsec uni-scripts idna-mapping
ucs-normalize uni-confusable textsec-check gnus-async gnus-bcklg qp
gnus-ml gnus-topic nndraft nnmh utf-7 tramp-sh epa-file network-stream
nsm nnfolder nnnil gnus-agent gnus-srvr gnus-score score-mode
nnvirtual nntp gnus-cache eat term/xterm xterm term disp-table ehelp
battery hyperbole hinit hui-mouse hmouse-key imenu hsys-flymake
hui-menu hyrolo-menu hui-jmenu hibtypes hib-doc-id hyrolo finder-inf
sort reveal klink hib-kbd hib-debbugs hib-social hypb-ert ert debug
backtrace hynote hywiki ox-odt rng-loc rng-uri rng-parse rng-match
rng-dt rng-util rng-pttrn nxml-parse nxml-ns nxml-enc xmltok nxml-util
ox-latex ox-icalendar org-agenda ox-html table ox-ascii ox-publish ox
org-attach hui-mini hui hasht hsys-ert hmouse-tag hsys-xref
smerge-mode diff hactypes hsys-www eww vtable mule-util url-queue
mm-url hsys-org org-element org-persist org-id org-refile
org-element-ast inline avl-tree hsys-consult hsys-org-roam hargs etags
fileloop generator xref project hpath tramp-cache time-stamp tramp
trampver tramp-integration files-x tramp-message tramp-compat shell
tramp-loaddefs bookmark hmouse-sh kmacro hsettings hproperty hbut
hmouse-drv hui-window pulse hycontrol face-remap hycontrol-zmfrm
hui-select hbdata hgnus gnus-msg gnus-art mm-uu mml2015 mm-view
mml-smime smime gnutls dig gnus-sum shr pixel-fill kinsoku url-file
svg dom gnus-group gnus-undo gnus-start gnus-dbus dbus server winner
windmove delight preseed gnus-BTS deb-view tar-mode arc-mode
archive-mode apt-utils jka-compr apt-sources debian-el readme-debian
debian-copyright debian-control-mode debian-bts-control
debian-changelog-mode dpkg-dev-common-utils debian-bug dpkg-dev-el
pixel-scroll cua-base gnus-cloud nnimap nnmail mail-source utf7 nnoo
parse-time iso8601 gnus-spec gnus-int gnus-range gnus-win gnus-dired
gnus nnheader range hsmail message sendmail yank-media puny rfc822 mml
mml-sec epa derived epg rfc6068 epg-config gnus-util mm-decode
mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045 mm-util
ietf-drums mail-prsvr mailabbrev mail-utils gmm-utils mailheader hmail
htz cal-julian hbmap hmoccur hvar hypb package browse-url xdg url
url-proxy url-privacy url-expand url-methods url-history url-cookie
url-domsuf url-util mailcap url-handlers url-parse auth-source eieio
eieio-core cl-macs password-cache json map url-vars org ob ob-tangle
ob-ref ob-lob ob-table ob-exp org-macro org-src sh-script smie treesit
executable ob-comint org-pcomplete pcomplete org-list org-footnote
org-faces org-entities time-date noutline outline ob-emacs-lisp
ob-core ob-eval org-cycle org-table ol org-fold org-fold-core org-keys
oc org-loaddefs thingatpt find-func cal-menu calendar cal-loaddefs
org-version org-compat org-macs format-spec locate dired-x dired
dired-loaddefs hversion hload-path recentf tree-widget savehist
saveplace display-fill-column-indicator autorevert filenotify time xml
view compile text-property-search comint ansi-osc ansi-color
completion-preview auto-compile comp-run orderless vertico marginalia
corfu-popupinfo byte-opt corfu compat diff-hl log-view log-edit ring
add-log pcvs-util vc-dir ewoc vc vc-dispatcher diff-mode track-changes
easy-mmode doric-oak-theme doric-themes color mb-depth xelb-autoloads
wgrep-autoloads vertico-autoloads orderless-autoloads
marginalia-autoloads hyperbole-autoloads kotl-autoloads hact set hhist
exwm-autoloads elpher-autoloads eat-autoloads dpkg-dev-el-autoloads
doric-themes-autoloads diff-hl-autoloads delight-autoloads
debian-el-autoloads debbugs-autoloads csv-mode-autoloads
corfu-autoloads consult-autoloads compat-autoloads borg-autoloads
auto-compile-autoloads borg loaddefs-gen generate-lisp-file lisp-mnt
radix-tree pcase info comp cl-seq comp-cstr cl-extra help-mode
comp-common warnings subr-x rx gv bytecomp byte-compile cus-edit pp
cus-start cus-load icons wid-edit cl-loaddefs cl-lib rmc iso-transl
tooltip cconv eldoc paren electric uniquify ediff-hook vc-hooks
lisp-float-type elisp-mode mwheel term/pgtk-win pgtk-win
term/common-win touch-screen pgtk-dnd tool-bar dnd fontset image
regexp-opt fringe tabulated-list replace newcomment text-mode
lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch
easymenu timer select scroll-bar mouse jit-lock font-lock syntax
font-core term/tty-colors frame minibuffer nadvice seq simple
cl-generic indonesian philippine cham georgian utf-8-lang misc-lang
vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932
hebrew greek romanian slovak czech european ethiopic indian cyrillic
chinese composite emoji-zwj charscript charprop case-table epa-hook
jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button
loaddefs theme-loaddefs faces cus-face macroexp files window
text-properties overlay sha1 md5 base64 format env code-pages mule
custom widget keymap hashtable-print-readable backquote threads
dbusbind inotify dynamic-setting system-font-setting
font-render-setting cairo gtk pgtk lcms2 multi-tty move-toolbar
make-network-process tty-child-frames native-compile emacs)
Memory information:
((conses 16 733510 143620) (symbols 48 45207 0)
(strings 32 166742 16282) (string-bytes 1 5433703) (vectors 16 93391)
(vector-slots 8 1207973 49951) (floats 8 1121 1365)
(intervals 56 4303 956) (buffers 1064 31))
Information forwarded
to
bug-gnu-emacs <at> gnu.org:
bug#79629; Package
emacs.
(Thu, 16 Oct 2025 07:26:02 GMT)
Full text and
rfc822 format available.
Message #8 received at 79629 <at> debbugs.gnu.org (full text, mbox):
> From: Amin Bandali <bandali <at> gnu.org>
> Date: Tue, 14 Oct 2025 17:38:53 -0400
>
> I noticed that I'm unable to customize the holiday-other-holidays
> variable using the setopt macro: my change does not seem to take
> effect, or perhaps gets "overwritten" somehow.
>
> Currently, the following does not have the intended effect:
>
> (setopt
> holiday-other-holidays
> '((holiday-float 10 1 2 "Canadian Thanksgiving")))
>
> With the above in my user-init-file, if I do M-x calendar then
> move the cursor to Monday October 13 and press 'h', I do not see
> Canadian Thanksgiving as a holiday for that day.
>
> Whereas either of the following snippets work as expected:
>
> (setq ; before `holidays' is loaded
> holiday-other-holidays
> '((holiday-float 10 1 2 "Canadian Thanksgiving")))
>
> (use-package holidays
> :custom
> (holiday-other-holidays
> '((holiday-float 10 1 2 "Canadian Thanksgiving"))))
>
> The reason I guess my customization may be getting overwritten is that
> when setting holiday-other-holidays using setopt, checking the value
> of the calendar-holidays variable using describe-variable shows that
> the current value of calendar-holidays does not include the Canadian
> Thanksgiving, but under the "Original value was" section I see that
> the entry for Canadian Thanksgiving was supposedly present.
I think this is because customizing holiday-other-holidays does not
recompute the value of calendar-holidays, which is computed once, when
the package is loaded:
(defcustom calendar-holidays
(append holiday-general-holidays holiday-local-holidays
holiday-other-holidays holiday-christian-holidays
holiday-hebrew-holidays holiday-islamic-holidays
holiday-bahai-holidays holiday-oriental-holidays
holiday-solar-holidays)
There's a comment there which says:
;; This one should not be autoloaded, else .emacs changes of
;; holiday-general-holidays etc have no effect.
;; FIXME should have some :set-after.
So maybe this should have a :set-after function. Or maybe each one of
the defcustom's in the above list, used to compute calendar-holidays
should have a :set function which recomputes calendar-holidays.
Patches welcome.
Information forwarded
to
bug-gnu-emacs <at> gnu.org:
bug#79629; Package
emacs.
(Thu, 23 Oct 2025 20:30:02 GMT)
Full text and
rfc822 format available.
Message #11 received at 79629 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Eli Zaretskii wrote:
[...]
>
> I think this is because customizing holiday-other-holidays does not
> recompute the value of calendar-holidays, which is computed once, when
> the package is loaded:
>
> (defcustom calendar-holidays
> (append holiday-general-holidays holiday-local-holidays
> holiday-other-holidays holiday-christian-holidays
> holiday-hebrew-holidays holiday-islamic-holidays
> holiday-bahai-holidays holiday-oriental-holidays
> holiday-solar-holidays)
>
> There's a comment there which says:
>
> ;; This one should not be autoloaded, else .emacs changes of
> ;; holiday-general-holidays etc have no effect.
> ;; FIXME should have some :set-after.
>
> So maybe this should have a :set-after function. Or maybe each one of
> the defcustom's in the above list, used to compute calendar-holidays
> should have a :set function which recomputes calendar-holidays.
>
> Patches welcome.
Thanks, Eli; I think that's indeed it. How about the attached patch?
It seems to work as expected for me. It adds both :set-after and :set
(I didn't notice a difference with just :set-after).
Two things I wasn't sure about:
- I left the comment above calendar-holidays about not autoloading it,
since I wasn't sure whether or not with my changes we could autoload
that variable now without running into the issue described by the
comment.
- Should I add a ':version "31.1"' for calendar-holidays or is it not
necessary since its "value" isn't being changed by my patch?
Thanks.
[0001-Recompute-calendar-holidays-when-its-components-are-.patch (text/x-diff, attachment)]
Information forwarded
to
bug-gnu-emacs <at> gnu.org:
bug#79629; Package
emacs.
(Fri, 24 Oct 2025 06:45:02 GMT)
Full text and
rfc822 format available.
Message #14 received at 79629 <at> debbugs.gnu.org (full text, mbox):
> From: Amin Bandali <bandali <at> gnu.org>
> Cc: 79629 <at> debbugs.gnu.org
> Date: Thu, 23 Oct 2025 16:28:30 -0400
>
> Eli Zaretskii wrote:
>
> [...]
> >
> > I think this is because customizing holiday-other-holidays does not
> > recompute the value of calendar-holidays, which is computed once, when
> > the package is loaded:
> >
> > (defcustom calendar-holidays
> > (append holiday-general-holidays holiday-local-holidays
> > holiday-other-holidays holiday-christian-holidays
> > holiday-hebrew-holidays holiday-islamic-holidays
> > holiday-bahai-holidays holiday-oriental-holidays
> > holiday-solar-holidays)
> >
> > There's a comment there which says:
> >
> > ;; This one should not be autoloaded, else .emacs changes of
> > ;; holiday-general-holidays etc have no effect.
> > ;; FIXME should have some :set-after.
> >
> > So maybe this should have a :set-after function. Or maybe each one of
> > the defcustom's in the above list, used to compute calendar-holidays
> > should have a :set function which recomputes calendar-holidays.
> >
> > Patches welcome.
>
> Thanks, Eli; I think that's indeed it. How about the attached patch?
> It seems to work as expected for me. It adds both :set-after and :set
> (I didn't notice a difference with just :set-after).
>
> Two things I wasn't sure about:
>
> - I left the comment above calendar-holidays about not autoloading it,
> since I wasn't sure whether or not with my changes we could autoload
> that variable now without running into the issue described by the
> comment.
That comment is clearly from the days when people were using setq to
change user options, so I think it should be left alone.
> - Should I add a ':version "31.1"' for calendar-holidays or is it not
> necessary since its "value" isn't being changed by my patch?
If the value of the option doesn't change, there's no need to bump its
:version.
I'd ask Stefan to eyeball the patch and provide comments, since
user-option initialization has some black-art aspects I'm not sure I
know enough about.
Thanks.
Information forwarded
to
bug-gnu-emacs <at> gnu.org:
bug#79629; Package
emacs.
(Fri, 24 Oct 2025 13:32:01 GMT)
Full text and
rfc822 format available.
Message #17 received at 79629 <at> debbugs.gnu.org (full text, mbox):
Hi Amin,
> diff --git a/lisp/calendar/holidays.el b/lisp/calendar/holidays.el
> index 28f3a0ae7f2..50f56ce9d1f 100644
> --- a/lisp/calendar/holidays.el
> +++ b/lisp/calendar/holidays.el
> @@ -38,6 +38,20 @@ holidays
> :prefix "holidays-"
> :group 'local)
>
> +(defvar holidays--calendar-holidays
> + '( holiday-general-holidays holiday-local-holidays
> + holiday-other-holidays holiday-christian-holidays
> + holiday-hebrew-holidays holiday-islamic-holidays
> + holiday-bahai-holidays holiday-oriental-holidays
> + holiday-solar-holidays))
Shouldn't this be a `defconst`?
> +(defun holidays--calendar-holidays ()
> + (apply #'append (mapcar #'symbol-value holidays--calendar-holidays)))
> +
> +(defun holidays--set-calendar-holidays (sym val)
> + (set sym val)
> + (setq calendar-holidays (holidays--calendar-holidays)))
But this risks overwriting the user's customization of `calendar-holidays`.
Maybe you need to use `custom-reevaluate-setting` instead.
[ And I suspect that if you do that, you don't need
`holidays--calendar-holidays` any more. ]
Another option is to "demote" `calendar-holidays` from a defcustom to
a defvar.
> -;; FIXME should have some :set-after.
FWIW, I think `:set-after` is a hack that's never The Right Solution.
> -(defcustom calendar-holidays
> - (append holiday-general-holidays holiday-local-holidays
> - holiday-other-holidays holiday-christian-holidays
> - holiday-hebrew-holidays holiday-islamic-holidays
> - holiday-bahai-holidays holiday-oriental-holidays
> - holiday-solar-holidays)
> +(defcustom calendar-holidays (holidays--calendar-holidays)
> "List of notable days for the command \\[holidays].
>
> Additional holidays are easy to add to the list, just put them in the
> @@ -308,6 +324,7 @@ calendar-holidays
> with descriptive strings such as
>
> (((2 6 1989) \"New Moon\") ((2 12 1989) \"First Quarter Moon\") ... )."
> + :set-after holidays--calendar-holidays
> :type 'sexp)
The `:set` you've placed on those other variables should make the
`:set-after` useless.
Also, your patch should probably tweak the wording of the docstring
where it currently says:
They also initialize the default value of ‘calendar-holidays’,
which is the default list of holidays used by the function
‘holiday-list’ in the non-interactive case. Note that these
variables have no effect on ‘calendar-holidays’ after it has been
set (e.g. after the calendar is loaded). In that case, customize
‘calendar-holidays’ directly.
- Stefan
Information forwarded
to
bug-gnu-emacs <at> gnu.org:
bug#79629; Package
emacs.
(Fri, 24 Oct 2025 17:48:02 GMT)
Full text and
rfc822 format available.
Message #20 received at 79629 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Dear Eli, Stefan,
Thank you both for your helpful comments. I've updated and simplified
my patch accordingly, and I'm attaching the v2 here. If it looks good
to you I'll go ahead and install it on the master branch.
Thanks again,
amin
[v2-0001-Recompute-calendar-holidays-when-its-components-a.patch (text/x-diff, attachment)]
Information forwarded
to
bug-gnu-emacs <at> gnu.org:
bug#79629; Package
emacs.
(Fri, 24 Oct 2025 18:47:02 GMT)
Full text and
rfc822 format available.
Message #23 received at 79629 <at> debbugs.gnu.org (full text, mbox):
> Thank you both for your helpful comments. I've updated and simplified
> my patch accordingly, and I'm attaching the v2 here. If it looks good
> to you I'll go ahead and install it on the master branch.
Looks good to me.
BTW, a different approach would be to change (extend) the format of
`calendar-holidays` so it can contain entries that *refer* to the
other variables. This way, the value of this variable would not need to
change when those other vars are modified, and instead those other vars
would be consulted whenever `calendar-holidays` is used.
There's probably an opportunity to consolidate this with
`holiday-available-holiday-lists` which contains another "list" of
those same variables.
Stefan
Reply sent
to
Eli Zaretskii <eliz <at> gnu.org>:
You have taken responsibility.
(Sat, 25 Oct 2025 07:40:02 GMT)
Full text and
rfc822 format available.
Notification sent
to
Amin Bandali <bandali <at> gnu.org>:
bug acknowledged by developer.
(Sat, 25 Oct 2025 07:40:02 GMT)
Full text and
rfc822 format available.
Message #28 received at 79629-done <at> debbugs.gnu.org (full text, mbox):
> From: Amin Bandali <bandali <at> gnu.org>
> Cc: 79629 <at> debbugs.gnu.org
> Date: Fri, 24 Oct 2025 13:46:52 -0400
>
> Thank you both for your helpful comments. I've updated and simplified
> my patch accordingly, and I'm attaching the v2 here. If it looks good
> to you I'll go ahead and install it on the master branch.
Thanks, installed on the master branch, and closing the bug.
This bug report was last modified 12 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.