diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index 72953502f51..29e7882c851 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el @@ -5472,7 +5472,7 @@ FORM is used to provide location, `bytecomp--cus-function' and ;; Check :local (when-let ((val (and (eq fun 'custom-declare-variable) (plist-get keyword-args :local))) - (_ (not (memq val '(t permanent permanent-only))))) + (_ (not (member val '(t 'permanent 'permanent-only))))) (bytecomp--cus-warn form ":local keyword does not accept %S" val)))) (byte-compile-normal-call form)) diff --git a/test/lisp/emacs-lisp/bytecomp-tests.el b/test/lisp/emacs-lisp/bytecomp-tests.el index 69918e9c0c3..caece633459 100644 --- a/test/lisp/emacs-lisp/bytecomp-tests.el +++ b/test/lisp/emacs-lisp/bytecomp-tests.el @@ -1991,6 +1991,9 @@ EXPECTED-POINT BINDINGS (MODES \\='\\='(ruby-mode js-mode python-mode)) \ (rx ":local keyword does not accept 'symbol") (dc 'symbol)) (bytecomp--with-warning-test (rx ":local keyword does not accept \"string\"") (dc "string")) + (bytecomp--without-warning-test (dc t)) + (bytecomp--without-warning-test (dc 'permanent)) + (bytecomp--without-warning-test (dc 'permanent-only)) )) (ert-deftest bytecomp-test-defface-spec ()