From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id uBPwOd+7u2BqEgAAgWs5BA (envelope-from ) for ; Sat, 05 Jun 2021 20:01:03 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id oEwaNd+7u2C2RwAAbx9fmQ (envelope-from ) for ; Sat, 05 Jun 2021 18:01:03 +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 0E9D0960C for ; Sat, 5 Jun 2021 20:01:02 +0200 (CEST) Received: from localhost ([::1]:38892 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lpabV-00065m-Nz for larch@yhetil.org; Sat, 05 Jun 2021 14:01:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33490) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lpaR9-00015n-Iy for emacs-orgmode@gnu.org; Sat, 05 Jun 2021 13:50:19 -0400 Received: from mail-pf1-x42b.google.com ([2607:f8b0:4864:20::42b]:46971) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lpaR7-0007Q0-Mh for emacs-orgmode@gnu.org; Sat, 05 Jun 2021 13:50:19 -0400 Received: by mail-pf1-x42b.google.com with SMTP id u126so5869874pfu.13 for ; Sat, 05 Jun 2021 10:50:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:in-reply-to:references:date:message-id:mime-version :content-transfer-encoding; bh=Zun19CGD0YU9WcYhdOd2kJHLtssw2Vb5W+bVc3H3GJk=; b=p/N/nIt1lv8fS40VmJYIy077p1wv5zYsrQVd1eMD8XAP6DkDo05MCl63NZDvn8TaZ/ hm7YMxzUIDUsnNAcuMCAzJOXx3/u/VKEqsy25G7W/tAJOaLfDiuG2nPiaYIKjLGTjrUm h1KaeB8gM87N/PkI+B43Ozw+yKM1be4pcti6FUoHUO7ukR4OYozyOfT7/tFMauvCQ5Cu ZZzs1KU4bGdVUlalQx4PnAa4+Vhqnzra/FU9jgRjaRhb0DMxx6G5sDo5dXvx7dUo6QTv DM+eY2dnIHd3OIi8KtRubM/ikF9dgAc9LMjF/tTD9/lU0avcBy/WFuju//QR7+mcZLbD HDlA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:in-reply-to:references:date :message-id:mime-version:content-transfer-encoding; bh=Zun19CGD0YU9WcYhdOd2kJHLtssw2Vb5W+bVc3H3GJk=; b=WECQAtk9vkLPNKendPe2iUv07vmor3YKVSwspf1Jo6wEEGIIGyixLNT9izwM9kcSed jDrqJrNb9THnKX1mCzzAzudbfZZuS8aQTqAd6K/pkZcFW/etEFgpQnao/4oksTm+/GZm YOX+GZwuW8vPCb56pZAJHG4tbI7Ma/TmEwPhWBQ8wnDgY4ctWaU4kWfiBvpUKRG3uMtz 7U8CttJXqGEvPWBFC0Xpzm1L6/v/JbefkVOBsnJY8bun2FqDDP89SvaMjGn7coFaFgTo wVhhMO//FxfgK71mYK23Di6mXGmR3r3nYcgE62q3zxWR4KZLcw9InkrcWTdawWyaECuY 9r7w== X-Gm-Message-State: AOAM533z6Kli3zfy0rMCKU4OdRbPuRHC/h5PlRIS1iwOtvhNjjunOlLR UgMSctlT1Q4/wHXvgbB5eVM= X-Google-Smtp-Source: ABdhPJyp82JjOOtkkY2OOTTBvusZG2cxhcdhCug3cmQVzDJmIlDhh378DfzPNzJO2c8hjh6tCN6lPg== X-Received: by 2002:a62:3001:0:b029:2e9:39d0:46cd with SMTP id w1-20020a6230010000b02902e939d046cdmr10124038pfw.47.1622915415487; Sat, 05 Jun 2021 10:50:15 -0700 (PDT) Received: from localhost ([103.77.0.45]) by smtp.gmail.com with ESMTPSA id 23sm2293307pjw.28.2021.06.05.10.50.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 05 Jun 2021 10:50:15 -0700 (PDT) From: Utkarsh Singh To: Maxim Nikulin , emacs-orgmode@gnu.org Subject: Re: bug#47885: [PATCH] org-table-import: Make it more smarter for interactive use In-Reply-To: References: <87o8cmi8bn.fsf@gmail.com> Date: Sat, 05 Jun 2021 23:20:28 +0530 Message-ID: <87bl8kryjf.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=2607:f8b0:4864:20::42b; envelope-from=utkarsh190601@gmail.com; helo=mail-pf1-x42b.google.com X-Spam_score_int: 16 X-Spam_score: 1.6 X-Spam_bar: + X-Spam_report: (1.6 / 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, PDS_OTHER_BAD_TLD=1.997, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URI_DOTEDU=1.44 autolearn=no 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=1622916063; 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:dkim-signature; bh=Zun19CGD0YU9WcYhdOd2kJHLtssw2Vb5W+bVc3H3GJk=; b=kBy0cSDjfCBXJPW28FwOh6ulj6b3Sg8nzt6XIP+4pD6f0i43F8vYvTZWV1tJRlkwFRHM8Z RbGzZrM2LsycTM0i6FFYS9e0qR5eQBjISDterLQBMCd7EkY4kxeMwfmEcfzlraur0EgCXV P1zlpnxIXGoSf+9kCObbCTD2flYnf6iA9tCJhnUYewaBHjOL9nSpP0aKANL56HIvDRa3Xy 1fxLpu0Ne46eNK34AHWZ+31iRlgT+PH2BQGdkfstOMLSDCjGKUO+KHADUGjGgnURVpr5h1 X4bKPCaewmXztta0X11S4lPXbsgiue97zrDMEzz+7m+7kMdPxhf2ybBifxsx1g== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1622916063; a=rsa-sha256; cv=none; b=suqYvqvbupw/l4bAZyTFhb85wAxPdtPbK+VBZNHoIYidoNbrekPlN7IvLitTy5sze0qChO g1pDNklazEbOXKtJih0GJ4SqagHYgeZYAZ793EXjANuTyL8cUByIgpkjGvbrmCZriknOPa N3Ugm3iYRKjBUg0Yu4vsCPCS///hGN0WrS11cG8vqCtO3tb6VGiQ15wd9RnWs97c5jXPcf a2nYYUXQV/B9DU4LptDg1L0QQX2yDEI8Jq7IjDH134Q62ahrZYeSfImRqxWNUSoEb7BuTF 0odNh1qOc1NE1Jx/3I/0rCznSHqzx6Tll55NsfijYAvR6JN/7ayMaoDf0t9dxQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b="p/N/nIt1"; 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.13 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b="p/N/nIt1"; 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: 0E9D0960C X-Spam-Score: -3.13 X-Migadu-Scanner: scn0.migadu.com X-TUID: ftDCn/TWiPTC On 2021-06-05, 19:40 +0700, Maxim Nikulin wrote: > This line should be added to org-table.el, but notice "rx =E2=80=98not=E2= =80=99 syntax=20 > error: (or ". This logical operators have a bit different meaning for=20 > regular expression. > > Nicolas suggested you to use `list' to avoid `eval'. Certainly `eval'=20 > should be avoided whenever possible, but there is alternative with "`"=20 > and "," instead of "'". Though I often prefer `list'. Done. >> Can you also share test.org so that I can test locally? > > I can reproduce it with an empty org file. Emacs-26.3. So I am curious=20 > if your tested your patch at all. Yes you are right I was not testing my patches using 'emacs -Q' and I am apologetic about it. I just "tested" most of them by M-x eval-buffer on the patched file and then checked the output of `with-temp-buffer'. >> Now on the topic of CSV parser, I have succesfully implemented a CSV >> parser in less than 65 LOC which also preserves newline character but I >> am facing a dilemma on how should I represent it as a Org table. For >> ex: > ... >> 6,"Cell with new >> Line",6.28 > > Due to > https://orgmode.org/worg/org-faq.html#Tables > "Will there ever be support for multiple lines in a table field? No." > (there are may be some tricks in Org manual) any variant is acceptable,=20 > even current one. Since during export split cell is considered as=20 > different rows, it is responsibility of the user to preprocess original=20 > file and import it in a form suitable for Org. > > However independently of chosen variant, it would be great to get list=20 > of warnings with ambiguous lines similar to compiler errors. Such=20 > feature is not implemented in Org yet, the most close is `org-lint'=20 > result (its behavior differs from compiler errors). After reading FAQ about multiple lines in table field I don't think this PATCH makes much sense as my main driving force for this patch was to simplify regular expression in `org-table-convert-region' and somehow add newlines support. I also think `org-table-convert-region' is doing a fine job and I should keep my "I want to contribute...." habit in check. > I expect complexity O(number of lines in result). I do not like=20 > excessive usage of `dolist'. I would try slicing subrows using `mapcar'=20 > while there is at least one non-nil element. Yes! Currently I am trying to sequentially read Elisp manual and I have completed the section on 'Mapping Function' yesterday. I think it's a really nice language feature that I can make use of. > P.S. Have you read "Structure and Interpretation of Computer Programs"=20 > by Abelson, Sussman, and Sussman? > https://sarabander.github.io/sicp/html/index.xhtml > or https://mitpress.mit.edu/sites/default/files/sicp/index.html > While reading, it is necessary to realize that elisp is not scheme, tail= =20 > recursion should be avoided in elisp and there are over differences. Thank you! I have seen most of the decision on Lisp includes SICP but I am currently stopping myself to Elisp manual to learn something useful about this timeless editor and learn thing in a step-by-step manner. I also tried Racket after reading: https://dustycloud.org/blog/racket-is-an-acceptable-python https://beautifulracket.com/ But stopped myself for the reason same as above. --=20 Utkarsh Singh http://utkarshsingh.xyz