From: Aaron Madlon-Kay <aaron@madlon-kay.com>
To: emacs-orgmode@gnu.org
Subject: [BUG] "Safe" local values for org-entities-user not recognized as such [9.6.11 (release_9.6.11 @ /Applications/MacPorts/Emacs.app/Contents/Resources/lisp/org/)]
Date: Tue, 12 Dec 2023 20:40:58 +0900 [thread overview]
Message-ID: <CE38D26C-DCF2-44ED-B469-49584B9FB070@madlon-kay.com> (raw)
Remember to cover the basics, that is, what you expected to happen and
what in fact did happen. You don't know how to make a good report? See
https://orgmode.org/manual/Feedback.html#Feedback
Your bug report will be posted to the Org mailing list.
------------------------------------------------------------------------
Local definitions for `org-entities-user` are not recognized as "safe"
even when they are in the correct format. For instance, including the
following local variables list in an org-mode file will still result in
Emacs prompting you to accept the value:
# Local Variables:
# org-entities-user: (("snowman" "[snowman]" nil "☃" "[snowman]" "[snowman]" "☃"))
# End:
Cause: The defcustom for `org-entities-user` has :safe set to the
function `org-entities--user-safe-p`. This function, however, appears to
be designed to validate a single entry of `org-entities-user`, rather
than the full value. Locally redefining as follows results in the
expected behavior:
(defun org-entities--user-safe-p (v)
"Non-nil if V is a safe value for `org-entities-user'."
(seq-every-p
(lambda (e) (pcase e
(`nil t)
(`(,(and (pred stringp)
(pred (string-match-p "\\`[a-zA-Z][a-zA-Z0-9]*\\'")))
,(pred stringp) ,(pred booleanp) ,(pred stringp)
,(pred stringp) ,(pred stringp) ,(pred stringp))
t)
(_ nil)))
v))
The difference is that the current logic has been supplied as a lambda
to `seq-every-p`.
Thank you,
Aaron
Emacs : GNU Emacs 30.0.50 (build 1, x86_64-apple-darwin23.1.0, NS appkit-2487.20 Version 14.1.1 (Build 23B81))
of 2023-11-26
Package: Org mode version 9.6.11 (release_9.6.11 @ /Applications/MacPorts/Emacs.app/Contents/Resources/lisp/org/)
next reply other threads:[~2023-12-12 11:42 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-12 11:40 Aaron Madlon-Kay [this message]
2023-12-12 12:01 ` [BUG] "Safe" local values for org-entities-user not recognized as such [9.6.11 (release_9.6.11 @ /Applications/MacPorts/Emacs.app/Contents/Resources/lisp/org/)] Aaron Madlon-Kay
2023-12-12 12:29 ` Aaron Madlon-Kay
2023-12-12 12:55 ` Ihor Radchenko
[not found] ` <98E48EEB-5E10-42ED-91D4-9369B6B98B20@madlon-kay.com>
[not found] ` <87y1dz5wxm.fsf@localhost>
2023-12-12 14:36 ` Aaron Madlon-Kay
2023-12-12 15:18 ` 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=CE38D26C-DCF2-44ED-B469-49584B9FB070@madlon-kay.com \
--to=aaron@madlon-kay.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).