bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#41086: Fwd: bug#41086: [PATCH] Add user-defined column widths to pac


From: Eli Zaretskii
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@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.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]