org-link-abbrev-alist: Fix :safe predicate

* lisp/ol.el (org-link-abbrev-alist): Check every element in the
alist when considering :safe values.

Reported-by: Qiantan Hong <qthong@stanford.edu>
Link: https://orgmode.org/list/950326F5-F72D-4F51-A946-F37E96971B08@stanford.edu
This commit is contained in:
Ihor Radchenko 2023-02-08 16:44:34 +03:00
parent c8a5fef910
commit 6cbbf4cdbf
No known key found for this signature in database
GPG Key ID: 6470762A7DA11D8B
1 changed files with 8 additions and 4 deletions

View File

@ -274,10 +274,14 @@ See the manual for examples."
(choice
(string :tag "Format")
(function))))
:safe (lambda (val)
(pcase val
(`(,(pred stringp) . ,(pred stringp)) t)
(_ nil))))
:safe (lambda (alist)
(when (listp alist)
(catch :unsafe
(dolist (val alist)
(pcase val
(`(,(pred stringp) . ,(pred stringp)) t)
(_ (throw :unsafe nil))))
t))))
(defgroup org-link-follow nil
"Options concerning following links in Org mode."