summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron Madlon-Kay <aaron@madlon-kay.com>2023-12-12 23:21:22 +0900
committerIhor Radchenko <yantar92@posteo.net>2023-12-12 16:09:31 +0100
commit1ec18b8ebcbfc6d3ad98535f80157307ccea911d (patch)
tree21d48abdce2c3f42edafc64497e9eecbeab0e055
parent74006c7ab2d730db162f79fef40afeeb0947a871 (diff)
downloadorg-mode-1ec18b8eb.tar.gz
lisp/org-entities.el: Fix safe value predicate for org-entities-user
* lisp/org-entities.el (org-entities--user-safe-p): Fix logic to validate a list of entries, rather than a single entry. Reported-by: "Aaron Madlon-Kay" <aaron@madlon-kay.com> Link: https://list.orgmode.org/874jgn7f7s.fsf@localhost/ TINYCHANGE
-rw-r--r--lisp/org-entities.el21
1 files changed, 13 insertions, 8 deletions
diff --git a/lisp/org-entities.el b/lisp/org-entities.el
index 6108302..195374e 100644
--- a/lisp/org-entities.el
+++ b/lisp/org-entities.el
@@ -41,14 +41,19 @@
(defun org-entities--user-safe-p (v)
"Non-nil if V is a safe value for `org-entities-user'."
- (pcase v
- (`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)))
+ (cond
+ ((not v) t)
+ ((listp v)
+ (seq-every-p
+ (lambda (e)
+ (pcase e
+ (`(,(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))))
(defcustom org-entities-user nil
"User-defined entities used in Org to produce special characters.