diff options
author | Stefan Kangas <stefan@marxist.se> | 2021-04-09 18:25:08 +0200 |
---|---|---|
committer | Stefan Kangas <stefan@marxist.se> | 2021-04-09 18:25:08 +0200 |
commit | cdd72c5d89cb9920f7cd36dfd08429d29ce8e881 (patch) | |
tree | b6e14f34e3c13488b5665f9144af935e0fc1dd2d /lisp/emacs-lisp/tabulated-list.el | |
parent | 22515134ae83b625964f7719e172435f016be0f2 (diff) | |
download | emacs-cdd72c5d89cb9920f7cd36dfd08429d29ce8e881.tar.gz emacs-cdd72c5d89cb9920f7cd36dfd08429d29ce8e881.tar.bz2 emacs-cdd72c5d89cb9920f7cd36dfd08429d29ce8e881.zip |
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)
Diffstat (limited to 'lisp/emacs-lisp/tabulated-list.el')
-rw-r--r-- | lisp/emacs-lisp/tabulated-list.el | 19 |
1 files changed, 4 insertions, 15 deletions
diff --git a/lisp/emacs-lisp/tabulated-list.el b/lisp/emacs-lisp/tabulated-list.el index 0c299b48b90..0b10dfdc0af 100644 --- a/lisp/emacs-lisp/tabulated-list.el +++ b/lisp/emacs-lisp/tabulated-list.el @@ -410,8 +410,7 @@ specified by `tabulated-list-sort-key'. It then erases the 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 @@ -424,18 +423,10 @@ changing `tabulated-list-sort-key'." (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))) @@ -490,9 +481,7 @@ changing `tabulated-list-sort-key'." ;; 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) |