bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#41086: Fwd: bug#41086: [PATCH] Add user-defined column widths to pac


From: Noam Postavsky
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
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (windows-nt)

Chris McMahan <cmcmahan@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.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]