1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-05 22:20:24 -08:00

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).
This commit is contained in:
Lars Ingebrigtsen 2022-01-25 14:21:22 +01:00
parent c40398e008
commit f16039b161

View file

@ -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)