GNU bug report logs - #78967
30.1; calendar: add a way to permanent disable diary auto marking

Previous Next

Package: emacs;

Reported by: pinmacs <pinmacs <at> cas.cat>

Date: Sun, 6 Jul 2025 17:31:03 UTC

Severity: normal

Found in version 30.1

To reply to this bug, email your comments to 78967 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#78967; Package emacs. (Sun, 06 Jul 2025 17:31:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to pinmacs <pinmacs <at> cas.cat>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sun, 06 Jul 2025 17:31:04 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: pinmacs <pinmacs <at> cas.cat>
To: bug-gnu-emacs <at> gnu.org
Subject: 30.1; calendar: add a way to permanent disable diary auto marking
Date: Sun, 6 Jul 2025 14:14:33 +0200
This bug report is related to what I described in [0]

I think is a bad practice that functions `diary-mark-entries' and 
`calendar-unmark' change the global variable
without warning the user [1]. I think this functions should have a 
local-scoped vars so it only affects the current render

Meanwhile, I will do this [2]

Text generated with `report-emacs-bug' here [3]

[0] https://lists.gnu.org/archive/html/emacs-devel/2025-07/msg00089.html

[1] 
https://www.gnu.org/software/emacs/manual/html_node/emacs/Displaying-the-Diary.html

[2]
(defun my/disable-diary-auto-marking (&rest _)
  "Turn off automatic diary‐entry marking when exiting the calendar."
  (setq calendar-mark-diary-entries-flag nil))

(advice-add 'calendar-exit :after #'my/disable-diary-auto-marking)

[3]

In GNU Emacs 30.1 (build 3, x86_64-pc-linux-gnu, X toolkit, cairo
version 1.16.0, Xaw3d scroll bars) of 2025-05-04 built on host1.local
Windowing system distributor 'The X.Org Foundation', version 11.0.12101007
System Description: Debian GNU/Linux 12 (bookworm)

Configured using:
'configure --with-native-compilation --with-native-compilation=aot
--with-x-toolkit=lucid'

Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG
LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 M17N_FLT MODULES NATIVE_COMP
NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF
TOOLKIT_SCROLL_BARS WEBP X11 XAW3D XDBE XIM XINPUT2 XPM LUCID ZLIB

Important settings:
value of $LANG: en_US.UTF-8
value of $XMODIFIERS:
locale-coding-system: utf-8-unix

Major mode: Org

Minor modes in effect:
xterm-mouse-mode: t
global-hl-todo-mode: t
org-media-note-mode: t
olivetti-mode: t
buffer-face-mode: t
delete-selection-mode: t
corfu-history-mode: t
corfu-popupinfo-mode: t
global-corfu-mode: t
corfu-mode: t
global-clipetty-mode: t
clipetty-mode: t
gcmh-mode: t
which-key-mode: t
term-title-mode: t
popper-tab-line-mode: t
popper-mode: t
winner-mode: t
repeat-mode: t
global-tab-line-mode: t
tab-line-mode: t
save-place-mode: t
recentf-mode: t
electric-pair-mode: t
edraw-org-link-image-mode: t
global-whitespace-mode: t
whitespace-mode: t
global-git-commit-mode: t
magit-auto-revert-mode: t
global-auto-revert-mode: t
server-mode: t
global-so-long-mode: t
xclip-mode: t
global-tree-sitter-mode: t
global-undo-tree-mode: t
undo-tree-mode: t
ultra-scroll-mode: t
pixel-scroll-precision-mode: t
override-global-mode: t
nerd-icons-completion-mode: t
marginalia-mode: t
savehist-mode: t
vertico-multiform-mode: t
vertico-mode: t
editorconfig-mode: t
tooltip-mode: t
global-eldoc-mode: t
show-paren-mode: t
mouse-wheel-mode: t
tab-bar-mode: t
menu-bar-mode: t
file-name-shadow-mode: t
global-font-lock-mode: t
font-lock-mode: t
minibuffer-regexp-mode: t
column-number-mode: t
line-number-mode: t
visual-line-mode: t
transient-mark-mode: t
auto-composition-mode: t
auto-encryption-mode: t
auto-compression-mode: t

Load-path shadows:
/home/music/.emacs.d/elpa/transient-20241205.1436/transient hides 
/usr/local/share/emacs/30.1/lisp/transient
/home/music/.emacs.d/elpa/modus-themes-20241228.1050/theme-loaddefs 
hides /usr/local/share/emacs/30.1/lisp/theme-loaddefs

Features:
(shadow sort mail-extr emacsbug tramp-cmds cal-coptic cal-x tramp-cache
time-stamp shortdoc cal-move xt-mouse vterm term ehelp vterm-module
term/xterm xterm hl-todo misearch multi-isearch appt vc-git go-mode
find-file ffap etags fileloop org-media-note org-media-note-core mpv tq
org-timer olivetti face-remap oc-basic ol-eww eww url-queue mm-url
ol-rmail ol-mhe ol-irc ol-info ol-gnus nnselect gnus-art mm-uu mml2015
gnus-sum shr pixel-fill kinsoku url-file svg gnus-group gnus-undo
gnus-start gnus-dbus gnus-cloud nnimap nnmail mail-source utf7 nnoo
gnus-spec gnus-int gnus-range gnus-win gnus nnheader range ol-docview
doc-view jka-compr image-mode exif ol-bibtex bibtex ol-bbdb ol-w3m
ol-doi org-link-doi delsel corfu-history corfu-popupinfo
nerd-icons-corfu corfu clipetty gcmh memory-usage explain-pause-mode
explain-pause-top explain-pause-log-to-socket profiler ol-notmuch
which-key pass password-store auth-source-pass whisper deadgrep spinner
term-title popper-echo popper winner repeat tab-line org-collector
org-contrib clocktable-by-tag markdown-mode color org-tempo tempo
org-sticky-header org-transclusion org-transclusion-font-lock
org-transclusion-src-lines text-clone pretty-hydra quelpa-use-package
quelpa help-fns radix-tree org-kanban re-builder cal-iso org-protocol
org-ql-search org-ql-view ov org-super-agenda ht f org-ql peg ts
org-duration ob-js ob-python python ob-shell ob-C dockerfile-mode
yaml-mode ob-mermaid mermaid-mode ob-php json-mode json-snatcher js
c-ts-common cc-mode cc-fonts cc-guess cc-menus cc-cmds cc-styles
cc-align cc-engine cc-vars cc-defs ob-go lua-mode ob-typescript
ob-lilypond ess lisp-mnt ess-utils ess-custom gnuplot info-look async
ob-async org-clock dbus xml ox-extra ox-gfm ox-md 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 ox-html table ox-ascii
ox-publish ox org-attach engrave-faces calfw-blocks calfw-org
org-capture calfw holidays holiday-loaddefs cl org-habit org-agenda
let-alist saveplace tramp-sh tramp trampver tramp-integration
tramp-message tramp-compat parse-time iso8601 tramp-loaddefs recentf
tree-widget elec-pair edraw-org edraw-util edraw-msg cl-print
org-element org-persist xdg org-id org-refile org-element-ast inline
avl-tree org-crypt multiple-cursors mc-separate-operations
rectangular-region-mode mc-mark-pop mc-edit-lines
mc-hide-unmatched-lines-mode mc-mark-more sgml-mode facemenu dom
mc-cycle-cursors multiple-cursors-core ledger-mode ledger-check
ledger-texi ledger-test ledger-sort ledger-report ledger-reconcile
ledger-occur ledger-fonts ledger-fontify ledger-state ledger-complete
ledger-schedule ledger-xact ledger-post ledger-exec ledger-init
ledger-navigate eshell esh-cmd generator esh-ext esh-opt esh-proc esh-io
esh-arg esh-module esh-module-loaddefs esh-util files-x ledger-context
ledger-commodities ledger-regex visual-regexp paredit disk-usage
disp-table whitespace dumb-jump popup xref project ts-fold
ts-fold-summary ts-fold-parsers ts-fold-util mule-util s orgit 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 org-list org-footnote
org-faces org-entities noutline outline ob-emacs-lisp ob-core ob-eval
org-cycle org-table ol org-fold org-fold-core org-keys oc org-loaddefs
advice find-func org-version org-compat org-macs diff-hl log-view vc-dir
ewoc vc vc-dispatcher magit-bookmark magit-submodule magit-blame
magit-stash magit-reflog magit-bisect magit-push magit-pull magit-fetch
magit-clone magit-remote magit-commit magit-sequence magit-notes
magit-worktree magit-tag magit-merge magit-branch magit-reset
magit-files magit-refs magit-status magit magit-repos magit-apply
magit-wip magit-log which-func imenu magit-diff git-commit log-edit
pcvs-util add-log magit-core magit-autorevert autorevert filenotify
magit-margin magit-transient magit-process with-editor shell pcomplete
server magit-mode transient benchmark magit-git magit-base magit-section
cursor-sensor dash so-long vdiff smerge-mode hydra lv xclip
tree-sitter-langs tree-sitter-langs-build tar-mode arc-mode archive-mode
tree-sitter-hl tree-sitter tree-sitter-load tree-sitter-cli tsc tsc-dyn
tsc-dyn-get compile comint ansi-osc ansi-color dired-aux tsc-obsolete
evil evil-keybindings evil-integration evil-maps evil-commands reveal
evil-jumps evil-command-window evil-types evil-search evil-ex
evil-macros evil-repeat evil-states evil-core comp comp-cstr warnings
comp-run comp-common evil-common rect evil-vars undo-tree diff queue
ibuf-macs ibuffer ibuffer-loaddefs modus-operandi-tinted-theme
cal-julian solar cal-dst modus-themes ultra-scroll pixel-scroll cua-base
ring consult-recoll consult-notmuch notmuch notmuch-tree notmuch-jump
notmuch-hello wid-edit notmuch-show notmuch-print notmuch-crypto
notmuch-mua notmuch-message notmuch-draft notmuch-maildir-fcc
notmuch-address notmuch-company notmuch-parser format-spec notmuch-wash
diff-mode track-changes coolj goto-addr thingatpt icalendar diary-lib
diary-loaddefs cal-menu calendar cal-loaddefs notmuch-tag crm
notmuch-lib notmuch-compat hl-line message sendmail yank-media dired
dired-loaddefs rfc822 mml mailabbrev mail-utils gmm-utils mailheader
mm-view mml-smime mml-sec epa derived epg rfc6068 epg-config gnus-util
time-date smime gnutls puny dig mm-decode mm-bodies mm-encode mail-parse
rfc2231 rfc2047 rfc2045 mm-util ietf-drums mail-prsvr consult bookmark
text-property-search pp cape edmacro kmacro use-package-bind-key
bind-key easy-mmode nerd-icons-completion marginalia orderless savehist
vertico-multiform vertico compat nerd-icons nerd-icons-faces
nerd-icons-data nerd-icons-data-mdicon nerd-icons-data-flicon
nerd-icons-data-codicon nerd-icons-data-devicon nerd-icons-data-sucicon
nerd-icons-data-wicon nerd-icons-data-faicon nerd-icons-data-powerline
nerd-icons-data-octicon nerd-icons-data-pomicon nerd-icons-data-ipsicon
exec-path-from-shell use-package-ensure use-package-core editorconfig
editorconfig-core editorconfig-core-handle editorconfig-fnmatch
arduino-mode-autoloads cl-extra help-mode ede/auto eieio-base
calfw-autoloads calfw-blocks-autoloads calfw-org-autoloads
cape-autoloads clipetty-autoloads clocktable-by-tag-autoloads
consult-notmuch-autoloads consult-recoll-autoloads corfu-autoloads
dap-mode-autoloads bui-autoloads deadgrep-autoloads diff-hl-autoloads
dired-subtree-autoloads dired-hacks-utils-autoloads disk-usage-autoloads
dockerfile-mode-autoloads dumb-jump-autoloads edraw-org-autoloads
embark-consult-autoloads consult-autoloads embark-autoloads
engrave-faces-autoloads ess-autoloads esup-autoloads
evil-collection-autoloads annalist-autoloads evil-autoloads
exec-path-from-shell-autoloads explain-pause-mode-autoloads
gcmh-autoloads gnuplot-autoloads go-mode-autoloads goto-chg-autoloads
haskell-mode-autoloads hl-todo-autoloads hledger-mode-autoloads
hyperbole-autoloads kotl-autoloads hact set hhist jinx-autoloads
json-mode-autoloads rx json-snatcher-autoloads ledger-mode-autoloads
lsp-docker-autoloads lsp-treemacs-autoloads lsp-mode-autoloads
lua-mode-autoloads marginalia-autoloads markdown-mode-autoloads
memory-usage-autoloads mermaid-mode-autoloads mixed-pitch-autoloads
modus-themes-autoloads multiple-cursors-autoloads
nerd-icons-completion-autoloads nerd-icons-corfu-autoloads
nerd-icons-dired-autoloads nerd-icons-autoloads ob-async-autoloads
async-autoloads ob-go-autoloads ob-mermaid-autoloads ob-php-autoloads
ob-typescript-autoloads ol-notmuch-autoloads notmuch-autoloads
olivetti-autoloads orderless-autoloads org-contrib-autoloads
org-kanban-autoloads org-media-note-autoloads mpv-autoloads
org-ql-autoloads org-ref-autoloads citeproc-autoloads
bibtex-completion-autoloads biblio-autoloads biblio-core-autoloads
htmlize-autoloads org-sticky-header-autoloads org-super-agenda-autoloads
org-transclusion-autoloads orgit-autoloads magit-autoloads pcase
magit-section-autoloads ov-autoloads ox-gfm-autoloads
ox-pandoc-autoloads paredit-autoloads parsebib-autoloads pass-autoloads
f-autoloads password-store-otp-autoloads password-store-autoloads
php-mode-autoloads popper-autoloads popup-autoloads
pretty-hydra-autoloads quelpa-use-package-autoloads quelpa-autoloads
repeat-help-autoloads request-autoloads solidity-mode-autoloads
spinner-autoloads string-inflection-autoloads term-keys-autoloads
term-title-autoloads finder-inf transient-autoloads trashed-autoloads
tree-sitter-langs-autoloads treemacs-autoloads cfrs-autoloads
posframe-autoloads ht-autoloads pfuture-autoloads ace-window-autoloads
avy-autoloads ts-autoloads ts-fold-autoloads fringe-helper-autoloads
s-autoloads tree-sitter-autoloads tsc-autoloads
typescript-mode-autoloads ultra-scroll-autoloads undo-tree-autoloads
queue-autoloads vdiff-autoloads hydra-autoloads lv-autoloads
vertico-autoloads visual-regexp-autoloads vterm-autoloads
with-editor-autoloads xclip-autoloads xeft-autoloads yaml-autoloads
yaml-mode-autoloads yequake-autoloads info dash-autoloads package
browse-url url url-proxy url-privacy url-expand url-methods url-history
url-cookie generate-lisp-file url-domsuf url-util mailcap url-handlers
url-parse auth-source cl-seq eieio eieio-core cl-macs icons
password-cache json subr-x map byte-opt gv bytecomp byte-compile
url-vars cl-loaddefs cl-lib rmc iso-transl tooltip cconv eldoc paren
electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel
term/x-win x-win term/common-win x-dnd touch-screen 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 lcms2
dynamic-setting system-font-setting font-render-setting cairo x-toolkit
xinput2 x multi-tty move-toolbar make-network-process native-compile
emacs)

Memory information:
((conses 16 2329269 1788640) (symbols 48 63342 256)
(strings 32 290511 108056) (string-bytes 1 9297609)
(vectors 16 262499) (vector-slots 8 3749421 2259843)
(floats 8 2085 7717) (intervals 56 13809 3296) (buffers 984 41))




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#78967; Package emacs. (Mon, 07 Jul 2025 11:47:02 GMT) Full text and rfc822 format available.

Message #8 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Manuel Giraud <manuel <at> ledu-giraud.fr>
To: pinmacs via "Bug reports for GNU Emacs, the Swiss army knife of text
 editors" <bug-gnu-emacs <at> gnu.org>
Cc: 78967 <at> debbugs.gnu.org, pinmacs <pinmacs <at> cas.cat>
Subject: Re: bug#78967: 30.1; calendar: add a way to permanent disable diary
 auto marking
Date: Mon, 07 Jul 2025 13:46:30 +0200
pinmacs via "Bug reports for GNU Emacs, the Swiss army knife of text
editors" <bug-gnu-emacs <at> gnu.org> writes:

> This bug report is related to what I described in [0]
>
> I think is a bad practice that functions `diary-mark-entries' and
> `calendar-unmark' change the global variable
> without warning the user [1]. I think this functions should have a
> local-scoped vars so it only affects the current render

So I'd like to try this one but I guess I need some input from more
experienced emacsers.

I have tried to replace `calendar-mark-diary-entries-flag' setting with
a setq-local but it does not always work as it should.

So what is the "canonical" way of doing this: have a global custom (for
user's preference) and a local/temporary custom (that is initialized
with the global one) and that can be toggle interactively?
-- 
Manuel Giraud




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#78967; Package emacs. (Mon, 07 Jul 2025 11:47:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#78967; Package emacs. (Mon, 07 Jul 2025 14:25:01 GMT) Full text and rfc822 format available.

Message #14 received at 78967 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Manuel Giraud <manuel <at> ledu-giraud.fr>
Cc: 78967 <at> debbugs.gnu.org, pinmacs <at> cas.cat
Subject: Re: bug#78967: 30.1;
 calendar: add a way to permanent disable diary auto marking
Date: Mon, 07 Jul 2025 17:24:45 +0300
> Cc: pinmacs <at> cas.cat
> From: Manuel Giraud <manuel <at> ledu-giraud.fr>
> Date: Mon, 07 Jul 2025 13:46:30 +0200
> 
> pinmacs via "Bug reports for GNU Emacs, the Swiss army knife of text
> editors" <bug-gnu-emacs <at> gnu.org> writes:
> 
> > This bug report is related to what I described in [0]
> >
> > I think is a bad practice that functions `diary-mark-entries' and
> > `calendar-unmark' change the global variable
> > without warning the user [1]. I think this functions should have a
> > local-scoped vars so it only affects the current render
> 
> So I'd like to try this one but I guess I need some input from more
> experienced emacsers.
> 
> I have tried to replace `calendar-mark-diary-entries-flag' setting with
> a setq-local but it does not always work as it should.
> 
> So what is the "canonical" way of doing this: have a global custom (for
> user's preference) and a local/temporary custom (that is initialized
> with the global one) and that can be toggle interactively?

Could you please explain the problem you are trying to fix?

If the problem is that the code changes the value of a user option,
then the usual solution is to have a (perhaps buffer-local) variable
whose value is initialized from the user option.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#78967; Package emacs. (Mon, 07 Jul 2025 19:12:02 GMT) Full text and rfc822 format available.

Message #17 received at 78967 <at> debbugs.gnu.org (full text, mbox):

From: Manuel Giraud <manuel <at> ledu-giraud.fr>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 78967 <at> debbugs.gnu.org, pinmacs <at> cas.cat
Subject: Re: bug#78967: 30.1; calendar: add a way to permanent disable diary
 auto marking
Date: Mon, 07 Jul 2025 21:11:49 +0200
Eli Zaretskii <eliz <at> gnu.org> writes:

>> Cc: pinmacs <at> cas.cat
>> From: Manuel Giraud <manuel <at> ledu-giraud.fr>
>> Date: Mon, 07 Jul 2025 13:46:30 +0200
>> 
>> pinmacs via "Bug reports for GNU Emacs, the Swiss army knife of text
>> editors" <bug-gnu-emacs <at> gnu.org> writes:
>> 
>> > This bug report is related to what I described in [0]
>> >
>> > I think is a bad practice that functions `diary-mark-entries' and
>> > `calendar-unmark' change the global variable
>> > without warning the user [1]. I think this functions should have a
>> > local-scoped vars so it only affects the current render
>> 
>> So I'd like to try this one but I guess I need some input from more
>> experienced emacsers.
>> 
>> I have tried to replace `calendar-mark-diary-entries-flag' setting with
>> a setq-local but it does not always work as it should.
>> 
>> So what is the "canonical" way of doing this: have a global custom (for
>> user's preference) and a local/temporary custom (that is initialized
>> with the global one) and that can be toggle interactively?
>
> Could you please explain the problem you are trying to fix?

The issue (as pinmacs explained) is that when you toggle diary marking
on/off with 'm' or 'u' in the *Calendar* buffer, its value will stay the
same even if you quit the calendar or kill its buffer which seems
counter-intuitive.

> If the problem is that the code changes the value of a user option,
> then the usual solution is to have a (perhaps buffer-local) variable
> whose value is initialized from the user option.

Yes that's it: this code tests and modifies the user option directly.
Thanks, I'll try to do this then.
-- 
Manuel Giraud




This bug report was last modified today.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.