emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: bug#47885: [PATCH] org-table-import: Make it more smarter for intera


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
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1

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).






reply via email to

[Prev in Thread] Current Thread [Next in Thread]