all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Chris McMahan <cmcmahan@gmail.com>
To: 41086@debbugs.gnu.org
Subject: bug#41086: [PATCH] Add user-defined column widths to package-list (package.el)
Date: Mon, 4 May 2020 16:10:37 -0400	[thread overview]
Message-ID: <CAFgt8u2vECRUN-Yu4qaL=dCU5BrEkBazbs3K663GN+V1ANxqxw@mail.gmail.com> (raw)


[-- 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))

             reply	other threads:[~2020-05-04 20:10 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-04 20:10 Chris McMahan [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAFgt8u2vECRUN-Yu4qaL=dCU5BrEkBazbs3K663GN+V1ANxqxw@mail.gmail.com' \
    --to=cmcmahan@gmail.com \
    --cc=41086@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.