From f498d055a4bd8f7b650faddd8033100069750d78 Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Thu, 14 Apr 2022 18:03:58 +0200 Subject: [PATCH] Make vtable remember user-altered column widths * lisp/emacs-lisp/vtable.el (vtable-narrow-current-column) (vtable-widen-current-column): Store the size to that it's respected on `g'. --- lisp/emacs-lisp/vtable.el | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lisp/emacs-lisp/vtable.el b/lisp/emacs-lisp/vtable.el index 66feec4e69a..d53f8b07450 100644 --- a/lisp/emacs-lisp/vtable.el +++ b/lisp/emacs-lisp/vtable.el @@ -776,6 +776,9 @@ Interactively, N is the prefix argument." (max (* (vtable--char-width table) 2) (- (aref widths column) (* (vtable--char-width table) (or n 1))))) + ;; Store the width so it'll be respected on a revert. + (setf (vtable-column-width (elt (vtable-columns table) column)) + (format "%dpx" (aref widths column))) (vtable-revert))) (defun vtable-widen-current-column (&optional n) @@ -791,6 +794,9 @@ Interactively, N is the prefix argument." (user-error "No column under point")) (cl-incf (aref widths column) (* (vtable--char-width table) (or n 1))) + ;; Store the width so it'll be respected on a revert. + (setf (vtable-column-width (elt (vtable-columns table) column)) + (format "%dpx" (aref widths column))) (vtable-revert))) (defun vtable-previous-column () -- 2.39.5