aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/emacs-lisp/tabulated-list.el7
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'."
424 (setq saved-col (current-column)) 424 (setq saved-col (current-column))
425 (when (eq (window-buffer) (current-buffer)) 425 (when (eq (window-buffer) (current-buffer))
426 (setq window-line 426 (setq window-line
427 (count-screen-lines (window-start) (point))))) 427 (save-excursion
428 (save-restriction
429 (widen)
430 (narrow-to-region (window-start) (point))
431 (goto-char (point-min))
432 (vertical-motion (buffer-size)))))))
428 ;; Sort the entries, if necessary. 433 ;; Sort the entries, if necessary.
429 (when sorter 434 (when sorter
430 (setq entries (sort entries sorter))) 435 (setq entries (sort entries sorter)))