1
0
mirror of https://git.savannah.gnu.org/git/emacs/org-mode.git synced 2024-11-23 07:18:53 +00:00

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 <eliz@gnu.org>
Link: https://yhetil.org/emacs-devel/868qzd9hjg.fsf@gnu.org/
This commit is contained in:
Ihor Radchenko 2024-06-13 14:53:03 +02:00
parent 4bb0719374
commit bd8b861ee9
No known key found for this signature in database
GPG Key ID: 6470762A7DA11D8B
2 changed files with 12 additions and 1 deletions

View File

@ -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

View File

@ -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