all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Tabulated list recenter issue
@ 2017-03-01  2:51 Ian Dunn
  2017-04-12  0:56 ` Ian Dunn
  0 siblings, 1 reply; 14+ messages in thread
From: Ian Dunn @ 2017-03-01  2:51 UTC (permalink / raw)
  To: emacs-devel


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



^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2017-04-15 21:02 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-01  2:51 Tabulated list recenter issue Ian Dunn
2017-04-12  0:56 ` Ian Dunn
2017-04-12  6:03   ` Eli Zaretskii
2017-04-12  6:25     ` Clément Pit-Claudel
2017-04-12  7:15       ` Eli Zaretskii
2017-04-12 12:28         ` Clément Pit-Claudel
2017-04-12 12:44           ` Eli Zaretskii
2017-04-12 13:11             ` Clément Pit-Claudel
2017-04-12 14:06               ` Eli Zaretskii
2017-04-12 15:13                 ` Clément Pit-Claudel
2017-04-13  1:10                 ` Ian Dunn
2017-04-13  6:17                   ` Eli Zaretskii
2017-04-15 21:02                     ` Ian Dunn
2017-04-12 10:19   ` Eli Zaretskii

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.