all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#41086: [PATCH] Add user-defined column widths to package-list (package.el)
@ 2020-05-04 20:10 Chris McMahan
  2020-05-04 21:01 ` bug#41086: Corrcted patch for bug #41086 Chris McMahan
  2020-05-04 21:02 ` bug#41086: [PATCH] Add user-defined column widths to package-list (package.el) Stefan Kangas
  0 siblings, 2 replies; 11+ messages in thread
From: Chris McMahan @ 2020-05-04 20:10 UTC (permalink / raw)
  To: 41086


[-- Attachment #1.1: Type: text/plain, Size: 844 bytes --]

When executing the function `package-list-packages', the column widths are
too narrow, cutting off a significant
portion of the package names.

This minor patch adds four variables that can be set by the user to adjust
the width of each column within the package list.

Changelog entry
--------------------------------
2020-05-04  Chris McMahan  <cmcmahan@gmail.com>

* package.el ((define-derived-mode package-menu-mode tabulated-list-mode
"Package Menu"):
User can now adjust column widths of the package list by setting the values
of the following:
package-name-column-width (defaults to 30 columns)
package-version-column-width (14 column)
package-status-column-width (12 columns)
package-archive-column-width (14 columns)
--------------------------------

Patch is attached:


-- 
*Chris McMahan <cmcmahan@gmail.com <cmcmahan@gmail.com>>*

[-- Attachment #1.2: Type: text/html, Size: 2086 bytes --]

[-- Attachment #2: package.patch --]
[-- Type: application/octet-stream, Size: 2389 bytes --]

--- v27.0.90_package.el	2020-05-04 15:49:33.387845600 -0400
+++ package.el	2020-05-04 15:50:13.190789400 -0400
@@ -397,6 +397,29 @@
   :type 'boolean
   :version "25.1")
 
+(defcustom package-name-column-width 30
+  "Column width of the 'Package' name within the package list
+invoked through `package-list-packages'."
+  :type 'number
+  :version "27.1")
+
+(defcustom package-version-column-width 14
+  "Column width of the package 'version' within the package list
+invoked through `package-list-packages'."
+  :type 'number
+  :version "27.1")
+
+(defcustom package-status-column-width 12
+  "Column width of the package 'status' within the package list
+invoked from the `package-list-packages' command"
+  :type 'number
+  :version "27.1")
+
+(defcustom package-archive-column-width 14
+  "Width of the archive column in the package list."
+  :type 'number
+  :version "27.1")
+
 \f
 ;;; `package-desc' object definition
 ;; This is the struct used internally to represent packages.
@@ -2750,18 +2773,18 @@
 
 (define-derived-mode package-menu-mode tabulated-list-mode "Package Menu"
   "Major mode for browsing a list of packages.
-Letters do not insert themselves; instead, they are commands.
-\\<package-menu-mode-map>
-\\{package-menu-mode-map}"
+  Letters do not insert themselves; instead, they are commands.
+  \\<package-menu-mode-map>
+  \\{package-menu-mode-map}"
   (setq mode-line-process '((package--downloads-in-progress ":Loading")
                             (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))

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2020-05-05 17:54 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-05-04 20:10 bug#41086: [PATCH] Add user-defined column widths to package-list (package.el) Chris McMahan
2020-05-04 21:01 ` bug#41086: Corrcted patch for bug #41086 Chris McMahan
2020-05-04 21:02 ` bug#41086: [PATCH] Add user-defined column widths to package-list (package.el) Stefan Kangas
     [not found]   ` <CAFgt8u2GWpZHnSevoGMQwVQP1x6n8mvRVFJEZbXW-iqM7qNaaw@mail.gmail.com>
2020-05-05  1:39     ` bug#41086: Fwd: " Stefan Kangas
2020-05-05 14:14       ` Eli Zaretskii
     [not found]         ` <CAFgt8u018fvLKF8xWsUs5Ky1TLhSceSPJSuKhrFrgvcm_zOU8g@mail.gmail.com>
2020-05-05 16:09           ` Eli Zaretskii
2020-05-05 17:12             ` Chris McMahan
2020-05-05 17:24               ` Noam Postavsky
2020-05-05 17:54                 ` Chris McMahan
     [not found]     ` <87eerznyav.fsf@stefankangas.se>
     [not found]       ` <CAFgt8u2CgqfwWQ2xraK=c9ceALC6VXksdFNV3wBvvV0sr1m+hw@mail.gmail.com>
2020-05-05  1:39         ` Stefan Kangas
2020-05-05  1:42         ` Stefan Kangas

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.