GNU bug report logs - #41086
[PATCH] Add user-defined column widths to package-list (package.el)

Previous Next

Package: emacs;

Reported by: Chris McMahan <cmcmahan <at> gmail.com>

Date: Mon, 4 May 2020 20:14:01 UTC

Severity: wishlist

Tags: patch

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Noam Postavsky <npostavs <at> gmail.com>
To: Chris McMahan <cmcmahan <at> gmail.com>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 41086 <at> debbugs.gnu.org
Subject: bug#41086: Fwd: bug#41086: [PATCH] Add user-defined column widths to package-list (package.el)
Date: Tue, 05 May 2020 13:24:52 -0400
Chris McMahan <cmcmahan <at> gmail.com> writes:

> ;; Original non-functioning code. Trying to get the value of the
> package-archive-column-width into the list rather than hardcode it.
> (setq tabulated-list-format
>         `[("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" ,package-archive-column-width
                  ^

You just need a backquote here instead of a plain quote.  A good rule of
thumb is that if you climb up (using backward-up-list, C-M-u) from a
comma, there should always be exactly one corresponding backquote per
comma.  In this case you had two commas, but only one backquote.

> (if (cdr package-archives)
>     (setq tabulated-list-format (append tabulated-list-format `(("Archive" ,package-archive-column-width package-menu--archive-predicate)))))
> (setq tabulated-list-format (append tabulated-list-format `(("Description" 0 package-menu--description-predicate))))

This works too, though it's a bit clunky.

>> > I can't figure out how to get it to use the value of
>> > package-archive-column-width and not the string literal.

FYI, you really mean a quoted symbol, not a string literal.




This bug report was last modified 5 years and 86 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.