From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stephen Berman Newsgroups: gmane.emacs.bugs Subject: bug#44068: 28.0.50; Faulty uses of tabulated-list-format Date: Mon, 19 Oct 2020 00:35:38 +0200 Message-ID: <87362bdux1.fsf@gmx.net> References: <87imb7e242.fsf@gmx.net> <87blgzdvrr.fsf@gmx.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="39799"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: 44068@debbugs.gnu.org To: Stefan Kangas Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Oct 19 00:36:51 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kUHIJ-000AHa-MQ for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 19 Oct 2020 00:36:51 +0200 Original-Received: from localhost ([::1]:33742 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kUHII-0001Ou-PB for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 18 Oct 2020 18:36:50 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:57644) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kUHHW-000123-El for bug-gnu-emacs@gnu.org; Sun, 18 Oct 2020 18:36:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:55998) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kUHHW-0006xv-5X for bug-gnu-emacs@gnu.org; Sun, 18 Oct 2020 18:36:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kUHHW-0000qg-2C for bug-gnu-emacs@gnu.org; Sun, 18 Oct 2020 18:36:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stephen Berman Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 18 Oct 2020 22:36:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 44068 X-GNU-PR-Package: emacs Original-Received: via spool by 44068-submit@debbugs.gnu.org id=B44068.16030605523244 (code B ref 44068); Sun, 18 Oct 2020 22:36:02 +0000 Original-Received: (at 44068) by debbugs.gnu.org; 18 Oct 2020 22:35:52 +0000 Original-Received: from localhost ([127.0.0.1]:39311 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kUHHL-0000qG-S0 for submit@debbugs.gnu.org; Sun, 18 Oct 2020 18:35:52 -0400 Original-Received: from mout.gmx.net ([212.227.15.19]:33301) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kUHHK-0000q1-23 for 44068@debbugs.gnu.org; Sun, 18 Oct 2020 18:35:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1603060543; bh=Ctaji6R9afdQU8D31BAWB2QY6p5Vupv8AwP7bHPZw/4=; h=X-UI-Sender-Class:From:To:Cc:Subject:References:Date:In-Reply-To; b=GhRAXbnAiXZpWYWjGAZkr7UWi/qr9Eb249sD6MgCDSRDjOP5pgFPg8xdorDFEEHmq glm/NNu06yPhy0Tb+wSVH9oFg69Oc+mtGhOjv0eWehhPTd49E5WnXOWrSAsi3TujNB 591WBPTREZHPKUzEyMekz0HOJLxW0xsEPbf4HaNQ= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Original-Received: from strobe-jhalfs ([178.6.223.210]) by mail.gmx.com (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MqJqD-1k910G1b8t-00nOsB; Mon, 19 Oct 2020 00:35:43 +0200 In-Reply-To: <87blgzdvrr.fsf@gmx.net> (Stephen Berman's message of "Mon, 19 Oct 2020 00:17:12 +0200") X-Provags-ID: V03:K1:1nzyN8DmONa3Z2C+lZSr8LYgpsyz9hPRs2hw3e5gF5Y28nlLb65 u4yKAjKJIADsH4gJgTVbPz89UaJT2XeX2GQaA1mfUPEFz257cP77r1+VhattqSz39WXPgrh R578w+VPR2Op3UjMUSfFWZPZp3pu3CLw/MroDEQMVQZxv8T4cPYzjlQiqW3Hsa00VCyqgJN 9aCxWbHdjylH0wxmIGazw== X-UI-Out-Filterresults: notjunk:1;V03:K0:dLTMli+hmAw=:+rYTjJ7cwV5iQcIniw/j5v Ina/ZGkWq3IpIFUb67E4ggwLh6PFd8Kc3nY6UYTQ4OskABlKTif7RZJvO1Kt30cIgHzWiSa7Q 3AutdGy+Tp6Zz5hrhuQxo9bGwB0C1xLNDnfUPdLIcZkDjbC2cLfC5eEstX8V97y9Mcg3TdmdU PbiNPNeedneVkCjOMeTIqofChIH5IFw30FA6oqxjTD2VLfXP4GVoHrY+6dekshON0U+0E2lwb HuTua66ltVXr2Pxj6mwcYS0f157U9XwBJyERER0JBfPsuBTDVfxSPhACFvM+HPLm3U99JgMzl yEOuQBmFtdC1mkH/bGYdzIXyHXF+C1HyfiVGghsIAyl3VsJALF4FdpwWtCo4N5RTY6wpZNCOP pcaEfDVqIJIJ0t9blh9bBIwXIJkua4j/Y96i02qG5hfrQYhrLtYXGA6drCYG0sqb70Fnu4Tr8 n57+NcPIAz2AtrWlupAA6rR0Ae2jH2jHOLhSpdneY7PAiSGqvJ17DMIafOVOMHVEI2h+ZVju6 90KxgS56PzXhunbddZ6/LYqlnnVIm4SCs51Q00cS2vrawQDyLnLOnn5I8/Sb8yC+Ws0tjNfTF mmfoCCdeYwXPo0CtwIKOkNB2/fuBzm1KWUKsFraeu0yt7swH8ZKV9T87H7lXFWMA+AMOOnuLV eElhTMRPgNcOQ9S4EMad3k0yM5ubBUePv0RYqQYQMnyUyzkJYaXbHJ9YhLVoqFjAYyn2Tet7l zPj3x4fl4vSIbYteXThMCckxhFloI7jh0UKnkbcgsbkCVsStpjg8D7OMdPu0d8WoMg1dryhQ X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:190927 Archived-At: On Mon, 19 Oct 2020 00:17:12 +0200 Stephen Berman wrote: > On Sun, 18 Oct 2020 15:01:31 -0700 Stefan Kangas wrote: [...] >> Thanks for the patch. I've tested it and it indeed fixes several bugs >> in this area. >> >> But it got me thinking: for the final column at least, maybe we should >> just make tabulated-list-mode work as advertised, and itself figure out >> that it should use this length? That way, we would solve any bugs also >> for external packages that have been misled by the doc string. Or would >> that have any downsides? > > That was my first thought when I noticed the problem, and came up with > this patch to fix it: > > diff --git a/lisp/emacs-lisp/tabulated-list.el b/lisp/emacs-lisp/tabulated-list.el > index b13f609f88..d6bec72ade 100644 > --- a/lisp/emacs-lisp/tabulated-list.el > +++ b/lisp/emacs-lisp/tabulated-list.el > @@ -271,11 +271,12 @@ tabulated-list-init-header > (button-props `(help-echo "Click to sort by column" > mouse-face header-line-highlight > keymap ,tabulated-list-sort-button-map)) > + (len (length tabulated-list-format)) > (cols nil)) > (if display-line-numbers > (setq x (+ x (tabulated-list-line-number-width)))) > (push (propertize " " 'display `(space :align-to ,x)) cols) > - (dotimes (n (length tabulated-list-format)) > + (dotimes (n len) > (let* ((col (aref tabulated-list-format n)) > (label (nth 0 col)) > (width (nth 1 col)) > @@ -293,7 +294,11 @@ tabulated-list-init-header > (apply 'propertize > (concat label > (cond > - ((> (+ 2 (length label)) width) "") > + ((and (> (+ 2 (length label)) width) > + (not (= (tabulated-list--column-number > + (car tabulated-list-sort-key)) > + (1- len)))) > + "") > ((cdr tabulated-list-sort-key) > (format " %c" > tabulated-list-gui-sort-indicator-desc)) > > But after I saw that final (rightmost) column in the problematic cases > was simply given too narrow a width, I thought it better to just change > that and clarify the doc. But maybe you're right that the misleading > doc has affected third-party packages. I note, though, that this patch, won't fix too narrow non-final columns, as the Archive column in package-menu-mode, or the Status column in process-menu-mode, etc. Steve Berman