From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id oL/aOKx0t2DrMwEAgWs5BA (envelope-from ) for ; Wed, 02 Jun 2021 14:08:12 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id 2E8XNKx0t2DPCAAAB5/wlQ (envelope-from ) for ; Wed, 02 Jun 2021 12:08:12 +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 612992DBA6 for ; Wed, 2 Jun 2021 14:08:12 +0200 (CEST) Received: from localhost ([::1]:58056 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1loPfO-0002mU-Kk for larch@yhetil.org; Wed, 02 Jun 2021 08:08:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45906) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1loPeK-0001r0-EX for emacs-orgmode@gnu.org; Wed, 02 Jun 2021 08:07:04 -0400 Received: from ciao.gmane.io ([116.202.254.214]:50844) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1loPeI-0005jk-Sm for emacs-orgmode@gnu.org; Wed, 02 Jun 2021 08:07:04 -0400 Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1loPeH-0005DG-4d for emacs-orgmode@gnu.org; Wed, 02 Jun 2021 14:07:01 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: emacs-orgmode@gnu.org From: Maxim Nikulin Subject: Re: bug#47885: [PATCH] org-table-import: Make it more smarter for interactive use Date: Wed, 2 Jun 2021 19:06:54 +0700 Message-ID: References: <87czuq9958.fsf@gmail.com> <8735vmelfs.fsf@nicolasgoaziou.fr> <87k0oyfj4y.fsf@gmail.com> <87im4h9irn.fsf@nicolasgoaziou.fr> <87zgxpwqa7.fsf@gmail.com> <875z07jx6n.fsf@nicolasgoaziou.fr> <87tunqby9a.fsf@gmail.com> <875yzq77w8.fsf@gmail.com> <87o8dd74dv.fsf@gmail.com> <874kf49x7f.fsf@gnu.org> <87pmxse29o.fsf@gmail.com> <87a6ouj5c8.fsf@bzg.fr> <899175c5-1547-8c0c-2f16-f089fc74690a@gmail.com> <87fsy1jx52.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 In-Reply-To: <87fsy1jx52.fsf@gmail.com> Content-Language: en-US Received-SPF: pass client-ip=116.202.254.214; envelope-from=geo-emacs-orgmode@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: 22 X-Spam_score: 2.2 X-Spam_bar: ++ X-Spam_report: (2.2 / 5.0 requ) BAYES_00=-1.9, DKIM_ADSP_CUSTOM_MED=0.001, FORGED_GMAIL_RCVD=1, FORGED_MUA_MOZILLA=2.309, FREEMAIL_FORGED_FROMDOMAIN=0.248, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, NICE_REPLY_A=-0.613, NML_ADSP_CUSTOM_MED=0.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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=1622635692; 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=HRMvOVpXtNNdcCk4wXDrBSDsxYrPRfLCFDdLvAZvXTc=; b=tuWu7Yjr3lcWUKE8YfcdkBmP1TnEgTCqOuPnlM0SVtBMkMQdEJh2BgzNVziZ1MTl+ulhyn dTFZOsQPu6gP0RVvtqTE1msmnyARb492PhrWNWyEMxPwUFoIpAhRKn/HzQXzi26ReTiz4W aQgXnGjacwVdr/B+7h/t68uN1d2Nk62WGrPBUUfnWG/IYwZyMyK1ACt8rcLUgc5+RnGIDJ iKP59G2Ms5AXX5OenBMmvSaQh199c54hS/eKjBGaQj2ViNoLusc7x4asajjv0K6vhBzqpF /OgR7TGoy9/mCVrjiYSOpQ3rpP9bsZY/Gy2dBW4Ixoi+vATxykMwOrfBBEz9qQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1622635692; a=rsa-sha256; cv=none; b=YHKZuCDzpjkunLERishvXay7/u/dz2mOI+tXbV5fJh1tK7nU2bnVjrLj+1UPSY/LkWeXpc vruajEDZIlsjyF0CpSnNOPLS8TKQinJaB/6LlNmHRMOX4m2aefSXEUnlGLACMAJZZpt4x5 vTStYtKmMLjgN17pEtWYPqkfkif7irg8RwfTybzqa8sPjoXSKpBt4QibxdCQ8g4RvWBN4Z lFrRpHiuHlAJfMdTwCfaDtPicFYKXVhDCWYNzuLaEppWftDwpM6mthovzgdDX4ZbrRuoAh ZG8Ko2ticlaEe3RvnGPRvV618kOxPgdRMkrWket7+LtvjUyWH1e2QnekX0wMQw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=gmail.com (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: -1.83 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=gmail.com (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: 612992DBA6 X-Spam-Score: -1.83 X-Migadu-Scanner: scn1.migadu.com X-TUID: mHQ8zan3dLbr On 02/06/2021 00:46, Utkarsh Singh wrote: >> Org 9.4.5+patches M-x org-table-import >> >> | 1,Word,66.3e-35 | | | | >> | 2,Unquoted | cell,2.7 | | | >> | 3,"Quoted | cell",3.14 | | | >> | 4,"Cell | ""with | quotes""",2021-06-01 | | >> | 5,"Next | cell | is | empty","" | >> | 6,"Cell | with | new | | >> | Line",6.28 | | | | >> >> So my personal conclusion is that CSV file is imported incorrectly in >> both cases: with guessed separator and with explicitly requested through >> prefix argument. Completion works a bit worse too. > > Currently `org-table-guess-separator' returns "," (COMMA as string) and > `org-table-covert-region' uses '(4) to represent COMMA as separator > which is the main cause of breakdown in importing. > > To make importing work well we have to: > > + Guess right separator (`org-table-guess-separator') > + Parse CSV with this separator (`org-table-covert-region') > > As far as I can tell "guessing part" works well and now we just have to > make parser work well with new separators. Notice that for "C-u M-x org-table-import" heuristics is not necessary, the separator is specified explicitly. I see that your intention was to improve user interface of org-table-import, but actually you broke it by the "org-table-import: add file prompt" patch. I have not tried it, but my expectation is that user prompt can be customized while keeping all other things working. Maybe the docstring should be updated to make it more friendly to novices (like me while reviewing your patch).