From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id 8AcAFzjF5mDYKwAAgWs5BA (envelope-from ) for ; Thu, 08 Jul 2021 11:28:24 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id AFipEjjF5mD0OwAAbx9fmQ (envelope-from ) for ; Thu, 08 Jul 2021 09:28:24 +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 A51AC2DEDE for ; Thu, 8 Jul 2021 11:28:23 +0200 (CEST) Received: from localhost ([::1]:32886 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m1QKT-0007tL-AD for larch@yhetil.org; Thu, 08 Jul 2021 05:28:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53162) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m1QK7-0007tD-Uk for emacs-orgmode@gnu.org; Thu, 08 Jul 2021 05:27:59 -0400 Received: from smtp1-g21.free.fr ([212.27.42.1]:31952) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m1QK4-0005PM-6C for emacs-orgmode@gnu.org; Thu, 08 Jul 2021 05:27:59 -0400 Received: from [IPv6:2a01:e35:39f3:4610:e577:af29:2660:9eb3] (unknown [IPv6:2a01:e35:39f3:4610:e577:af29:2660:9eb3]) by smtp1-g21.free.fr (Postfix) with ESMTPS id CCE96B0059F; Thu, 8 Jul 2021 11:27:52 +0200 (CEST) Subject: Re: convert subtree or nested list to table To: Matt Price , Org Mode References: <26be9301-9e1a-0dc0-47c7-53e7ffc3e6d3@free.fr> From: tbanelwebmin Message-ID: <9b89ce56-33a7-8d8a-404d-12ee6090dc01@free.fr> Date: Thu, 8 Jul 2021 11:27:52 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Content-Language: fr Received-SPF: pass client-ip=212.27.42.1; envelope-from=tbanelwebmin@free.fr; helo=smtp1-g21.free.fr X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, FREEMAIL_FROM=0.001, NICE_REPLY_A=-0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, 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=1625736503; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=hDkG0JpDyOS8N6+/tz+w6IWpHOLWlKKX2VKJWT3jPFk=; b=bTH3W3dsAE4E1/ZNjRJvVVX1QpIxXSQnfTtADviFCIYgtvoiS2tHJBamQQQYc5RDi8hyj1 VTxw2OYwJaCeG1eYii3kXvXSyJaOSJSLC6rvD7ss4Ei5DoJM/ik1Et3IZfQVUjJU3LQbgk AYEYHZhjKRNtachwvyrARFQnMaL0eERuWVEpt+aJyDT/C4djicpPQnTm9dwiPxMPkFaIi1 vKO+EaY9lAQ0RenpGf7cBGrQAXrgKlbALM9FoxCEVgrDagHJL2soSNj59GemleYQ7v7NES Cw3JfNNfl4iYtfa4y8I9riKJLDSdwIJ98NeImLE7NJt4OZPCPtF/SiTTLHgewA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1625736503; a=rsa-sha256; cv=none; b=c86piloFLL2aSjT3cCMCp53+FiUWCO3gZhBI6c4EwDG+LaqEP+Bml0XbaBqphcsoJETnYm jcumPjbXM3L5MNtOonrRlR20OqDDlpIjytb4pbSKFnl68IODoR0xRt7+MjUgrCP062qvL0 onlmryX7BpTZutMALyuNnTrqQwappXNF31WLlUdYg2j34+hpupiRZgxN8AkgpwsSm3ylYS fXVIiaZWrAt7DQ5KlfI51Hnpv8dPHYbhU75vsj0R8nzuHJYCcBhe+f5e16OaoA1QQ8Y0Mg 8hlfdsaEReh+Lt9TtyYGFsVB6iUwfHKF50Tfi//WebL9rEFI8hO8xk3wplWtSg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=free.fr (policy=none); 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: -2.31 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=free.fr (policy=none); 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: A51AC2DEDE X-Spam-Score: -2.31 X-Migadu-Scanner: scn1.migadu.com X-TUID: 9Svp79wG+93K When I run you example I get: #+RESULTS: | Category | (unordered (A) (B) (C) (D) (F))                 | | Writing  | (unordered (great) (good) (ok) (lousy) (awful)) | To get your result I need to modify    :results table to    :results table code You may try    :results table raw Or try your example without any hidden customisation    emacs -q This info page may be useful: [[info:org#Results of Evaluation]] Le 07/07/2021 à 23:13, Matt Price a écrit : > 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=essay-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 à 21:44, Matt Price a écrit : > > 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=BBB :results table > bbb > #+end_src > > #+RESULTS: > | abc | (unordered (123) (456))   | > | def | (unordered (red) (blue))  | > | ghi | (unordered (big) (small)) | > ___________________________________________ > >