From 6cbbf4cdbf9685580b57ef664a5b5a902dca97e6 Mon Sep 17 00:00:00 2001 From: Ihor Radchenko Date: Wed, 8 Feb 2023 16:44:34 +0300 Subject: [PATCH] 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 Link: https://orgmode.org/list/950326F5-F72D-4F51-A946-F37E96971B08@stanford.edu --- lisp/ol.el | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/lisp/ol.el b/lisp/ol.el index 9ad191c8f..9e4781f6e 100644 --- a/lisp/ol.el +++ b/lisp/ol.el @@ -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."