summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorMattias EngdegÄrd <mattiase@acm.org>2023-05-11 19:24:51 +0200
committerMattias EngdegÄrd <mattiase@acm.org>2023-05-13 11:53:25 +0200
commitbfc07100d28d0f687da0a1dd5fdfa42a92a93f88 (patch)
tree4ca024cacb42464e68c51f07bbbae3d1fe9af4eb /doc
parentfa598571adab4858282f337b45984517e197f8a9 (diff)
downloademacs-bfc07100d28d0f687da0a1dd5fdfa42a92a93f88.tar.gz
Byte-compiler warning about mutation of constant values
When we can easily detect mutation of constants (quoted lists, strings and vectors), warn. For example, (setcdr '(1 . 2) 3) (nreverse [1 2 3]) (put-text-property 0 3 'face 'highlight "moo") Such code can result in surprising behaviour and problems that are difficult to debug. * lisp/emacs-lisp/bytecomp.el (byte-compile-form, mutating-fns): Add the warning and a list of functions to warn about. * etc/NEWS: Announce. * test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-test--with-suppressed-warnings): Add test cases.
Diffstat (limited to 'doc')
0 files changed, 0 insertions, 0 deletions