unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Ian Dunn <dunni@gnu.org>
To: emacs-devel@gnu.org
Subject: Tabulated list recenter issue
Date: Tue, 28 Feb 2017 21:51:09 -0500	[thread overview]
Message-ID: <87h93dogki.fsf@escafil> (raw)


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



             reply	other threads:[~2017-03-01  2:51 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-01  2:51 Ian Dunn [this message]
2017-04-12  0:56 ` Tabulated list recenter issue 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87h93dogki.fsf@escafil \
    --to=dunni@gnu.org \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).