summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp
diff options
context:
space:
mode:
authorLars Ingebrigtsen <larsi@gnus.org>2022-01-25 14:21:22 +0100
committerLars Ingebrigtsen <larsi@gnus.org>2022-01-25 14:21:22 +0100
commitf16039b16120abd0b7e1293292f90d69358e0fef (patch)
tree40b25bf4f380998d112c78cfc46bd0b81ce1f93e /lisp/emacs-lisp
parentc40398e0080a44eac709871f9eb3fca2bb9a1560 (diff)
downloademacs-f16039b16120abd0b7e1293292f90d69358e0fef.tar.gz
emacs-f16039b16120abd0b7e1293292f90d69358e0fef.tar.bz2
emacs-f16039b16120abd0b7e1293292f90d69358e0fef.zip
Don't mutate literals in tabulated-list-widen-current-column
* lisp/emacs-lisp/tabulated-list.el (tabulated-list-widen-current-column): Avoid mutating constants (bug#53501).
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r--lisp/emacs-lisp/tabulated-list.el3
1 files changed, 3 insertions, 0 deletions
diff --git a/lisp/emacs-lisp/tabulated-list.el b/lisp/emacs-lisp/tabulated-list.el
index 2defef81073..b740a7457af 100644
--- a/lisp/emacs-lisp/tabulated-list.el
+++ b/lisp/emacs-lisp/tabulated-list.el
@@ -755,6 +755,9 @@ Interactively, N is the prefix numeric argument, and defaults to
1))))
(setq col-nb (1+ col-nb))
(setq found t)
+ ;; `tabulated-list-format' may be a constant (sharing list
+ ;; structures), so copy it before mutating.
+ (setq tabulated-list-format (copy-tree tabulated-list-format t))
(setf (cadr (aref tabulated-list-format col-nb))
(max 1 (+ col-width n)))
(tabulated-list-print t)