From 9575e6ac13d693be1f545b5c341d3a235944e3fa Mon Sep 17 00:00:00 2001 From: TEC Date: Fri, 7 Jul 2023 01:25:51 +0800 Subject: [PATCH] Specify defcustom safety --- simple-comment-markup.el | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/simple-comment-markup.el b/simple-comment-markup.el index 9f51da0..6482f6b 100644 --- a/simple-comment-markup.el +++ b/simple-comment-markup.el @@ -58,20 +58,25 @@ :value-type sexp))) (defcustom simple-comment-markup-set '(org url) - "docstring" - :type '(choice symbol (repeat symbol))) + "The markup pattern sets to use (see `simple-comment-markup-patterns')." + :type '(choice symbol (repeat symbol)) + :safe (lambda (value) + (and (listp value) + (null (delq t (mapcar #'symbolp value)))))) (defcustom simple-comment-markup-pre-rx (rx (any space ?- ?\( ?' ?\" ?\{)) "Regexp that must occur immediately before a markup pattern. This must not include any capturing groups." - :type 'regexp) + :type 'regexp + :safe #'stringp) (defcustom simple-comment-markup-post-rx (rx (or (any space ?- ?. ?, ?\; ?: ?! ?? ?' ?\" ?\) ?\} ?\\ ?\[) line-end)) "Regexp that must occur immediately after a markup pattern. This must not include any capturing groups." - :type 'regexp) + :type 'regexp + :safe #'stringp) (defface simple-comment-markup-face '((t :inherit shadow))