From: Lars Ingebrigtsen Date: Thu, 14 Apr 2022 16:03:58 +0000 (+0200) Subject: Make vtable remember user-altered column widths X-Git-Tag: emacs-29.0.90~1931^2~573 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=f498d055a4bd8f7b650faddd8033100069750d78;p=emacs.git 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'. --- 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 ()