From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Ian Dunn Newsgroups: gmane.emacs.devel Subject: Tabulated list recenter issue Date: Tue, 28 Feb 2017 21:51:09 -0500 Message-ID: <87h93dogki.fsf@escafil> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1488336704 11462 195.159.176.226 (1 Mar 2017 02:51:44 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 1 Mar 2017 02:51:44 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Mar 01 03:51:39 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ciuMc-0002RM-SF for ged-emacs-devel@m.gmane.org; Wed, 01 Mar 2017 03:51:38 +0100 Original-Received: from localhost ([::1]:38090 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ciuMi-0007zO-OQ for ged-emacs-devel@m.gmane.org; Tue, 28 Feb 2017 21:51:44 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58564) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ciuMd-0007zJ-FQ for emacs-devel@gnu.org; Tue, 28 Feb 2017 21:51:40 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ciuMc-0005DU-R8 for emacs-devel@gnu.org; Tue, 28 Feb 2017 21:51:39 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:57313) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ciuMc-0005DO-Nn for emacs-devel@gnu.org; Tue, 28 Feb 2017 21:51:38 -0500 Original-Received: from [2604:6000:1010:176:d06f:8928:a420:e516] (port=53700 helo=escafil) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1ciuMc-0002Y8-1q for emacs-devel@gnu.org; Tue, 28 Feb 2017 21:51:38 -0500 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:212669 Archived-At: 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