[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Tabulated list recenter issue
From: |
Ian Dunn |
Subject: |
Tabulated list recenter issue |
Date: |
Tue, 28 Feb 2017 21:51:09 -0500 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) |
When sorting a tabulated list, tabulated-list-mode will move the window to keep
the current entry at the same line in the window.
If a user has their cursor on the top entry with sort active, then reverses the
sort, the other entries seemingly disappear.
You can see this in the package menu if you've got a small archive (I've been
using the org archive) or have only a few new packages. Sort the package list
by status (for few new packages) or archive (for a small archive), then reverse
the sort.
This isn't a big problem for something like the package menu where there are
enough entries to fill a few screens, but I'm using tabulated-list-mode for
ENWC, and I don't think I've ever filled a screen with access points.
The code causing the behavior in question is in tabulated-list-print, at lines
400 and 401:
> (when window-line
> (recenter window-line))
window-line is set at lines 343 and 344:
> (setq window-line
> (count-screen-lines (window-start) (point)))
My proposed solution is this:
If moving the window to keep the current entry at the same line would leave
blank space at the end of the window, don't move the window, but keep point on
the current entry.
Does anyone else have any thoughts on this?
--
Ian Dunn
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Tabulated list recenter issue,
Ian Dunn <=