Browse Source

org-footnote: Improve :safe values

* lisp/org-footnote.el (org-footnote-auto-label):
(org-footnote-auto-adjust): Use simpler :safe value.

The point of the :safe value is to determine if the variable is safe,
not to check correctness of its value. Besides, lambda functions
appear as the following in *Help* buffer:

  This variable is safe as a file local variable if its value
  satisfies the predicate which is a byte-compiled expression.

which is not particularly clear.  Let's keep :safe values simple.
Nicolas Goaziou 1 year ago
parent
commit
dac180ea0d
1 changed files with 2 additions and 4 deletions
  1. 2 4
      lisp/org-footnote.el

+ 2 - 4
lisp/org-footnote.el

@@ -142,8 +142,7 @@ random	   Automatically generate a unique, random label."
 	  (const :tag "Create automatic [fn:N]" t)
 	  (const :tag "Offer automatic [fn:N] for editing" confirm)
 	  (const :tag "Create a random label" random))
-  :safe (lambda (x)
-	  (memq x '(nil t confirm random))))
+  :safe #'symbolp)
 
 (defcustom org-footnote-auto-adjust nil
   "Non-nil means automatically adjust footnotes after insert/delete.
@@ -162,8 +161,7 @@ The main values of this variable can be set with in-buffer options:
 	  (const :tag "Renumber" renumber)
 	  (const :tag "Sort" sort)
 	  (const :tag "Renumber and Sort" t))
-  :safe (lambda (x)
-	  (memq x '(nil renumber sort t))))
+  :safe #'symbolp)
 
 (defcustom org-footnote-fill-after-inline-note-extraction nil
   "Non-nil means fill paragraphs after extracting footnotes.