GNU bug report logs - #41086
[PATCH] Add user-defined column widths to package-list (package.el)

Previous Next

Package: emacs;

Reported by: Chris McMahan <cmcmahan <at> gmail.com>

Date: Mon, 4 May 2020 20:14:01 UTC

Severity: wishlist

Tags: patch

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: Stefan Kangas <stefankangas <at> gmail.com>, Chris McMahan <cmcmahan <at> gmail.com>
Cc: 41086 <at> debbugs.gnu.org
Subject: bug#41086: Fwd: bug#41086: [PATCH] Add user-defined column widths to package-list (package.el)
Date: Tue, 05 May 2020 17:14:50 +0300
> From: Stefan Kangas <stefankangas <at> gmail.com>
> Date: Tue, 5 May 2020 03:39:09 +0200
> 
> The changelog entry follows:
> 
> * package.el (package-menu-mode): User can now adjust the column widths of
> the package menu by setting the values of the following defcustoms.
> 
> (package-name-column-width) New defcustom
> (package-version-column-width) New defcustom
> (package-status-column-width) New defcustom

Our style is slightly different, see CONTRIBUTE.  (Emacs actually has
commands that will help you format these log entries.)  It should look
like this in this case:

  Let user adjust the column widths of the package menu.
  * lisp/emacs-lisp/package.el (package-name-column-width)
  (package-version-column-width, package-status-column-width): New
  defcustoms.
  (package-menu-mode): Use the values of defcustoms instead of
  hardcoded values.  (Bug#41086)

> +(defcustom package-name-column-width 30
> +  "Column width for the Package name in the package menu."
> +  :type 'number
> +  :version "28.1")
> +
> +(defcustom package-version-column-width 14
> +  "Column width for the Package version in the package menu."
> +  :type 'number
> +  :version "28.1")
> +
> +(defcustom package-status-column-width 12
> +  "Column width for the Package status in the package menu."
> +  :type 'number
> +  :version "28.1")

These change the default values from the current hard-coded ones.  Any
reasons for that change?

>    (setq tabulated-list-format
> -        `[("Package" 18 package-menu--name-predicate)
> -          ("Version" 13 package-menu--version-predicate)
> -          ("Status"  10 package-menu--status-predicate)
> +        `[("Package" ,package-name-column-width package-menu--name-predicate)
> +          ("Version" ,package-version-column-width package-menu--version-predicate)
> +          ("Status"  ,package-status-column-width  package-menu--status-predicate)
>            ,@(if (cdr package-archives)
>                  '(("Archive" 10 package-menu--archive-predicate)))

Why do we leave the "Archive" column width hard-coded?

Also, I see 13 in at least 2 more places in the code, are they
related?  If so, they should be changed to use the defcustom as well.

Finally, I think this warrants a NEWS entry.

Thanks.




This bug report was last modified 5 years and 86 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.