all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: uzibalqa <uzibalqa@proton.me>
To: Jean Louis <bugs@gnu.support>
Cc: Christopher Dimech <dimech@gmx.com>,
	Bruno Barbier <brubar.cs@gmail.com>,
	uzibalqa via Users list for the GNU Emacs text editor
	<help-gnu-emacs@gnu.org>
Subject: Re: Format of lists and alists required for displaying lists of tabulated data
Date: Mon, 19 Jun 2023 18:59:28 +0000	[thread overview]
Message-ID: <e415HBjOQWUwg-dA-6jzaKmzYN8aXOLOpDSZXmbY4AmmFpxmWfJF-SSVGZJDOylL3EPlKKTjb3t9MWma-0gnQOpWkBNstppjmRP5_DOcf14=@proton.me> (raw)
In-Reply-To: <ZJCjLWXGpQm5w6bM@lco.syogm.com>

------- Original Message -------
On Tuesday, June 20th, 2023 at 6:49 AM, Jean Louis <bugs@gnu.support> wrote:


> * Christopher Dimech dimech@gmx.com [2023-06-18 22:16]:
> 
> > The functions could be difficult to use because of the many calls to your "rcd-" functions.
> > Perhaps we can come up with something more adept to users to try. Using same idea of
> > an ID followed by values.
> 
> 
> Yes, good idea. But I did not find use of it for me. All my PostgreSQL database tables follow certain pattern as described by:
> 
> GeDaFe - PostgreSQL Generic Database Interface:
> http://gedafe.github.io/doc/gedafe-sql.en.html
> 
> and should be compatible with the web interface as well in that
> sense. I did not test it for years, since I switched to Emacs
> interface.
> 
> They follow this pattern "mytable_" plus "id", so there is always
> "ID" which serves handy for tabulated-list-mode
> 
> -- ------------------------------------------
> -- ------------ Table mytable
> -- ------------------------------------------
> DROP SEQUENCE mytable_id_seq;
> 
> CREATE TABLE mytable (
> mytable_id SERIAL NOT NULL PRIMARY KEY,
> mytable_uuid UUID NOT NULL DEFAULT gen_random_uuid() UNIQUE,
> mytable_datecreated TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL,
> mytable_datemodified TIMESTAMP,
> mytable_usercreated TEXT NOT NULL DEFAULT current_user,
> mytable_usermodified TEXT NOT NULL DEFAULT current_user,
> mytable_name TEXT,
> mytable_title TEXT,
> mytable_description TEXT,
> mytable TEXT
> );

How can I adapt the following to print a table with multiple values rather that one ?

(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) )))




  reply	other threads:[~2023-06-19 18:59 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-16 21:08 Format of lists and alists required for displaying lists of tabulated data uzibalqa
2023-06-17  7:36 ` Bruno Barbier
2023-06-17 12:33   ` uzibalqa
2023-06-17 20:54     ` Tim Landscheidt
2023-06-18 10:36       ` uzibalqa
2023-06-18 11:29         ` Tim Landscheidt
2023-06-18 13:20           ` uzibalqa
2023-06-18 13:37           ` uzibalqa
2023-06-18 13:51             ` uzibalqa
2023-06-18 15:31     ` Jean Louis
2023-06-18 19:11       ` uzibalqa
2023-06-19 18:46         ` Jean Louis
2023-06-18 19:16       ` Christopher Dimech
2023-06-19 18:49         ` Jean Louis
2023-06-19 18:59           ` uzibalqa [this message]
2023-06-21  4:48             ` Jean Louis
2023-06-21 10:45               ` uzibalqa
2023-06-24 19:19                 ` Jean Louis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='e415HBjOQWUwg-dA-6jzaKmzYN8aXOLOpDSZXmbY4AmmFpxmWfJF-SSVGZJDOylL3EPlKKTjb3t9MWma-0gnQOpWkBNstppjmRP5_DOcf14=@proton.me' \
    --to=uzibalqa@proton.me \
    --cc=brubar.cs@gmail.com \
    --cc=bugs@gnu.support \
    --cc=dimech@gmx.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.