Subject: Re: bug#41086: Fwd: bug#41086: [PATCH] Add user-defined column widths to package-list (package.el)

From: Chris McMahan <[email-masked]>
Date: Tue, 5 May 2020 13:54:08 -0400

The backquote did the trick! (slaps forehead).

I appreciate the help!

- Chris

On Tue, May 5, 2020 at 1:24 PM Noam Postavsky <[email-masked]> wrote:

> Chris McMahan <[email-masked]> 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.
>

-- 
*Chris McMahan <[email-masked] <[email-masked]>>*