diff options
Diffstat (limited to 'lisp/emacs-lisp/tabulated-list.el')
-rw-r--r-- | lisp/emacs-lisp/tabulated-list.el | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lisp/emacs-lisp/tabulated-list.el b/lisp/emacs-lisp/tabulated-list.el index 66a859f56ce..88e79174bfc 100644 --- a/lisp/emacs-lisp/tabulated-list.el +++ b/lisp/emacs-lisp/tabulated-list.el @@ -424,7 +424,12 @@ changing `tabulated-list-sort-key'." (setq saved-col (current-column)) (when (eq (window-buffer) (current-buffer)) (setq window-line - (count-screen-lines (window-start) (point))))) + (save-excursion + (save-restriction + (widen) + (narrow-to-region (window-start) (point)) + (goto-char (point-min)) + (vertical-motion (buffer-size))))))) ;; Sort the entries, if necessary. (when sorter (setq entries (sort entries sorter))) |