diff options
| author | Chris McMahan | 2020-05-05 14:15:01 -0400 |
|---|---|---|
| committer | Eli Zaretskii | 2020-05-23 11:15:19 +0300 |
| commit | d7fc6bd17c2cdbd6a24b808223fa5bf9af9bb352 (patch) | |
| tree | 1eb2d95fa55496266d75cdde45d4fa57d86ab8a3 | |
| parent | b4a151918917de2be8b3958d5b59d16c8e3f457e (diff) | |
| download | emacs-d7fc6bd17c2cdbd6a24b808223fa5bf9af9bb352.tar.gz 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)
| -rw-r--r-- | lisp/emacs-lisp/package.el | 28 |
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." | |||
| 397 | :type 'boolean | 397 | :type 'boolean |
| 398 | :version "25.1") | 398 | :version "25.1") |
| 399 | 399 | ||
| 400 | (defcustom package-name-column-width 30 | ||
| 401 | "Column width for the Package name in the package menu." | ||
| 402 | :type 'number | ||
| 403 | :version "28.1") | ||
| 404 | |||
| 405 | (defcustom package-version-column-width 14 | ||
| 406 | "Column width for the Package version in the package menu." | ||
| 407 | :type 'number | ||
| 408 | :version "28.1") | ||
| 409 | |||
| 410 | (defcustom package-status-column-width 12 | ||
| 411 | "Column width for the Package status in the package menu." | ||
| 412 | :type 'number | ||
| 413 | :version "28.1") | ||
| 414 | |||
| 415 | (defcustom package-archive-column-width 8 | ||
| 416 | "Column width for the Package status in the package menu." | ||
| 417 | :type 'number | ||
| 418 | :version "28.1") | ||
| 419 | |||
| 400 | 420 | ||
| 401 | ;;; `package-desc' object definition | 421 | ;;; `package-desc' object definition |
| 402 | ;; This is the struct used internally to represent packages. | 422 | ;; This is the struct used internally to represent packages. |
| @@ -2750,11 +2770,11 @@ Letters do not insert themselves; instead, they are commands. | |||
| 2750 | (package-menu--transaction-status | 2770 | (package-menu--transaction-status |
| 2751 | package-menu--transaction-status))) | 2771 | package-menu--transaction-status))) |
| 2752 | (setq tabulated-list-format | 2772 | (setq tabulated-list-format |
| 2753 | `[("Package" 18 package-menu--name-predicate) | 2773 | `[("Package" ,package-name-column-width package-menu--name-predicate) |
| 2754 | ("Version" 13 package-menu--version-predicate) | 2774 | ("Version" ,package-version-column-width package-menu--version-predicate) |
| 2755 | ("Status" 10 package-menu--status-predicate) | 2775 | ("Status" ,package-status-column-width package-menu--status-predicate) |
| 2756 | ,@(if (cdr package-archives) | 2776 | ,@(if (cdr package-archives) |
| 2757 | '(("Archive" 10 package-menu--archive-predicate))) | 2777 | `(("Archive" ,package-archive-column-width package-menu--archive-predicate))) |
| 2758 | ("Description" 0 package-menu--description-predicate)]) | 2778 | ("Description" 0 package-menu--description-predicate)]) |
| 2759 | (setq tabulated-list-padding 2) | 2779 | (setq tabulated-list-padding 2) |
| 2760 | (setq tabulated-list-sort-key (cons "Status" nil)) | 2780 | (setq tabulated-list-sort-key (cons "Status" nil)) |