From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id eMvhOS8Z5mBIWgAAgWs5BA (envelope-from ) for ; Wed, 07 Jul 2021 23:14:23 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id EMSHNS8Z5mCKVgAAB5/wlQ (envelope-from ) for ; Wed, 07 Jul 2021 21:14:23 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 19C891E881 for ; Wed, 7 Jul 2021 23:14:23 +0200 (CEST) Received: from localhost ([::1]:36900 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m1Es8-0001RL-Mm for larch@yhetil.org; Wed, 07 Jul 2021 17:14:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33606) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m1ErQ-0001R4-19 for emacs-orgmode@gnu.org; Wed, 07 Jul 2021 17:13:36 -0400 Received: from mail-vs1-xe2a.google.com ([2607:f8b0:4864:20::e2a]:42897) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m1ErO-00044T-8b for emacs-orgmode@gnu.org; Wed, 07 Jul 2021 17:13:35 -0400 Received: by mail-vs1-xe2a.google.com with SMTP id f7so902372vsa.9 for ; Wed, 07 Jul 2021 14:13:32 -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; bh=XE2lJ15UzaHU44QI+eewTtH7gUWElB2tW9ZhlqWC87o=; b=rX+Qu7JR1wF0wwK+O0gYlYpt2UgjPNIu3ayoTVq+xaWH8QgT9FoyKk0dPnNE5Mjjqx CVO+A+qlDyYEVwQXf+WGuZWVLdetJr6loLvbXxfoEYmDKHLdZXIFzxnEKetTeuiHZoks rxfOjVtUkSdORF7tZFb6mpVXdeKhjaJL5vLk9I99cL+JbBLu3W2MSkbs35Yyv9H2KbhL QKwGTdvXxq7N6J4kBuuPMD0WWyRrg7yJo55GHT+x9W2L7gPekNXask7HMaSaP70TtI15 6c9P1p3TubxrDMA7nrNJlFFtXaYEh8J88eNQzZBxqsiDpOsaaHu91Gcl/Z2Hs65jEoWO eU8Q== 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; bh=XE2lJ15UzaHU44QI+eewTtH7gUWElB2tW9ZhlqWC87o=; b=MYbz/r5AwrE0hwzKWAR2vuDlv6xDp6y8sHrO+L7oN56TmwXaqOv4FYtKzofUdVKdav OGbjKCFwDCgL1L3yjYWUQ4C3rNenkpa/Z/guaNX2sAp6RVCo38CRQuSbIICMPfDQl+hd L6WdK+DdmUGKlOB+5JmqCiD/e9dx9f7AhxdzDW0sXj5ffS+BkpPY1aIRqMHyB/QwOFSM RSwY3b1oQr5GaraJLkjP7qCZsAFqEJTdkgBIMfqLJ3lVQ4ayK6u+Hf0mEfRAZYmyxu85 Qh42xBoiP439tqHnd0XRufft33CkFcAZ5y1cOMdN71kGIG3AiTL8BYjr6CEUC97y5nmH UzKQ== X-Gm-Message-State: AOAM531Ie/cXZ2/hgXUl/pGc7KqqGRWvIyFbdm/eWl3tU549SKactdH5 U6eHhjfmQTP33t4MObW2zwOVpgV6GKQWG8PHOE4= X-Google-Smtp-Source: ABdhPJzJODVm1tnF0dqzAgDJV6a0C8KsM/mX1Ny/G/AvLgtfYVm/nrWe+FYTB+PY1aTvv3jxVl1UHZQDPW/mfsQdiks= X-Received: by 2002:a05:6102:e0a:: with SMTP id o10mr23679256vst.30.1625692411965; Wed, 07 Jul 2021 14:13:31 -0700 (PDT) MIME-Version: 1.0 References: <26be9301-9e1a-0dc0-47c7-53e7ffc3e6d3@free.fr> In-Reply-To: <26be9301-9e1a-0dc0-47c7-53e7ffc3e6d3@free.fr> From: Matt Price Date: Wed, 7 Jul 2021 17:13:20 -0400 Message-ID: Subject: Re: convert subtree or nested list to table To: tbanelwebmin , Org Mode Content-Type: multipart/alternative; boundary="000000000000bab3c905c68f0260" Received-SPF: pass client-ip=2607:f8b0:4864:20::e2a; envelope-from=moptop99@gmail.com; helo=mail-vs1-xe2a.google.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 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, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1625692463; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=XE2lJ15UzaHU44QI+eewTtH7gUWElB2tW9ZhlqWC87o=; b=rqWp8bn/QQPe0vbpeCkvbeXE1tUAE1OvOAUsytqAV+HomaQCPeXtvE8yt5M3xxJm2k2Sa+ 51yxTdk4ji2Bo/qoFzeI4v3LyO8/vHSOVuvuoSfMEcDaxxeNBXnWBbrwnKPIql+FUBhXCI djBS1QKy8HnGb6i8VR77M3c/ZveBnNFiUiL+sCSy3N5da4gybfGEwVJc482vKEYkga5aze 2L8AgcKyD/X9b7FhylikrIwuyqwPinfHFxfLFVmCPjxMvOXie/MxI4Vj025hYi/vM3wE8z PVDVUyk5OCbSgVFviCRAWRYpMoTzktgrlaG8WdQHNZcCWebCG7ojjK4TYW62ZA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1625692463; a=rsa-sha256; cv=none; b=TQ2BTm8BErc3+wUMxDwKH8ChqRQFeuUXyHTfcLxOAIbEK1nnMNZlQMMrJk15gH9XFqUYao 6Extmj67utsc43CfgS+QYF5EDHpom+NmB1pqmjvdUJvV5f9rdljjaWdOZx5/34ZnJ8WnpZ sJfZiiKduArVvoqnPIx1MLZEJ0PHlzRNJaUOwd2+foshPe+rFRYDrAeD3xVa8hzdPlblkz M871HopfTyWo5tLCvpN9tYAnguaWci7YulfYyBsORhoU1PLAc6zsBOl2yyWY/gsih30qGe CwFHM5r3nWZ4V3dXiTXI+CLKCftpg/53NnYLS+Gk5wGnEjXXNW2fwh8iYSQJvQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=rX+Qu7JR; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Spam-Score: -3.11 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=rX+Qu7JR; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Queue-Id: 19C891E881 X-Spam-Score: -3.11 X-Migadu-Scanner: scn0.migadu.com X-TUID: 1ziRK4PUBstp --000000000000bab3c905c68f0260 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable I think this is exactly what I want (with just a little moreprocessing). Thank you so much for the idea! I'm having a little bit of trouble getting the same output as you though, and I'm wondering if there might be a setting that I need to change. Here is what I tried, and the result. Do you have an idea of what is going wrong here? Thank you! ------------ #+NAME:essay-rubric - Category - A - B - C - D - F - Writing - great - good - ok - lousy - awful #+begin_src emacs-lisp :var contents=3Dessay-rubric :results table contents #+end_src #+RESULTS: #+begin_src emacs-lisp | (("Category" | #+end_src ------------- On Wed, Jul 7, 2021 at 6:29 AM tbanelwebmin wrote: > Hi Matt > > Le 05/07/2021 =C3=A0 21:44, Matt Price a =C3=A9crit : > > I have to write a number of text-heavy documents which need to be > > delivered as tables with wrapped paragraphs in most cells. Working > > directly in table format is pretty arduous and uncomfortable. Has > > anyone ever written a function to accept a list or subtree as input > > and process it into a table? > > > > If anyone has done something similar, I'd love some tips! > > Maybe you could use builtin Babel > Hereafter you have a starting point > - Give a name to your input Org list > - Process it with Emacs-Lisp (or whatever language you are comfortable > with) to output it as a table > > > ____ self contained Org Mode example _____ > > Example of a named list > #+NAME: BBB > - abc > + 123 > + 456 > - def > + red > + blue > - ghi > + big > + small > > Example of converting the named list into a table with Emacs-Lisp > #+begin_src elisp :var bbb=3DBBB :results table > bbb > #+end_src > > #+RESULTS: > | abc | (unordered (123) (456)) | > | def | (unordered (red) (blue)) | > | ghi | (unordered (big) (small)) | > ___________________________________________ > > > --000000000000bab3c905c68f0260 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I think this is exactly what I want (with just a litt= le moreprocessing).=C2=A0 Thank you so much for the idea!=C2=A0
<= div>
I'm having a little bit of trouble getting the same = output as you though, and I'm wondering if there might be a setting tha= t I need to change.=C2=A0

Here is what I trie= d, and the result. Do you have an idea of what is going wrong here?

Thank you!


------------
#+NAME:essay-rubric
- Category
=C2=A0 - A=C2=A0 - B
=C2=A0 - C
=C2=A0 - D
=C2=A0 - F
- Writing
=C2= =A0 - great
=C2=A0 - good
=C2=A0 - ok
=C2=A0 - lousy
=C2=A0 - a= wful

#+begin_src emacs-lisp :var contents=3Dessay-rubric :results ta= ble
contents
#+end_src =C2=A0 =C2=A0

#+RESULTS:
#+begin_src= emacs-lisp
| (("Category" |
#+end_src
----------= ---
On Wed, Jul 7, 2021 at 6:29 AM tbanelwebmin <tbanelwebmin@free.fr> wrote:
Hi Matt

Le 05/07/2021 =C3=A0 21:44, Matt Price a =C3=A9crit=C2=A0:
> I have to write a number of text-heavy documents which need to be
> delivered as tables with wrapped paragraphs in most cells. Working
> directly in table format is pretty arduous and uncomfortable.=C2=A0 Ha= s
> anyone ever written a function to accept a list or subtree as input > and process it into a table?
>
> If anyone has done something similar, I'd love some tips!

Maybe you could use builtin Babel
Hereafter you have a starting point
- Give a name to your input Org list
- Process it with Emacs-Lisp (or whatever language you are comfortable
with) to output it as a table


____ self contained Org Mode example _____

Example of a named list
#+NAME: BBB
- abc
=C2=A0 + 123
=C2=A0 + 456
- def
=C2=A0 + red
=C2=A0 + blue
- ghi
=C2=A0 + big
=C2=A0 + small

Example of converting the named list into a table with Emacs-Lisp
#+begin_src elisp :var bbb=3DBBB :results table
bbb
#+end_src

#+RESULTS:
| abc | (unordered (123) (456))=C2=A0=C2=A0 |
| def | (unordered (red) (blue))=C2=A0 |
| ghi | (unordered (big) (small)) |
___________________________________________


--000000000000bab3c905c68f0260--