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


Message #35 received at 41086 <at> debbugs.gnu.org (full text, mbox):

From: Chris McMahan <cmcmahan <at> gmail.com>
To: Noam Postavsky <npostavs <at> gmail.com>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 41086 <at> debbugs.gnu.org
Subject: Re: bug#41086: Fwd: bug#41086: [PATCH] Add user-defined column widths
 to package-list (package.el)
Date: Tue, 5 May 2020 13:54:08 -0400
[Message part 1 (text/plain, inline)]
The backquote did the trick! (slaps forehead).

I appreciate the help!

- Chris

On Tue, May 5, 2020 at 1:24 PM Noam Postavsky <npostavs <at> gmail.com> wrote:

> 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.
>


-- 
*Chris McMahan <cmcmahan <at> gmail.com <cmcmahan <at> gmail.com>>*
[Message part 2 (text/html, inline)]

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.