branch: externals-release/org commit bd8b861ee99a1d7621221df1d1470eb967874e2d Author: Ihor Radchenko <yanta...@posteo.net> Commit: Ihor Radchenko <yanta...@posteo.net>
org-num-skip-tags: Avoid using function that is not pre-loaded in autoloads * lisp/org-num.el (org-num-skip-tags): Make sure that function used for :safe `defcustom' slot does not require functions that are not defined in org-loaddefs.el. This is because `org-num-skip-tags' is autoloaded and cannot rely upon requires in org-num.el. Instead, it may only use pre-loaded functions and other autoloaded Org mode functions. Reported-by: Eli Zaretskii <e...@gnu.org> Link: https://yhetil.org/emacs-devel/868qzd9hjg....@gnu.org/ --- lisp/org-compat.el | 11 +++++++++++ lisp/org-num.el | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/lisp/org-compat.el b/lisp/org-compat.el index d6620f9627..41c26ad72f 100644 --- a/lisp/org-compat.el +++ b/lisp/org-compat.el @@ -251,6 +251,17 @@ removed." default))) ": "))) +(if (fboundp 'list-of-strings-p) + (defalias 'org-list-of-strings-p #'list-of-strings-p) + ;; From Emacs subr.el. +;;;###autoload + (defun org-list-of-strings-p (object) + "Return t if OBJECT is nil or a list of strings." + (declare (pure t) (side-effect-free error-free)) + (while (and (consp object) (stringp (car object))) + (setq object (cdr object))) + (null object))) + ;;; Emacs < 27.1 compatibility diff --git a/lisp/org-num.el b/lisp/org-num.el index aebfef0507..a8fcf33336 100644 --- a/lisp/org-num.el +++ b/lisp/org-num.el @@ -144,7 +144,7 @@ control tag inheritance." :group 'org-appearance :package-version '(Org . "9.3") :type '(repeat (string :tag "Tag")) - :safe (lambda (val) (and (listp val) (cl-every #'stringp val)))) + :safe #'org-list-of-strings-p) ;;;###autoload (defcustom org-num-skip-unnumbered nil