From def4001cd9b59af9ec604468a15951ea12729da9 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Mon, 19 Oct 2020 00:04:58 +0200 Subject: [PATCH] Don't preserve window-line in tabulated-list-print * lisp/emacs-lisp/tabulated-list.el (tabulated-list-print): Don't try to preserve window-line. (Bug#42747) --- lisp/emacs-lisp/tabulated-list.el | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/lisp/emacs-lisp/tabulated-list.el b/lisp/emacs-lisp/tabulated-list.el index b13f609f88..d553a12442 100644 --- a/lisp/emacs-lisp/tabulated-list.el +++ b/lisp/emacs-lisp/tabulated-list.el @@ -404,8 +404,7 @@ tabulated-list-print buffer and inserts the entries with `tabulated-list-printer'. Optional argument REMEMBER-POS, if non-nil, means to move point -to the entry with the same ID element as the current line and -recenter window line accordingly. +to the entry with the same ID element as the current line. Non-nil UPDATE argument means to use an alternative printing method which is faster if most entries haven't changed since the @@ -418,18 +417,10 @@ tabulated-list-print (funcall tabulated-list-entries) tabulated-list-entries)) (sorter (tabulated-list--get-sorter)) - entry-id saved-pt saved-col window-line) + entry-id saved-pt saved-col) (and remember-pos (setq entry-id (tabulated-list-get-id)) - (setq saved-col (current-column)) - (when (eq (window-buffer) (current-buffer)) - (setq window-line - (save-excursion - (save-restriction - (widen) - (narrow-to-region (window-start) (point)) - (goto-char (point-min)) - (vertical-motion (buffer-size))))))) + (setq saved-col (current-column))) ;; Sort the entries, if necessary. (when sorter (setq entries (sort entries sorter))) @@ -484,9 +475,7 @@ tabulated-list-print ;; If REMEMBER-POS was specified, move to the "old" location. (if saved-pt (progn (goto-char saved-pt) - (move-to-column saved-col) - (when window-line - (recenter window-line))) + (move-to-column saved-col)) (goto-char (point-min))))) (defun tabulated-list-print-entry (id cols) -- 2.28.0