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.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 41086 in the body.
You can then email your comments to 41086 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#41086; Package emacs. (Mon, 04 May 2020 20:14:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Chris McMahan <cmcmahan <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 04 May 2020 20:14:02 GMT) Full text and rfc822 format available.

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

From: Chris McMahan <cmcmahan <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: [PATCH] Add user-defined column widths to package-list (package.el)
Date: Mon, 4 May 2020 16:10:37 -0400
[Message part 1 (text/plain, inline)]
When executing the function `package-list-packages', the column widths are
too narrow, cutting off a significant
portion of the package names.

This minor patch adds four variables that can be set by the user to adjust
the width of each column within the package list.

Changelog entry
--------------------------------
2020-05-04  Chris McMahan  <cmcmahan <at> gmail.com>

* package.el ((define-derived-mode package-menu-mode tabulated-list-mode
"Package Menu"):
User can now adjust column widths of the package list by setting the values
of the following:
package-name-column-width (defaults to 30 columns)
package-version-column-width (14 column)
package-status-column-width (12 columns)
package-archive-column-width (14 columns)
--------------------------------

Patch is attached:


-- 
*Chris McMahan <cmcmahan <at> gmail.com <cmcmahan <at> gmail.com>>*
[Message part 2 (text/html, inline)]
[package.patch (application/octet-stream, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41086; Package emacs. (Mon, 04 May 2020 21:02:02 GMT) Full text and rfc822 format available.

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

From: Chris McMahan <cmcmahan <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: Corrcted patch for bug #41086
Date: Mon, 4 May 2020 17:01:14 -0400
[Message part 1 (text/plain, inline)]
I apologize. The patch I sent WRT bug #41086 was the wrong (nonfunctioning)
version.
Here is a resend of the message, with the correct patch and log:


When executing the function `package-list-packages', the column widths are
too narrow, cutting off a significant portion of the package names.

This minor patch adds three variables that can be set by the user to adjust
the width of each column within the package list.

Changelog entry
--------------------------------
2020-05-04  Chris McMahan  <cmcmahan <at> gmail.com>

* package.el ((define-derived-mode package-menu-mode tabulated-list-mode
"Package Menu"):
User can now adjust column widths of the package list by setting the values
of the following:
package-name-column-width (defaults to 30 columns)
package-version-column-width (14 column)
package-status-column-width (12 columns)
--------------------------------

Patch is attached:


-- 
*Chris McMahan <cmcmahan <at> gmail.com <cmcmahan <at> gmail.com>>*
[Message part 2 (text/html, inline)]
[package_el.patch (application/octet-stream, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41086; Package emacs. (Mon, 04 May 2020 21:04:02 GMT) Full text and rfc822 format available.

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

From: Stefan Kangas <stefankangas <at> gmail.com>
To: Chris McMahan <cmcmahan <at> gmail.com>, 41086 <at> debbugs.gnu.org
Subject: Re: bug#41086: [PATCH] Add user-defined column widths to
 package-list (package.el)
Date: Mon, 04 May 2020 23:02:57 +0200
Chris McMahan <cmcmahan <at> gmail.com> writes:

> When executing the function `package-list-packages', the column widths are
> too narrow, cutting off a significant
> portion of the package names.
>
> This minor patch adds four variables that can be set by the user to adjust
> the width of each column within the package list.

Thanks for the patch, this makes sense.  I have some comments below.

Is this your first patch to Emacs?  I can't find your name in the git
log, but maybe I missed it.  Since your patch is over 15 lines, we
would need a copyright assignment from you to be able to apply it.
Would you be willing to sign such papers?

Please see here for more: https://www.gnu.org/licenses/why-assign.html

---

Now, here are my technical comments.

Could you send your patch as formatted by 'git format-patch -1'
instead?  It will make it easier for us to apply it.

> Changelog entry
> --------------------------------
> 2020-05-04  Chris McMahan  <cmcmahan <at> gmail.com>
>
> * package.el ((define-derived-mode package-menu-mode tabulated-list-mode
> "Package Menu"):
> User can now adjust column widths of the package list by setting the values
> of the following:

This is better formatted like:

* package.el (package-menu-mode): User can now adjust column widths of
the package list by setting the values of the below defcustoms.

> package-name-column-width (defaults to 30 columns)
> package-version-column-width (14 column)
> package-status-column-width (12 columns)
> package-archive-column-width (14 columns)

This should be formatted like so:

    (package-archive-column-width): New defcustom.

> +(defcustom package-name-column-width 30
> +  "Column width of the 'Package' name within the package list
> +invoked through `package-list-packages'."
> +  :type 'number
> +  :version "27.1")

Should be :version "28.1", since this will most likely not go to the
emacs-27 branch this close to the release.

Also the first line should be a complete sentence in this defcustom
and the others.  Please see M-x customize-group RET package RET if you
want to see why.

We prefer "package menu" to "package list".  I'm not sure why, but I
think it has historical reasons.  Ideal or not, I think we should try
to stay consistent.

Possibly the docstrings could look something much like:

"Column width for the Package name in the package menu."

Refer to Info node `(elisp) Documentation Tips' for more.

> -Letters do not insert themselves; instead, they are commands.
> -\\<package-menu-mode-map>
> -\\{package-menu-mode-map}"
> +  Letters do not insert themselves; instead, they are commands.
> +  \\<package-menu-mode-map>
> +  \\{package-menu-mode-map}"

Why this reformatting?  This will make the docstring look unusual in
C-h f, I think.

Thanks again for your patch.

Best regards,
Stefan Kangas




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41086; Package emacs. (Tue, 05 May 2020 01:40:02 GMT) Full text and rfc822 format available.

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

From: Stefan Kangas <stefankangas <at> gmail.com>
To: 41086 <at> debbugs.gnu.org
Subject: Fwd: bug#41086: [PATCH] Add user-defined column widths to
 package-list (package.el)
Date: Tue, 5 May 2020 03:39:09 +0200
[Message part 1 (text/plain, inline)]
---------- Forwarded message ---------
Från: Chris McMahan <cmcmahan <at> gmail.com>
Date: mån 4 maj 2020 kl 23:53
Subject: Re: bug#41086: [PATCH] Add user-defined column widths to
package-list (package.el)
To: Stefan Kangas <stefankangas <at> gmail.com>


Hell Stefan,

Yes, this is my first patch. I've been implementing this fix in my
emacs configs for at least 5 years, just assuming someone else would
see it.

Thank you very much for you comments. They were most helpful.

I have no problem signing the copyright. I just need some guidance on
the process.

The revised patch is attached, made with the command
  git format-patch -1
against savannah.org repository.

The changelog entry follows:

* package.el (package-menu-mode): User can now adjust the column widths of
the package menu by setting the values of the following defcustoms.

(package-name-column-width) New defcustom
(package-version-column-width) New defcustom
(package-status-column-width) New defcustom



Hopefully, that covered all of the changes. Thanks again for your help!

- Chris McMahan


On Mon, May 4, 2020 at 5:03 PM Stefan Kangas <stefankangas <at> gmail.com> wrote:
>
> Chris McMahan <cmcmahan <at> gmail.com> writes:
>
> > When executing the function `package-list-packages', the column widths are
> > too narrow, cutting off a significant
> > portion of the package names.
> >
> > This minor patch adds four variables that can be set by the user to adjust
> > the width of each column within the package list.
>
> Thanks for the patch, this makes sense.  I have some comments below.
>
> Is this your first patch to Emacs?  I can't find your name in the git
> log, but maybe I missed it.  Since your patch is over 15 lines, we
> would need a copyright assignment from you to be able to apply it.
> Would you be willing to sign such papers?
>
> Please see here for more: https://www.gnu.org/licenses/why-assign.html
>
> ---
>
> Now, here are my technical comments.
>
> Could you send your patch as formatted by 'git format-patch -1'
> instead?  It will make it easier for us to apply it.
>
> > Changelog entry
> > --------------------------------
> > 2020-05-04  Chris McMahan  <cmcmahan <at> gmail.com>
> >
> > * package.el ((define-derived-mode package-menu-mode tabulated-list-mode
> > "Package Menu"):
> > User can now adjust column widths of the package list by setting the values
> > of the following:
>
> This is better formatted like:
>
> * package.el (package-menu-mode): User can now adjust column widths of
> the package list by setting the values of the below defcustoms.
>
> > package-name-column-width (defaults to 30 columns)
> > package-version-column-width (14 column)
> > package-status-column-width (12 columns)
> > package-archive-column-width (14 columns)
>
> This should be formatted like so:
>
>     (package-archive-column-width): New defcustom.
>
> > +(defcustom package-name-column-width 30
> > +  "Column width of the 'Package' name within the package list
> > +invoked through `package-list-packages'."
> > +  :type 'number
> > +  :version "27.1")
>
> Should be :version "28.1", since this will most likely not go to the
> emacs-27 branch this close to the release.
>
> Also the first line should be a complete sentence in this defcustom
> and the others.  Please see M-x customize-group RET package RET if you
> want to see why.
>
> We prefer "package menu" to "package list".  I'm not sure why, but I
> think it has historical reasons.  Ideal or not, I think we should try
> to stay consistent.
>
> Possibly the docstrings could look something much like:
>
> "Column width for the Package name in the package menu."
>
> Refer to Info node `(elisp) Documentation Tips' for more.
>
> > -Letters do not insert themselves; instead, they are commands.
> > -\\<package-menu-mode-map>
> > -\\{package-menu-mode-map}"
> > +  Letters do not insert themselves; instead, they are commands.
> > +  \\<package-menu-mode-map>
> > +  \\{package-menu-mode-map}"
>
> Why this reformatting?  This will make the docstring look unusual in
> C-h f, I think.
>
> Thanks again for your patch.
>
> Best regards,
> Stefan Kangas



-- 
Chris McMahan <cmcmahan <at> gmail.com>
[0001-Allow-user-to-adjust-column-widths-in-the-package-me.patch (application/x-patch, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41086; Package emacs. (Tue, 05 May 2020 01:40:03 GMT) Full text and rfc822 format available.

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

From: Stefan Kangas <stefankangas <at> gmail.com>
To: 41086 <at> debbugs.gnu.org
Subject: Fwd: bug#41086: [PATCH] Add user-defined column widths to
 package-list (package.el)
Date: Tue, 5 May 2020 03:39:26 +0200
[Message part 1 (text/plain, inline)]
---------- Forwarded message ---------
Från: Chris McMahan <cmcmahan <at> gmail.com>
Date: tis 5 maj 2020 kl 03:10
Subject: Re: bug#41086: [PATCH] Add user-defined column widths to
package-list (package.el)
To: Stefan Kangas <stefankangas <at> gmail.com>


Hello Stephan,

Revised patch file is attached.

- Chris

On Mon, May 4, 2020 at 6:13 PM Stefan Kangas <stefankangas <at> gmail.com> wrote:
>
> Hi Chris,
>
> Chris McMahan <cmcmahan <at> gmail.com> writes:
>
> > Yes, this is my first patch.
>
> Welcome to Emacs!  Let's hope we see more contributions from you in
> the future.
>
> > I have no problem signing the copyright. I just need some guidance on the
> > process.
>
> OK, great.  Eli, could you please help Chris get started with the
> process?
>
> > The changelog entry follows:
> >
> > * package.el (package-menu-mode): User can now adjust the column widths of
> > the package menu by setting the values of the following defcustoms.
> >
> > (package-name-column-width) New defcustom
> > (package-version-column-width) New defcustom
> > (package-status-column-width) New defcustom
>
> Thank you, but could you add this as part of the commit message?  See
> the file CONTRIBUTE for more, or previous commits in the git repository.
>
> > Subject: [PATCH] Allow user to adjust column widths in the package menu
>
> Maybe better: "Customizable column widths in package menu"
>
> Other than that, looks good to me.  We just have to wait for your
> copyright assignment to come through before we can push it.
>
> Thanks again.
>
> Best regards,
> Stefan Kangas



-- 
Chris McMahan <cmcmahan <at> gmail.com>
[0001-Allow-user-to-adjust-column-widths-in-the-package-me.patch (application/x-patch, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41086; Package emacs. (Tue, 05 May 2020 01:43:01 GMT) Full text and rfc822 format available.

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

From: Stefan Kangas <stefankangas <at> gmail.com>
To: Chris McMahan <cmcmahan <at> gmail.com>, 41086 <at> debbugs.gnu.org
Subject: Re: bug#41086: [PATCH] Add user-defined column widths to package-list
 (package.el)
Date: Tue, 5 May 2020 03:42:35 +0200
Thanks.  Next time, please include 41086 <at> debbugs.gnu.org in the
senders list so we can keep an archive of the discussion for
reference.  It should be enough to hit "Reply to all" in your email
client for it to work automatically.

For now, I forwarded your two most recent messages there.  You can
read the archive at:
https://debbugs.gnu.org/cgi/bugreport.cgi?bug=41086

Best regards,
Stefan Kangas




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41086; Package emacs. (Tue, 05 May 2020 14:16:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Stefan Kangas <stefankangas <at> gmail.com>, Chris McMahan <cmcmahan <at> gmail.com>
Cc: 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, 05 May 2020 17:14:50 +0300
> From: Stefan Kangas <stefankangas <at> gmail.com>
> Date: Tue, 5 May 2020 03:39:09 +0200
> 
> The changelog entry follows:
> 
> * package.el (package-menu-mode): User can now adjust the column widths of
> the package menu by setting the values of the following defcustoms.
> 
> (package-name-column-width) New defcustom
> (package-version-column-width) New defcustom
> (package-status-column-width) New defcustom

Our style is slightly different, see CONTRIBUTE.  (Emacs actually has
commands that will help you format these log entries.)  It should look
like this in this case:

  Let user adjust the column widths of the package menu.
  * lisp/emacs-lisp/package.el (package-name-column-width)
  (package-version-column-width, package-status-column-width): New
  defcustoms.
  (package-menu-mode): Use the values of defcustoms instead of
  hardcoded values.  (Bug#41086)

> +(defcustom package-name-column-width 30
> +  "Column width for the Package name in the package menu."
> +  :type 'number
> +  :version "28.1")
> +
> +(defcustom package-version-column-width 14
> +  "Column width for the Package version in the package menu."
> +  :type 'number
> +  :version "28.1")
> +
> +(defcustom package-status-column-width 12
> +  "Column width for the Package status in the package menu."
> +  :type 'number
> +  :version "28.1")

These change the default values from the current hard-coded ones.  Any
reasons for that change?

>    (setq tabulated-list-format
> -        `[("Package" 18 package-menu--name-predicate)
> -          ("Version" 13 package-menu--version-predicate)
> -          ("Status"  10 package-menu--status-predicate)
> +        `[("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" 10 package-menu--archive-predicate)))

Why do we leave the "Archive" column width hard-coded?

Also, I see 13 in at least 2 more places in the code, are they
related?  If so, they should be changed to use the defcustom as well.

Finally, I think this warrants a NEWS entry.

Thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41086; Package emacs. (Tue, 05 May 2020 16:10:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Chris McMahan <cmcmahan <at> gmail.com>
Cc: 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, 05 May 2020 19:09:32 +0300
[Forwarding to everyone; please use Reply All.]

> From: Chris McMahan <cmcmahan <at> gmail.com>
> Date: Tue, 5 May 2020 11:28:13 -0400
> 
> Hi Eli,
> I hope I'm not being too difficult getting this set up.
> 
> The format for the patch commit message has been incorporated.
> 
> The other hardcoded values (13 in this case) are for aligning the labels and values in the package description
> page, and not related to the package-menu table that this patch covers.
> 
> On the question of the Archive column... I have been trying to figure out how to have the value of the variable
> substituted in to the list, rather than the variable name as a string.
> 
> Evaluating this code results in the following error:
> 
> [("Package" 30 package-menu--name-predicate) ("Version" 14 package-menu--version-predicate) ("Status"
> 12 package-menu--status-predicate) ("Archive" (\, package-archive-column-width)
> package-menu--archive-predicate) q ("Description" 0 package-menu--description-predicate)]
> 
>     (defcustom package-name-column-width 30
>       "Column width for the Package name in the package menu."
>       :type 'number
>       :version "28.1")
>     
>     (defcustom package-version-column-width 14
>       "Column width for the Package version in the package menu."
>       :type 'number
>       :version "28.1")
>     
>     (defcustom package-status-column-width 12
>       "Column width for the Package status in the package menu."
>       :type 'number
>       :version "28.1")
>     
>     (defcustom package-archive-column-width 12
>       "Column width for the Package status in the package menu."
>       :type 'number
>       :version "28.1")
>     
>     (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-status-column-width package-menu--archive-predicate)))
>             ("Description" 0 package-menu--description-predicate)])
>    
> 
> I can't figure out how to get it to use the value of package-archive-column-width and not the string literal.
> 
> I'll hold off another patch to try to solve this one. Any help you could offer would be greatly appreciated!




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41086; Package emacs. (Tue, 05 May 2020 17:13:02 GMT) Full text and rfc822 format available.

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

From: Chris McMahan <cmcmahan <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 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:12:26 -0400
[Message part 1 (text/plain, inline)]
I may have found a solution.... but I have no idea if it's a decent one....

;; 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
package-menu--archive-predicate)))
          ("Description" 0 package-menu--description-predicate)])

;; potential solution.... any thoughts?
(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)
    (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))))

- Chris


On Tue, May 5, 2020 at 12:09 PM Eli Zaretskii <eliz <at> gnu.org> wrote:

> [Forwarding to everyone; please use Reply All.]
>
> > From: Chris McMahan <cmcmahan <at> gmail.com>
> > Date: Tue, 5 May 2020 11:28:13 -0400
> >
> > Hi Eli,
> > I hope I'm not being too difficult getting this set up.
> >
> > The format for the patch commit message has been incorporated.
> >
> > The other hardcoded values (13 in this case) are for aligning the labels
> and values in the package description
> > page, and not related to the package-menu table that this patch covers.
> >
> > On the question of the Archive column... I have been trying to figure
> out how to have the value of the variable
> > substituted in to the list, rather than the variable name as a string.
> >
> > Evaluating this code results in the following error:
> >
> > [("Package" 30 package-menu--name-predicate) ("Version" 14
> package-menu--version-predicate) ("Status"
> > 12 package-menu--status-predicate) ("Archive" (\,
> package-archive-column-width)
> > package-menu--archive-predicate) q ("Description" 0
> package-menu--description-predicate)]
> >
> >     (defcustom package-name-column-width 30
> >       "Column width for the Package name in the package menu."
> >       :type 'number
> >       :version "28.1")
> >
> >     (defcustom package-version-column-width 14
> >       "Column width for the Package version in the package menu."
> >       :type 'number
> >       :version "28.1")
> >
> >     (defcustom package-status-column-width 12
> >       "Column width for the Package status in the package menu."
> >       :type 'number
> >       :version "28.1")
> >
> >     (defcustom package-archive-column-width 12
> >       "Column width for the Package status in the package menu."
> >       :type 'number
> >       :version "28.1")
> >
> >     (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-status-column-width
> package-menu--archive-predicate)))
> >             ("Description" 0 package-menu--description-predicate)])
> >
> >
> > I can't figure out how to get it to use the value of
> package-archive-column-width and not the string literal.
> >
> > I'll hold off another patch to try to solve this one. Any help you could
> offer would be greatly appreciated!
>


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

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41086; Package emacs. (Tue, 05 May 2020 17:26:02 GMT) Full text and rfc822 format available.

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

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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41086; Package emacs. (Tue, 05 May 2020 17:55:02 GMT) Full text and rfc822 format available.

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)]

Reply sent to Eli Zaretskii <eliz <at> gnu.org>:
You have taken responsibility. (Sat, 23 May 2020 08:22:02 GMT) Full text and rfc822 format available.

Notification sent to Chris McMahan <cmcmahan <at> gmail.com>:
bug acknowledged by developer. (Sat, 23 May 2020 08:22:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Chris McMahan <cmcmahan <at> gmail.com>
Cc: 41086-done <at> debbugs.gnu.org
Subject: Re: bug#41086: Fwd: bug#41086: [PATCH] Add user-defined column widths
 to package-list (package.el)
Date: Sat, 23 May 2020 11:21:31 +0300
> From: Chris McMahan <cmcmahan <at> gmail.com>
> Date: Tue, 5 May 2020 14:33:34 -0400
> 
> The latest patch, with a fix for package-archive-menu-width, is attached.

Thanks, pushed to the master branch.  I also added a NEWS entry
calling out the new options.

P.S.  Please always CC the bug address, so that the discussion gets
recorded by the bug tracker.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 20 Jun 2020 11:24:09 GMT) Full text and rfc822 format available.

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.