summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp
diff options
context:
space:
mode:
authorChris McMahan <cmcmahan@gmail.com>2020-05-05 14:15:01 -0400
committerEli Zaretskii <eliz@gnu.org>2020-05-23 11:15:19 +0300
commitd7fc6bd17c2cdbd6a24b808223fa5bf9af9bb352 (patch)
tree1eb2d95fa55496266d75cdde45d4fa57d86ab8a3 /lisp/emacs-lisp
parentb4a151918917de2be8b3958d5b59d16c8e3f457e (diff)
downloademacs-d7fc6bd17c2cdbd6a24b808223fa5bf9af9bb352.tar.gz
emacs-d7fc6bd17c2cdbd6a24b808223fa5bf9af9bb352.tar.bz2
emacs-d7fc6bd17c2cdbd6a24b808223fa5bf9af9bb352.zip
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) (package-archive-column-width): New defcustoms. (package-menu-mode): Use the values of defcustoms instead of hardcoded values. (Bug#41086)
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r--lisp/emacs-lisp/package.el28
1 files changed, 24 insertions, 4 deletions
diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el
index ecf833b5473..9a6d1d7319d 100644
--- a/lisp/emacs-lisp/package.el
+++ b/lisp/emacs-lisp/package.el
@@ -397,6 +397,26 @@ synchronously."
:type 'boolean
:version "25.1")
+(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")
+
+(defcustom package-archive-column-width 8
+ "Column width for the Package status in the package menu."
+ :type 'number
+ :version "28.1")
+
;;; `package-desc' object definition
;; This is the struct used internally to represent packages.
@@ -2750,11 +2770,11 @@ Letters do not insert themselves; instead, they are commands.
(package-menu--transaction-status
package-menu--transaction-status)))
(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)))
+ `(("Archive" ,package-archive-column-width package-menu--archive-predicate)))
("Description" 0 package-menu--description-predicate)])
(setq tabulated-list-padding 2)
(setq tabulated-list-sort-key (cons "Status" nil))