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 WAfeIe/n9mDAdgEAgWs5BA (envelope-from ) for ; Tue, 20 Jul 2021 17:12:47 +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 MOihHe/n9mBvEwAAbx9fmQ (envelope-from ) for ; Tue, 20 Jul 2021 15:12:47 +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 09B409BE5 for ; Tue, 20 Jul 2021 17:12:47 +0200 (CEST) Received: from localhost ([::1]:45558 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m5rQL-0003GQ-8O for larch@yhetil.org; Tue, 20 Jul 2021 11:12:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50058) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m5rP1-0003D0-3X for emacs-orgmode@gnu.org; Tue, 20 Jul 2021 11:11:23 -0400 Received: from mail-ua1-x933.google.com ([2607:f8b0:4864:20::933]:36509) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m5rOz-0000y3-CY for emacs-orgmode@gnu.org; Tue, 20 Jul 2021 11:11:22 -0400 Received: by mail-ua1-x933.google.com with SMTP id q20so8185975uaa.3 for ; Tue, 20 Jul 2021 08:11:20 -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 :cc; bh=pSjrccyYCUeAxiCwfYewnaCUMkLjdx92QDW/tOPQ5pI=; b=mrBVa0ryqJWd+338Kp4yE2Ud7B205hfZ6i+6SU3jtUXalKOVYJhoorKyZppjJZ1hv5 iSFRGT3lPoalxpTqBfrmI/YZC2zUPDmErrnBmdF1nGRJNiS3x9Wi7k1qdy4nZs2GQ2g+ bZ/DV0ni8vPNPu1K3vAcNIwyqC5nHcR0R2stvD/iLGBGT1ZM8oXbV4iPErhGrFVPa5sB jVVkRywllpGG7h8jF9qfJ/0lJW4lIX6OUhDXk/VhfNNyHwVAhv6UzGSWwmaGanpKDdFU GOUVbHPfFF4gVaj6aiaCRI8wJkT1m4HweEnWqu9etA/34FWVj//h9Sk/4vN1bWKgGAQN auNw== 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:cc; bh=pSjrccyYCUeAxiCwfYewnaCUMkLjdx92QDW/tOPQ5pI=; b=PPzHx7CL1UeLHyYO3onaybVLcck6A1xJg2Bit3Dt+H59LR7DZK10ccpTkJ5MCifa4j wU6bF5uYfHu0CKfV5pKbccUb2nCqguChaQhRTo0CBxS3mMDChB5z79Nlc6AEIJ//8RD9 LcFKlAVr8we4R8QygfdU1rm70Ob/fahpe/NH5pnELlaCaMUU2gDg2VDUCuRVBqetl/Db ZZ4/98SQMbqE9oVK8YoN9KE8C8uViFUaT/oJ97gYconNwO761JJkjYQKo0zV2CbzYOLz XresMaZ/zFCMBgfj8cAGV9btgPPSWHZmhuaJfbhRhKhnYoUgHISAVsMES0z3FIRvoHPE 04VA== X-Gm-Message-State: AOAM532dL8AbXOX7XireRgW0YG3VrmUGAZQeL1SdycTPA9PHfU34MfDm Y/ycwU3pw/SYxNSDFXNdJFZVGZIsYJlkqdnDDt0= X-Google-Smtp-Source: ABdhPJwNcjeyjhcLcvu1LYKVNlo9rnxTmm12dl9JDOkHm10DORoLBWpnuDjr289cH69pLzlroPCbvVlHBPaJz2D0G+w= X-Received: by 2002:ab0:378e:: with SMTP id d14mr31874308uav.18.1626793880065; Tue, 20 Jul 2021 08:11:20 -0700 (PDT) MIME-Version: 1.0 References: <26be9301-9e1a-0dc0-47c7-53e7ffc3e6d3@free.fr> <87v95l2dxa.fsf@christianmoe.com> In-Reply-To: <87v95l2dxa.fsf@christianmoe.com> From: Matt Price Date: Tue, 20 Jul 2021 11:11:08 -0400 Message-ID: Subject: Re: convert subtree or nested list to table To: Christian Moe Content-Type: multipart/alternative; boundary="000000000000581c2005c78f77af" Received-SPF: pass client-ip=2607:f8b0:4864:20::933; envelope-from=moptop99@gmail.com; helo=mail-ua1-x933.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: , Cc: tbanelwebmin , Org Mode 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=1626793967; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=pSjrccyYCUeAxiCwfYewnaCUMkLjdx92QDW/tOPQ5pI=; b=RcoKFGBsO53J7R90NjpasiN3FlWigW/ZRlxyX1g5zjNAc84okQdLwvKNxzEpyelWhWp9iX irdz/5gpwh3SYFUS/L8Y64yVnPpXTe/yswv6k2Nho98veXT5xrvAVKK9Uoj2V6SOIV4tFa mN6eBEs6fb6nSPRwIQsHwPq4tzcuL4xZXXMrSQzFn8GPvZKuNBCcGfYpT6afhfXvcu21+M Tfm3GuFuhffLLo3SoqgRqHjpXIfH7bFZ2ZH01xzCId4MXdDgztwvuTJ1ar4DMSSR1DmhqS Pg5Ye/+/kkTzIuiUrMUSMQOfUw5WRQsdTOdRXt6pDCyc5BQTFtPO1/49OB7zMw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1626793967; a=rsa-sha256; cv=none; b=Ddceg2IrXuIcc2aGV34hqSNQiA4TIzJ0hitcWKdh4tdG1YvFgfoKhIsenc+P56YObLkxGJ rBdRl9EuGWRKwNfEw1ShC4xWY8BKfn3dxXWk8kXIxTWjCCZllfMlHHszSU9g5L2DCoj/X6 ImEE9NiH+kZteNnPKWaxGmG+k+PKbJ/Lyn+/Pr3m7O4wGL3sET5WST6LM/77MuRRTlLuUl oyf+hBa7RczrVX1656SkkugngwI+Ld+sLsPCpA44GP5zhojFHuLBuxotGFhagnlJT2p9s2 3sOOQIgAzO/ZYBdHpwI+dxfBpZ+UwIRZiMfreumwxrbuUHmWqJWCVdsweJcavw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=mrBVa0ry; 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.12 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=mrBVa0ry; 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: 09B409BE5 X-Spam-Score: -3.12 X-Migadu-Scanner: scn0.migadu.com X-TUID: 4o62hu1+p/wI --000000000000581c2005c78f77af Content-Type: text/plain; charset="UTF-8" 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! --000000000000581c2005c78f77af Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Christian et al,

I seem to h= ave broken something while fiddling around and I can't quite make out w= hat.=C2=A0 Would someone be willing to check for me whether this does or do= es not produce the desired full table? Right now I am again getting a trunc= ated result and I'm not fully sure what I might be oding wrong.=C2=A0 H= ere is what I have:

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

#+NAME: list2table
#+BEGIN= _SRC emacs-lisp :var order=3D"columns" data=3Drubric-one :results= table value raw replace
=C2=A0(let (longest)
=C2=A0 =C2=A0 (setq dat= a (map 'list '-flatten data))
=C2=A0 =C2=A0 (setq data (map '= ;list (lambda (x) (seq-difference x '(unordered ordered))) data))
= =C2=A0 =C2=A0 ;; Pad out lists to equal length
=C2=A0 =C2=A0 (setq longe= st (seq-max (map 'list 'length data)))
=C2=A0 =C2=A0 (setq data<= br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (map 'list
=C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(lambda (l)
=C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(append l (make-list (- longest (l= ength l)) "")))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0data))
=C2=A0 =C2=A0 ;; Order by columns or rows
=C2= =A0 =C2=A0 (if (string=3D order "columns")
=C2=A0 =C2=A0 =C2= =A0 =C2=A0 (apply #'mapcar* #'list data) ; transpose
=C2=A0 =C2= =A0 =C2=A0 data))
#+END_SRC

#+RESULTS: list2tab= le
| Grade |

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

thanks as always for the help!
--000000000000581c2005c78f77af--