From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Chris McMahan Newsgroups: gmane.emacs.bugs Subject: 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-ID: References: <87imhbo1ku.fsf@stefankangas.se> <83eerympt1.fsf@gnu.org> <83zhaml5xf.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000001d68be05a4e9c10c" Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="70845"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 41086@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue May 05 19:13:30 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jW18L-000IIg-Ae for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 05 May 2020 19:13:29 +0200 Original-Received: from localhost ([::1]:49276 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jW18K-0005wv-CL for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 05 May 2020 13:13:28 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:39030) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jW17v-0005iu-1e for bug-gnu-emacs@gnu.org; Tue, 05 May 2020 13:13:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:53942) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jW17u-00063C-PI for bug-gnu-emacs@gnu.org; Tue, 05 May 2020 13:13:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jW17u-0005Pn-LF for bug-gnu-emacs@gnu.org; Tue, 05 May 2020 13:13:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Chris McMahan Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 05 May 2020 17:13:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 41086 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 41086-submit@debbugs.gnu.org id=B41086.158869876520770 (code B ref 41086); Tue, 05 May 2020 17:13:02 +0000 Original-Received: (at 41086) by debbugs.gnu.org; 5 May 2020 17:12:45 +0000 Original-Received: from localhost ([127.0.0.1]:37251 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jW17d-0005Ov-5G for submit@debbugs.gnu.org; Tue, 05 May 2020 13:12:45 -0400 Original-Received: from mail-qt1-f177.google.com ([209.85.160.177]:34022) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jW17b-0005Of-EP for 41086@debbugs.gnu.org; Tue, 05 May 2020 13:12:44 -0400 Original-Received: by mail-qt1-f177.google.com with SMTP id b1so2615400qtt.1 for <41086@debbugs.gnu.org>; Tue, 05 May 2020 10:12:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=rFIqrkzS/Grk1MiVF6tnB50LIJX5zfJYr8OBDi4PlSM=; b=ZzQXIXb1k2RJhUwzajtsP7oII5y7EaraHtoVbHAdgbkNKB1M+s7avmKZedERzfSFEb L8G7cdWredY3ZVj9pqeHL0xr0j5HfWxaXCtdg4nXC7UXTeJfxhOSnZETV5NexNQe5Zrl l7dLOV/SNZB+Um4Te+bHa1TX/q7wO/v+X2XeChFKEMAhIaUXt3JjzIZaVVd/fflkUaws FLPDDagJeI+AdtLgFTIvu7I6yFmGgw8SKyBGufQMtt6cUZEQo3MqXL2hx37hi63IF94G wyPJBUkvNl012ES/MRjl+XBWk+pWCRp9uNKWV5wQI3Mym7MhxPaIGh8qARWAVKsTQ5H2 H14A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=rFIqrkzS/Grk1MiVF6tnB50LIJX5zfJYr8OBDi4PlSM=; b=GUyktJeHZi+xiJje27n1PH8uoYpzGCnXbjJ4gRZ8KWPDruVYQuVUdX+5jFb1EiBN3Y 3+AzNf0orZJd/XDkp/iSHOi5l76LWRlzQoNtLHHyXomYaRR3mjwlC6jB+7moE0yNwG92 Qe2Ye07cGvs7fadPZiQm097Ein2Y3lDZuB92McG5Y9LY7erAo7BaU8H27WJCdxquq6LR S6eabSOR9H8hbcQJEY3lGOkaDesDpc71G8Dr/POgGpRuIx9S8Qe31aU0mjmCLtS81GFk LWivUA3lP/U1mam5ivQnAP/EXo+kETEqKTRYA03cTsa4DCjLQlEOMuRI27dHJBPv6mIC gxfw== X-Gm-Message-State: AGi0PuatbcXBJQq7zjNxrqf+8CVuPOBbzHgArW4qWLrdHD6XnsYXl6NR 6WuUxWNgjYsW+k0vpkNIBZ+IuSv/6J7pv6XsshMxO1WwYaE= X-Google-Smtp-Source: APiQypKMVkNdliDmJoFsPtWcEGYNqcs7h3qeEfcsYkO82fTGNuC0/JHGTELSdIibKgpkmNf3/bn/jb7ig06WbwRSY/8= X-Received: by 2002:ac8:6d35:: with SMTP id r21mr3633639qtu.210.1588698757817; Tue, 05 May 2020 10:12:37 -0700 (PDT) In-Reply-To: <83zhaml5xf.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:179746 Archived-At: --0000000000001d68be05a4e9c10c Content-Type: text/plain; charset="UTF-8" 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 wrote: > [Forwarding to everyone; please use Reply All.] > > > From: Chris McMahan > > 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 >* --0000000000001d68be05a4e9c10c Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
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 r= ather than hardcode=C2=A0it.
(setq tabulated-list-format
=C2=A0 =C2=A0 = =C2=A0 =C2=A0 `[("Package" ,package-name-column-width package-men= u--name-predicate)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ("Version&quo= t; ,package-version-column-width package-menu--version-predicate)
=C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 ("Status" =C2=A0,package-status-colu= mn-width =C2=A0package-menu--status-predicate)])
=C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 ,@(if (cdr package-archives)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 '(("Archive" ,package-archive-col= umn-width package-menu--archive-predicate)))
=C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 ("Description" 0 package-menu--description-predicate)])

;; potential solution.... any thoughts?
(setq tabulated-list-format=
=C2=A0 =C2=A0 =C2=A0 =C2=A0 `[("Package" ,package-name-column= -width package-menu--name-predicate)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = ("Version" ,package-version-column-width package-menu--version-pr= edicate)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ("Status" =C2=A0,p= ackage-status-column-width =C2=A0package-menu--status-predicate)])
(if (= cdr package-archives)
=C2=A0 =C2=A0 (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--descripti= on-predicate))))

- Chris


On Tue, May 5, 2020 at 12:09 = PM Eli Zaretskii <eliz@gnu.org> w= rote:
[Forwardin= g to everyone; please use Reply All.]

> From: Chris McMahan <cmcmahan@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 labe= ls 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&= quot; 14 package-menu--version-predicate) ("Status"
> 12 package-menu--status-predicate) ("Archive" (\, package-ar= chive-column-width)
> package-menu--archive-predicate) q ("Description" 0 package-= menu--description-predicate)]
>
>=C2=A0 =C2=A0 =C2=A0(defcustom package-name-column-width 30
>=C2=A0 =C2=A0 =C2=A0 =C2=A0"Column width for the Package name in t= he package menu."
>=C2=A0 =C2=A0 =C2=A0 =C2=A0:type 'number
>=C2=A0 =C2=A0 =C2=A0 =C2=A0:version "28.1")
>=C2=A0 =C2=A0 =C2=A0
>=C2=A0 =C2=A0 =C2=A0(defcustom package-version-column-width 14
>=C2=A0 =C2=A0 =C2=A0 =C2=A0"Column width for the Package version i= n the package menu."
>=C2=A0 =C2=A0 =C2=A0 =C2=A0:type 'number
>=C2=A0 =C2=A0 =C2=A0 =C2=A0:version "28.1")
>=C2=A0 =C2=A0 =C2=A0
>=C2=A0 =C2=A0 =C2=A0(defcustom package-status-column-width 12
>=C2=A0 =C2=A0 =C2=A0 =C2=A0"Column width for the Package status in= the package menu."
>=C2=A0 =C2=A0 =C2=A0 =C2=A0:type 'number
>=C2=A0 =C2=A0 =C2=A0 =C2=A0:version "28.1")
>=C2=A0 =C2=A0 =C2=A0
>=C2=A0 =C2=A0 =C2=A0(defcustom package-archive-column-width 12
>=C2=A0 =C2=A0 =C2=A0 =C2=A0"Column width for the Package status in= the package menu."
>=C2=A0 =C2=A0 =C2=A0 =C2=A0:type 'number
>=C2=A0 =C2=A0 =C2=A0 =C2=A0:version "28.1")
>=C2=A0 =C2=A0 =C2=A0
>=C2=A0 =C2=A0 =C2=A0(setq tabulated-list-format
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0`[("Package" ,packag= e-name-column-width package-menu--name-predicate)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0("Version" ,p= ackage-version-column-width package-menu--version-predicate)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0("Status"=C2= =A0 ,package-status-column-width=C2=A0 package-menu--status-predicate)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0,@(if (cdr package-arch= ives)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&#= 39;(("Archive" ,package-status-column-width package-menu--archive= -predicate)))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0("Description"= ; 0 package-menu--description-predicate)])
>=C2=A0 =C2=A0
>
> I can't figure out how to get it to use the value of package-archi= ve-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@gmail.com>
--0000000000001d68be05a4e9c10c--