emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master f16039b161: Don't mutate literals in tabulated-list-widen-current


From: Lars Ingebrigtsen
Subject: master f16039b161: Don't mutate literals in tabulated-list-widen-current-column
Date: Tue, 25 Jan 2022 08:21:42 -0500 (EST)

branch: master
commit f16039b16120abd0b7e1293292f90d69358e0fef
Author: Lars Ingebrigtsen <larsi@gnus.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    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).
---
 lisp/emacs-lisp/tabulated-list.el | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/lisp/emacs-lisp/tabulated-list.el 
b/lisp/emacs-lisp/tabulated-list.el
index 2defef8107..b740a7457a 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)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]