From 6459baa54c05ce6bef1fa0207aed471992df6be0 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Wed, 2 Oct 2024 11:53:30 +0200 Subject: [PATCH] ; Fix thinko in my last change * lisp/emacs-lisp/bytecomp.el (bytecomp--custom-declare): Fix thinko. * test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-test-defcustom-local): Update test. (cherry picked from commit 67e807d897077b7c982104b528e2504591214a29) --- lisp/emacs-lisp/bytecomp.el | 2 +- test/lisp/emacs-lisp/bytecomp-tests.el | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index 48a473cd375..c510c418d57 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el @@ -5480,7 +5480,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 () -- 2.39.2