help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Format of lists and alists required for displaying lists of tabulate


From: uzibalqa
Subject: Re: Format of lists and alists required for displaying lists of tabulated data
Date: Wed, 21 Jun 2023 10:45:45 +0000

------- Original Message -------
On Wednesday, June 21st, 2023 at 4:48 PM, Jean Louis <bugs@gnu.support> wrote:


> * uzibalqa uzibalqa@proton.me [2023-06-19 22:00]:
> 
> > (setq foo '((a . ["aa1" "aa2"]) (b . ["bb1" "bb2"]) (c . ["cc1" "cc2"])))
> > (tlprint-alist foo)
> > 
> > (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)
> > (tabulated-list-print) )))
> 
> 
> It works! - Jean

It works indeed.  But instead of just a dyad (a key and value), I want to handle
an arbitrary number of values.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]