From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: uzibalqa Newsgroups: gmane.emacs.help Subject: Re: Format of lists and alists required for displaying lists of tabulated data Date: Sun, 18 Jun 2023 10:36:36 +0000 Message-ID: References: <648d6296.050a0220.f0b55.8bfc@mx.google.com> <87o7ldhksu.fsf@vagabond.tim-landscheidt.de> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="15146"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Bruno Barbier , help-gnu-emacs@gnu.org To: Tim Landscheidt Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sun Jun 18 12:37:28 2023 Return-path: Envelope-to: geh-help-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 1qApmh-0003mJ-OH for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 18 Jun 2023 12:37:27 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qApmE-0005Zy-AQ; Sun, 18 Jun 2023 06:36:58 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qApmB-0005Y6-Rt for help-gnu-emacs@gnu.org; Sun, 18 Jun 2023 06:36:55 -0400 Original-Received: from mail-40132.protonmail.ch ([185.70.40.132]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qApm8-0005IE-AT for help-gnu-emacs@gnu.org; Sun, 18 Jun 2023 06:36:55 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=proton.me; s=l724i6jvnbdthj6miq2tjrmt7y.protonmail; t=1687084608; x=1687343808; bh=rad9NML8LhAcENFkUXzLso+BVncVGKaJRtPrpgp84Xk=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=lpa0X2YiU0eryLb76FXZCeSwxRZ8XiODYnAMN5S9iFMk50s4recQIv89nwGGzIeHG XWxEZGmBP6Vw4uWWY584sEI/gKPbLqcHvXdW6AD2lVZtqQctTj965sodtIUzyeYk/K C7PlUi4CWRWOGpfh2FP0/p9mkF3F9h08PQ4KVR1d1Z4v6IXI/4xwMHUJOKCzTQTnyZ rjagvGDAcbwiNfSkncMnecyA22lncMWVltHwuiyeNKUCuozIOpyV52uEZckXvUQdrQ SIpA8Lk4RplyBYbEfk2utm3V7VFloWVsHfqbT3G2L7UOtCFfpWQUiKVFhYYlE3xHNf aLSmyw8n8+e6Q== In-Reply-To: <87o7ldhksu.fsf@vagabond.tim-landscheidt.de> Feedback-ID: 52887082:user:proton Received-SPF: pass client-ip=185.70.40.132; envelope-from=uzibalqa@proton.me; helo=mail-40132.protonmail.ch X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:143980 Archived-At: ------- Original Message ------- On Sunday, June 18th, 2023 at 8:54 AM, Tim Landscheidt wrote: > uzibalqa uzibalqa@proton.me wrote: >=20 > > > > The file tabulated-list.el does not describe the format of lists an= d alists > > > > required for displaying lists of tabulated data. > > > >=20 > > > > Could some information be added, please ? >=20 > > > The documentation of 'tabulated-list-mode' > > > (describe-function 'tabulated-list-mode) >=20 > > > points to the documentation of 'tabulated-list-format' and the > > > documentation of 'tabulated-list-entries'. >=20 > > > Is that what you're looking for ? >=20 > > Yes, the description of tabulated-list-entries states that the input > > if a list, each element has the form (ID [DESC1 ... DESCN]). >=20 > > [=E2=80=A6] >=20 >=20 > Not only that, but it also explains what ID is and what DESC > can be and what effects it has. So what data have you set > tabulated-list-entries to and how does it fail to do what > you want? >=20 > Tim I am trying to print a header and also some text to the buffer, and not being successful. (defun tlprint-alist (alist &optional outbufr keytl valtl) "Print an associated list via `tabulated-list-print'." (let* ( (bufr (or outbufr (get-buffer-create "*Alist2*"))) (keytl (or keytl "Key Title")) (valtl (or valtl "Value Title")) ) (with-current-buffer bufr (tabulated-list-mode) (setq buffer-read-only nil) (setq tabulated-list-format (vector (list keytl 20 t) (list valtl 20 t))) (setq tabulated-list-sort-key (cons keytl nil)) (setq tabulated-list-entries (mapcar (lambda (dyad) (list (car dyad) (cdr dyad))) alist)) (tabulated-list-init-header) (insert keytl valtl "\n") (insert "TEST \n") (princ "Text to be written" (current-buffer)) (tabulated-list-print) ))) (setq foo '((a . ["aa1" "aa2"]) (b . ["bb1" "bb2"]) (c . ["cc1" "cc2"]))) (tlprint-alist foo)