aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorMattias EngdegÄrd2023-05-13 13:49:07 +0200
committerMattias EngdegÄrd2023-05-13 14:30:59 +0200
commit9f856e4cd095c24cf4e6cadbc04efaf533e59f37 (patch)
treee12e307dddab95b24fc8ad2de68b244ea5b0be71 /lisp
parentc083fa5cf80f711ac43dca1b6582aff1ad526e8e (diff)
downloademacs-9f856e4cd095c24cf4e6cadbc04efaf533e59f37.tar.gz
emacs-9f856e4cd095c24cf4e6cadbc04efaf533e59f37.zip
Use `mutate-constant` as warning identifier
* etc/NEWS: * lisp/emacs-lisp/byte-run.el (with-suppressed-warnings): * lisp/emacs-lisp/bytecomp.el (byte-compile-warnings) (byte-compile-form): * test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-test--with-suppressed-warnings): Use the new warning name `mutate-constant` instead of using the somewhat overloaded `suspicious`.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/emacs-lisp/byte-run.el2
-rw-r--r--lisp/emacs-lisp/bytecomp.el4
2 files changed, 4 insertions, 2 deletions
diff --git a/lisp/emacs-lisp/byte-run.el b/lisp/emacs-lisp/byte-run.el
index 5b415c5e1f4..a377ec395e1 100644
--- a/lisp/emacs-lisp/byte-run.el
+++ b/lisp/emacs-lisp/byte-run.el
@@ -658,7 +658,7 @@ in `byte-compile-warning-types'; see the variable
658types. The types that can be suppressed with this macro are 658types. The types that can be suppressed with this macro are
659`free-vars', `callargs', `redefine', `obsolete', 659`free-vars', `callargs', `redefine', `obsolete',
660`interactive-only', `lexical', `ignored-return-value', `constants', 660`interactive-only', `lexical', `ignored-return-value', `constants',
661`suspicious' and `empty-body'." 661`suspicious', `empty-body' and `mutate-constant'."
662 ;; Note: during compilation, this definition is overridden by the one in 662 ;; Note: during compilation, this definition is overridden by the one in
663 ;; byte-compile-initial-macro-environment. 663 ;; byte-compile-initial-macro-environment.
664 (declare (debug (sexp body)) (indent 1)) 664 (declare (debug (sexp body)) (indent 1))
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el
index d17f1c93a76..a192d599d1d 100644
--- a/lisp/emacs-lisp/bytecomp.el
+++ b/lisp/emacs-lisp/bytecomp.el
@@ -330,6 +330,8 @@ Elements of the list may be:
330 This depends on the `docstrings' warning type. 330 This depends on the `docstrings' warning type.
331 suspicious constructs that usually don't do what the coder wanted. 331 suspicious constructs that usually don't do what the coder wanted.
332 empty-body body argument to a special form or macro is empty. 332 empty-body body argument to a special form or macro is empty.
333 mutate-constant
334 code that mutates program constants such as quoted lists
333 335
334If the list begins with `not', then the remaining elements specify warnings to 336If the list begins with `not', then the remaining elements specify warnings to
335suppress. For example, (not free-vars) will suppress the `free-vars' warning. 337suppress. For example, (not free-vars) will suppress the `free-vars' warning.
@@ -3498,7 +3500,7 @@ lambda-expression."
3498 (consp (nth 1 arg))) 3500 (consp (nth 1 arg)))
3499 (arrayp arg)) 3501 (arrayp arg))
3500 (byte-compile-warning-enabled-p 3502 (byte-compile-warning-enabled-p
3501 'suspicious (car form))) 3503 'mutate-constant (car form)))
3502 (byte-compile-warn-x form "`%s' on constant %s (arg %d)" 3504 (byte-compile-warn-x form "`%s' on constant %s (arg %d)"
3503 (car form) 3505 (car form)
3504 (if (consp arg) "list" (type-of arg)) 3506 (if (consp arg) "list" (type-of arg))