Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make the "package" column of Emacs' ELPA list-packages screen wider?

Tags:

emacs

elpa

When I run list-packages on Emacs 24, I get a screen that looks like the following:

ELPA

The problem is that many packages' names are longer than the package column. How do I make this column wider so that I can see the full package names?

like image 737
Ana Avatar asked Feb 07 '15 19:02

Ana


1 Answers

Maybe there is a more elegant solution but I came up with this. You can define the width of the column using following code and changing the variable package-menu-column-width to your needs. Then, you need to include it to your init file (after (require 'package)). It is from the package.el file which defines the format of the table. See the first comment inside the code where you need to modify the width of the column. You can proceed in a similar way for the other columns.

;; <<<< here you have to adapt the number to your needs >>>>
(defcustom package-menu-column-width 18
  "Width of the package column."
  :type 'number
  :group 'package)

(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}"
  (setq tabulated-list-format
        `[("Package" ,package-menu-column-width package-menu--name-predicate)
          ("Version" 12 nil)
          ("Status"  10 package-menu--status-predicate)
          ,@(if (cdr package-archives)
                '(("Archive" 10 package-menu--archive-predicate)))
          ("Description" 0 nil)])
  (setq tabulated-list-padding 2)
  (setq tabulated-list-sort-key (cons "Status" nil))
  (add-hook 'tabulated-list-revert-hook 'package-menu--refresh nil t)
  (tabulated-list-init-header))
like image 95
homeless Avatar answered Sep 28 '22 05:09

homeless