emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Matt Price <moptop99@gmail.com>
To: Christian Moe <mail@christianmoe.com>
Cc: tbanelwebmin <tbanelwebmin@free.fr>, Org Mode <emacs-orgmode@gnu.org>
Subject: Re: convert subtree or nested list to table
Date: Tue, 20 Jul 2021 11:11:08 -0400	[thread overview]
Message-ID: <CAN_Dec85EwDy6RYNjo6RmapqrpidZ3G36KerfrxS4kkeaCwzvg@mail.gmail.com> (raw)
In-Reply-To: <87v95l2dxa.fsf@christianmoe.com>

[-- Attachment #1: Type: text/plain, Size: 1190 bytes --]

Christian et al,

I seem to have broken something while fiddling around and I can't quite
make out what.  Would someone be willing to check for me whether this does
or does not produce the desired full table? Right now I am again getting a
truncated result and I'm not fully sure what I might be oding wrong.  Here
is what I have:

#+NAME: rubric-one
- Grade
  a. A
  b. B
  c. C
  d. D
  e. F
- Style
  a. Excellent
  b. Good
  c. Adequate
  d. Lousy
  e. Failing

#+NAME: list2table
#+BEGIN_SRC emacs-lisp :var order="columns" data=rubric-one :results table
value raw replace
 (let (longest)
    (setq data (map 'list '-flatten data))
    (setq data (map 'list (lambda (x) (seq-difference x '(unordered
ordered))) data))
    ;; Pad out lists to equal length
    (setq longest (seq-max (map 'list 'length data)))
    (setq data
          (map 'list
               (lambda (l)
                 (append l (make-list (- longest (length l)) "")))
                 data))
    ;; Order by columns or rows
    (if (string= order "columns")
        (apply #'mapcar* #'list data) ; transpose
      data))
#+END_SRC

#+RESULTS: list2table
| Grade |

----------------

thanks as always for the help!

[-- Attachment #2: Type: text/html, Size: 1579 bytes --]

  reply	other threads:[~2021-07-20 15:12 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-05 19:44 convert subtree or nested list to table Matt Price
2021-07-05 20:01 ` Juan Manuel Macías
     [not found]   ` <CAN_Dec8iqKS+3qvjkYvQxovegnEzqR_rra0Q-ZA9baPz1mXDAA@mail.gmail.com>
2021-07-06 12:56     ` Juan Manuel Macías
2021-07-07  6:18       ` Uwe Brauer
2021-07-07 18:27         ` Juan Manuel Macías
2021-07-07 18:44           ` Uwe Brauer
2021-07-07 21:16       ` Matt Price
2021-07-05 22:10 ` Tim Cross
2021-07-06  3:15   ` Matt Price
2021-07-06  5:10     ` Tim Cross
2021-07-06 11:00       ` Eric S Fraga
2021-07-06 11:49         ` Tim Cross
2021-07-06 11:50 ` Uwe Brauer
2021-07-07 21:17   ` Matt Price
2021-07-07 10:27 ` tbanelwebmin
2021-07-07 21:13   ` Matt Price
2021-07-08  9:27     ` tbanelwebmin
2021-07-08 12:22     ` Christian Moe
2021-07-20 15:11       ` Matt Price [this message]
2021-07-20 16:03         ` Nick Dokos
2021-07-20 17:03           ` Matt Price
2021-07-10 12:03 ` [a very different solution] (was: convert subtree or nested list to table) Uwe Brauer

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

  List information: https://www.orgmode.org/

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

  git send-email \
    --in-reply-to=CAN_Dec85EwDy6RYNjo6RmapqrpidZ3G36KerfrxS4kkeaCwzvg@mail.gmail.com \
    --to=moptop99@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=mail@christianmoe.com \
    --cc=tbanelwebmin@free.fr \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).