Specify defcustom safety

This commit is contained in:
TEC 2023-07-07 01:25:51 +08:00
parent 49cc8b5851
commit 9575e6ac13
Signed by: tec
SSH Key Fingerprint: SHA256:eobz41Mnm0/iYWBvWThftS0ElEs1ftBr6jamutnXc/A
1 changed files with 9 additions and 4 deletions

View File

@ -58,20 +58,25 @@
:value-type sexp))) :value-type sexp)))
(defcustom simple-comment-markup-set '(org url) (defcustom simple-comment-markup-set '(org url)
"docstring" "The markup pattern sets to use (see `simple-comment-markup-patterns')."
:type '(choice symbol (repeat symbol))) :type '(choice symbol (repeat symbol))
:safe (lambda (value)
(and (listp value)
(null (delq t (mapcar #'symbolp value))))))
(defcustom simple-comment-markup-pre-rx (defcustom simple-comment-markup-pre-rx
(rx (any space ?- ?\( ?' ?\" ?\{)) (rx (any space ?- ?\( ?' ?\" ?\{))
"Regexp that must occur immediately before a markup pattern. "Regexp that must occur immediately before a markup pattern.
This must not include any capturing groups." This must not include any capturing groups."
:type 'regexp) :type 'regexp
:safe #'stringp)
(defcustom simple-comment-markup-post-rx (defcustom simple-comment-markup-post-rx
(rx (or (any space ?- ?. ?, ?\; ?: ?! ?? ?' ?\" ?\) ?\} ?\\ ?\[) line-end)) (rx (or (any space ?- ?. ?, ?\; ?: ?! ?? ?' ?\" ?\) ?\} ?\\ ?\[) line-end))
"Regexp that must occur immediately after a markup pattern. "Regexp that must occur immediately after a markup pattern.
This must not include any capturing groups." This must not include any capturing groups."
:type 'regexp) :type 'regexp
:safe #'stringp)
(defface simple-comment-markup-face (defface simple-comment-markup-face
'((t :inherit shadow)) '((t :inherit shadow))