From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: dalanicolai Newsgroups: gmane.emacs.bugs Subject: bug#44229: 27.1; Can not set tabulated-list-format with variable Date: Tue, 27 Oct 2020 00:35:54 +0100 Message-ID: References: <6d9d638cf2dbdcbbddf80be8e9845318b0e154cd.camel@gmail.com> <871rhl4661.fsf@gnus.org> <87y2jsu1xn.fsf@gnus.org> <87o8kou1as.fsf@gnus.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000db564305b29b64b6" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="33421"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 44229@debbugs.gnu.org To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Oct 27 00:37:37 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 1kXC3V-0008bR-AQ for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 27 Oct 2020 00:37:37 +0100 Original-Received: from localhost ([::1]:44982 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kXC3U-0004SI-BN for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 26 Oct 2020 19:37:36 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:60410) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kXC2w-0004Ih-7E for bug-gnu-emacs@gnu.org; Mon, 26 Oct 2020 19:37:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:58693) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kXC2v-0001D1-To for bug-gnu-emacs@gnu.org; Mon, 26 Oct 2020 19:37:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kXC2v-0001xe-Q3 for bug-gnu-emacs@gnu.org; Mon, 26 Oct 2020 19:37:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: dalanicolai Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 26 Oct 2020 23:37:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 44229 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: notabug moreinfo Original-Received: via spool by 44229-submit@debbugs.gnu.org id=B44229.16037553727468 (code B ref 44229); Mon, 26 Oct 2020 23:37:01 +0000 Original-Received: (at 44229) by debbugs.gnu.org; 26 Oct 2020 23:36:12 +0000 Original-Received: from localhost ([127.0.0.1]:42006 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kXC28-0001wO-Bi for submit@debbugs.gnu.org; Mon, 26 Oct 2020 19:36:12 -0400 Original-Received: from mail-ua1-f44.google.com ([209.85.222.44]:42125) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kXC26-0001w9-UL for 44229@debbugs.gnu.org; Mon, 26 Oct 2020 19:36:11 -0400 Original-Received: by mail-ua1-f44.google.com with SMTP id f15so3417587uaq.9 for <44229@debbugs.gnu.org>; Mon, 26 Oct 2020 16:36:10 -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=QGezc/Sjasljs+SLp4T8xFXS6OwcOyclF3E5YjfYGA0=; b=q4P74Fqy5v/C+lh3k2vZ2Fyktwas7Zr2Su76GKw3irnxMZxh3tqcQPDiWrKcvND5Pd 5hyeI4TwqVOC6iz93CJSEl4KwGI3EAChnzf1/9AdpbSTxWSnQOJ6CjG37Oabhf08gGx/ fN+1ZfRhIR0NYiGOBSyobYBMkUE1oIbpkO1G4bL5D6v57f2rw+nPasXY1y72LXdQZUCy 9L0j+3AgZk6pOOp9VbKU6ZUepJRGsdWif64+Bz/w8znJeDHlsc19HAh2icfhgBDKgCT9 Iq4PI4vhMA8Iyf3i2OmDiew3Cv7tw+8YoIgqkjQbmHmVDoVppd0KxiDH4vk/4BEvjaQy velA== 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=QGezc/Sjasljs+SLp4T8xFXS6OwcOyclF3E5YjfYGA0=; b=C/SpShB4pXDJoodv1ClM32EIyZgTsc2TAukbs1cgitD6IPCDOfbqaDbr0Bes3v/v5N q9XHWZwMTE2sZuGV8Hb+NYsauA6iFuxnwq8tWsDkPY20+rD1Q7NFK1stde/tD4aUpgz5 Dla+P2+ju/W4Atdqf+lp6cfLyCw0h/AAH3s4cjzMGP30F9QVcrYnS3VzwUXd/+t09t/F mN0UxeKGubhMA8iq8huZh5V1h4OfQKLyPP7QvfCxppeBvoTGjrgcrSms4MT7j8ggDzj7 KwJ/YCcc6neXkn0RGuChX0EkrMdvHXk4osY6jMRKUqZsPp6QhX7CHopvsXYhBHaC7Zym o4qg== X-Gm-Message-State: AOAM533/DwtPu1mifSZ3pQvP1ZbYuarbr6NF8CiPh++9f2IR9kFcDD7L 9TuZNCUj9cOpV7A/5xF238WshaNI06SCnmqH9Us= X-Google-Smtp-Source: ABdhPJxx09eCRBj7GbUajMF92Aj6MHgaCLVaXXVxn0XI42sdqE7XLqk672x3aOXxfYk7QZrGSVzQ3+Z8pUwkHDzqRk0= X-Received: by 2002:ab0:7490:: with SMTP id n16mr23696316uap.134.1603755365323; Mon, 26 Oct 2020 16:36:05 -0700 (PDT) In-Reply-To: <87o8kou1as.fsf@gnus.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:191688 Archived-At: --000000000000db564305b29b64b6 Content-Type: text/plain; charset="UTF-8" Aha, Indeed I was not aware that the vector behaves similar to a quoted list (although I could have implied that from the behavior). So thank you very much for showing me the right way. On Mon, 26 Oct 2020 at 22:26, Lars Ingebrigtsen wrote: > dalanicolai writes: > > > (defvar col1-width 4) > > (defvar col2-width 10) > > > > (define-derived-mode tabular-bug-demo-mode > > tabulated-list-mode "tab-bug" > > "Major mode for Tab-bug." > > (setq-local tabulated-list-format [("Col1" col1-width nil) > > ("Col2" col2-width nil)]) > > (tabulated-list-init-header)) > > [] quotes whatever you feed it, so that's not a list with a string, a > number and nil, but a string, a symbol, and nil. > > You probably want > > `[("Col1" ,col1-width nil) > ("Col2" ,col2-width nil)] > > or use the functions `vector' and `list' instead of literals. > > -- > (domestic pets only, the antidote for overdose, milk.) > bloggy blog: http://lars.ingebrigtsen.no > --000000000000db564305b29b64b6 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Aha, Indeed I was not aware that the vector behaves simila= r to a quoted list (although I could have implied that from the behavior). = So thank you very much for showing me the right way.

On Mon, 26 Oct 2020= at 22:26, Lars Ingebrigtsen <larsi@gn= us.org> wrote:
dalanicolai <dalanicolai@gmail.com> writes:

> (defvar col1-width 4)
> (defvar col2-width 10)
>
> (define-derived-mode tabular-bug-demo-mode
>=C2=A0 =C2=A0tabulated-list-mode "tab-bug"
>=C2=A0 =C2=A0"Major mode for Tab-bug."
>=C2=A0 =C2=A0(setq-local tabulated-list-format [("Col1" col1-= width nil)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ("Col2&= quot; col2-width nil)])
>=C2=A0 =C2=A0(tabulated-list-init-header))

[] quotes whatever you feed it, so that's not a list with a string, a number and nil, but a string, a symbol, and nil.

You probably want

`[("Col1" ,col1-width nil)
=C2=A0 ("Col2" ,col2-width nil)]

or use the functions `vector' and `list' instead of literals.

--
(domestic pets only, the antidote for overdose, milk.)
=C2=A0 =C2=A0bloggy blog: http://lars.ingebrigtsen.no
--000000000000db564305b29b64b6--