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: Mon, 26 Oct 2020 22:21:57 +0100 Message-ID: References: <6d9d638cf2dbdcbbddf80be8e9845318b0e154cd.camel@gmail.com> <871rhl4661.fsf@gnus.org> <87y2jsu1xn.fsf@gnus.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000d8cdb105b299853f" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="12921"; 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 Mon Oct 26 22:23:18 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 1kX9xW-0003Ef-1i for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 26 Oct 2020 22:23:18 +0100 Original-Received: from localhost ([::1]:39710 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kX9xT-0003bO-RJ for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 26 Oct 2020 17:23:17 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:57608) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kX9xG-0003a8-RY for bug-gnu-emacs@gnu.org; Mon, 26 Oct 2020 17:23:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:58377) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kX9xG-0008Bm-H2 for bug-gnu-emacs@gnu.org; Mon, 26 Oct 2020 17:23:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kX9xG-0000KX-Ch for bug-gnu-emacs@gnu.org; Mon, 26 Oct 2020 17:23:02 -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 21:23:02 +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: moreinfo Original-Received: via spool by 44229-submit@debbugs.gnu.org id=B44229.16037473361186 (code B ref 44229); Mon, 26 Oct 2020 21:23:02 +0000 Original-Received: (at 44229) by debbugs.gnu.org; 26 Oct 2020 21:22:16 +0000 Original-Received: from localhost ([127.0.0.1]:41686 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kX9wW-0000J4-IU for submit@debbugs.gnu.org; Mon, 26 Oct 2020 17:22:16 -0400 Original-Received: from mail-ua1-f43.google.com ([209.85.222.43]:46104) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kX9wU-0000Io-CH for 44229@debbugs.gnu.org; Mon, 26 Oct 2020 17:22:14 -0400 Original-Received: by mail-ua1-f43.google.com with SMTP id y1so3320424uac.13 for <44229@debbugs.gnu.org>; Mon, 26 Oct 2020 14:22:14 -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=2zkFMndbFt8XtYT4FoDd1tbCWVfK109KVgdvbEJirV0=; b=cNsLuKRj8aV8SS4xxruq/ZqfdWiUONYAt38q/19aRlsoskds2YBBEIJdHzgxMjDAoD FGtsuubhm/BZVBqVuQ+lCqCeH1hMW2E106fky4pNlkSL/NSDOUcI2rtwtAxpUdxZWtSd +9hOgpoqIN6Xva+ZzeZV1D6JYcNCXMoQ+NmEYR8FNI3hGhMUl9Z6YfeE2U1KePGd9VRv UTKxCBF51xZkGE2j+lQbOiX0nW0yH+mZ7Ly7mWXeBfwoifkCGSrl5Zzc3YBOKUhzNp7Y 4TgphHVEcYZBtoMBx5OUkuss2+o/EK18irKdMnqeZXDijPRRj17cOjG6VB4IVOAlgFBA kRyw== 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=2zkFMndbFt8XtYT4FoDd1tbCWVfK109KVgdvbEJirV0=; b=JwMNa4+z2XmL76BWdoOi5Z/Qbv2DR0GHF7TOP8OUTx5m+pxhCT6Tr+CoRXlNbD28cd rH5f6/PiTkk4ug5FrvSqRPZbhB/KXymY411sFCXkZYMjWU8H8wQQklDIRtF/YPD7k0Lt /Gr9U8rjKDK4nLgkvCMenT6d7A79kBHkdtHVSFBXMH9pL8V+oYRsirxcWQeNps3tQzPT a7w9kRU2eWOyTsn9OEu3IALG0G2PJe/441p5rSAVvLnpSjrseCUP+/aqzR6PohJ1fyIR PFpNPx251CvLuKvMqfEQiqfs9qj/IWY61sX5S4BSRCT7QCRTh/DdnABYmOFMdCy0KFxG v0NA== X-Gm-Message-State: AOAM531zJqcVWD8Okhk8/Q0piSuF1G6vEBNfrw6qFPr2BaHhDZ1VCQyH 7zp48Za+nw88wBOquE0rwbndBh3/KHRFhk3yUGW7cE4nh5qfcQ== X-Google-Smtp-Source: ABdhPJx1JR0kInZOHD3zLzJnAgTaQBoZejPZ1vLWBQaE0puiAAe/R9/JsAMEPaM54RVfh9RqYxFKWm7fsFITIrO/1sc= X-Received: by 2002:ab0:7598:: with SMTP id q24mr14290554uap.109.1603747328870; Mon, 26 Oct 2020 14:22:08 -0700 (PDT) In-Reply-To: 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:191668 Archived-At: --000000000000d8cdb105b299853f Content-Type: text/plain; charset="UTF-8" So I just replaced the widths in the `tabulated-list-entries` with the variables defined in the first two lines On Mon, 26 Oct 2020 at 22:20, dalanicolai wrote: > (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)) > > (let ((buf (switch-to-buffer "tablist-bug-demo"))) > (with-current-buffer buf > (tabular-bug-demo-mode) > (setq-local tabulated-list-entries (list (list nil ["1" "so > unfortunately this"]) > (list nil ["2" "does not > work"]) > (list nil ["3" "when using > variables"]))) > (tabulated-list-print))) > > On Mon, 26 Oct 2020 at 22:20, dalanicolai wrote: > >> Ah okay, so therefore I added that text you sent me in the reply. But >> anyway, I will send the non-working code... >> >> >> On Mon, 26 Oct 2020 at 22:12, Lars Ingebrigtsen wrote: >> >>> dalanicolai writes: >>> >>> > Sorry, don't know what went wrong. Is it okay that I send you this >>> link to my >>> > original message (which does include the code)? >>> >>> That link only has the code that you says works, not the code that you >>> says failed, as far as I can tell? >>> >>> So post the code that fails instead. >>> >>> -- >>> (domestic pets only, the antidote for overdose, milk.) >>> bloggy blog: http://lars.ingebrigtsen.no >>> >> --000000000000d8cdb105b299853f Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
So I just replaced the widths in the `tabulated-list-entri= es` with the variables defined in the first two lines

On Mon, 26 Oct 202= 0 at 22:20, dalanicolai <dalani= colai@gmail.com> wrote:
(defvar col1-width 4)
(defvar col2-width= 10)

(define-derived-mode tabular-bug-demo-mode
=C2=A0 tabulated-= list-mode "tab-bug"
=C2=A0 "Major mode for Tab-bug."=
=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("Co= l2" col2-width nil)])
=C2=A0 (tabulated-list-init-header))

(= let ((buf (switch-to-buffer "tablist-bug-demo")))
=C2=A0 (with= -current-buffer buf
=C2=A0 =C2=A0 (tabular-bug-demo-mode)
=C2=A0 =C2= =A0 (setq-local tabulated-list-entries (list (list nil ["1" "= ;so
unfortunately this"])
=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 =C2=A0 =C2=A0 =C2=A0 =C2=A0(list nil ["2" &q= uot;does not
work"])
=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 =C2=A0 =C2=A0 =C2=A0 =C2=A0(list nil ["3" "= ;when using
variables"])))
=C2=A0 =C2=A0 (tabulated-list-print))= )

On Mon, 26 Oct 2020 at 22:20, dalanicolai <dalanicolai@gmail.com> wrote:
=
Ah okay, so therefore I added that text you sent me in the reply. But an= yway, I will send the non-working code...


On Mon, 26 Oc= t 2020 at 22:12, Lars Ingebrigtsen <larsi@gnus.org> wrote:
dalanicolai <dalanicolai@gmail.com> writes:

> Sorry, don't know what went wrong. Is it okay that I send you this= link to my
> original message (which does include the code)?

That link only has the code that you says works, not the code that you
says failed, as far as I can tell?

So post the code that fails instead.

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