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

2021-06-05 Thread Utkarsh Singh
realize that elisp is not scheme, tail > 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

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

2021-06-03 Thread Utkarsh Singh
On 2021-06-02, 23:44 +0700, Maxim Nikulin wrote: > On 02/06/2021 22:08, Utkarsh Singh wrote: >> ;;;###autoload >> (defun org-table-import (file separator) >> @@ -955,12 +971,13 @@ lines. It can have the following values: >> - integer When a number, use that many

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

2021-06-02 Thread Utkarsh Singh
techniques used in pcsv library (MELPA package) which I think you will also enjoy to play with! -- Utkarsh Singh http://utkarshsingh.xyz

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

2021-06-01 Thread Utkarsh Singh
Hi Maxim, First of all I would like to thank you for testing out patches and taking time to write a detailed report about it. On 2021-06-01, 23:23 +0700, Maxim Nikulin wrote: > On 17/05/2021 12:29, Bastien wrote: >> Utkarsh Singh writes: >>> For now can you review the

Re: [PATCH] org-table.el: Fix usage of user-error

2021-05-31 Thread Utkarsh Singh
Ping! -- Utkarsh Singh http://utkarshsingh.xyz

Re: [PATCH] org-table.el: Fix usage of user-error

2021-05-23 Thread Utkarsh Singh
On 2021-05-23, 14:24 +0530, Utkarsh Singh wrote: Hi, This patch tries to fix usage of `user-error' in `org-table-convert-region' which is currently _not_ taking benefit of non-local exit of `user-error' function and using `if' to carry out it's operations. Please note that this is just

[PATCH] org-table.el: Fix usage of user-error

2021-05-23 Thread Utkarsh Singh
>From 96b1a0b6095ecefed0f7103ea1e08e325452d3a6 Mon Sep 17 00:00:00 2001 From: Utkarsh Singh Date: Sun, 23 May 2021 13:48:33 +0530 Subject: [PATCH] org-table.el: Fix usage of user-error * lisp/org-table.el (org-table-convert-region): Don't use `if' because Elisp has no concept of continua

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

2021-05-18 Thread Utkarsh Singh
cale. > > You get this error due to you have not generated this locale. On debian > & ubuntu > > dpkg-reconfigure locales > > allows to select desired locales and performs all necessary actions. Thanks! I have fixed it now. -- Utkarsh Singh http://utkarshsingh.xyz

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

2021-05-18 Thread Utkarsh Singh
On 2021-05-16, 23:24 +0700, Maxim Nikulin wrote: > On 14/05/2021 21:54, Utkarsh Singh wrote: >> On 2021-05-13, 00:08 +0700, Maxim Nikulin wrote: >> >>> Comma is decimal separator for es_ES, de_DE, ru_RU, etc. The point is >>> that order in which separator c

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

2021-05-17 Thread Utkarsh Singh
On 2021-05-17, 07:29 +0200, Bastien wrote: > Hi Utkarsh, > > Utkarsh Singh writes: > >> For now can you review the patches I proposed earlier in this >> thread? > > Not until both you and Maxim are confident this is useful, complete > and predictable. Ok.

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

2021-05-17 Thread Utkarsh Singh
On 2021-05-16, 23:24 +0700, Maxim Nikulin wrote: > On 14/05/2021 21:54, Utkarsh Singh wrote: >> On 2021-05-13, 00:08 +0700, Maxim Nikulin wrote: >> >>> Comma is decimal separator for es_ES, de_DE, ru_RU, etc. The point is >>> that order in which separator c

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

2021-05-15 Thread Utkarsh Singh
On 2021-05-15, 12:30 +0200, Bastien wrote: > Hi Utkarsh, > > Utkarsh Singh writes: > >> For now can you review the patches I proposed earlier in this >> thread? > > Do these patches provide a complete and predictable solution? > If so, can you merge them i

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

2021-05-15 Thread Utkarsh Singh
On 2021-05-15, 11:13 +0200, Bastien wrote: > Hi Utkarsh and Maxim, > > Utkarsh Singh writes: > >> On 2021-05-13, 00:08 +0700, Maxim Nikulin wrote: >> >>> Comma is decimal separator for es_ES, de_DE, ru_RU, etc. The point is >>> that order in which se

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

2021-05-14 Thread Utkarsh Singh
esource from where I can information's about locale. I would also like to hear from the maintainers on what the think about the issue and are they willing for an workaround? -- Utkarsh Singh http://utkarshsingh.xyz

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

2021-05-10 Thread Utkarsh Singh
Hi Maxim, Sorry for the late reply! On 2021-04-28, 23:38 +0700, Maxim Nikulin wrote: > On 28/04/2021 15:37, Utkarsh Singh wrote: >> +List of preferred separator (in order of preference): >> +comma, TAB, semicolon, colon or SPACE. > I will hardly be using this featur

Re: bug#47820: [PATCH] org-table-import: Give option to import interactively even if filename doesn't match

2021-05-01 Thread Utkarsh Singh
e as I was considering Elisp (my first Lisp) to be a general purpose language and Org tables it's CSV library. Even though due to the very nature of Lisp most of this possible but Org is not a right place for this. -- Utkarsh Singh http://utkarshsingh.xyz

Re: bug#47820: [PATCH] org-table-import: Give option to import interactively even if filename doesn't match

2021-05-01 Thread Utkarsh Singh
Hi Bastien, On 2021-05-01, 10:51 +0200, Bastien wrote: > Hi Utkarsh, > > Utkarsh Singh writes: > >> Can we give small flexibility in choosing the filename interactively for >> `org-table-import'? Currently org-table-import will just throw an error >> when fil

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

2021-04-28 Thread Utkarsh Singh
separator due to following cases: + field1 'this is field2' 'this is field3' :: In this case we still have SPACE inside quote (' in this case). + Since SPACE is our last valid separator I think searching for a line which doesn't contains space is more than enough. Required patch: >From 6b112927de7

Re: [PATCH] org-table-import: Make it more smarter for interactive use

2021-04-22 Thread Utkarsh Singh
t to match the separator." (interactive "f\nP") (when (and (called-interactively-p 'any) - (not (string-match-p (rx "." (or "txt" "tsv" "csv") eos) file))) + (not (string-match-p (rx "." (or "txt" "tsv" "csv") eos) file)) + (not (yes-or-no-p "File does not havs .txt .txt .csv as extension. Do you still want to continue? "))) (user-error "Cannot import such file")) (unless (bolp) (insert "\n")) (let ((beg (point)) -- Utkarsh Singh http://utkarshsingh.xyz

Re: [PATCH] org-table-import: Make it more smarter for interactive use

2021-04-20 Thread Utkarsh Singh
nless (= beg end) (save-excursion (goto-char beg) (catch :found (pcase-dolist (`(,sep ,regexp) sep-regexp) (save-excursion (unless (re-search-forward (eval regexp) end t) (throw :found sep nil) > Again all this needs to extensively tested, as there are a lot of > dangers lurking around. Summary of things that still requires a review: + Setting boundary right + When using SPACE as separator is it sufficient to check for all for all non quoted SPACE's? -- Utkarsh Singh http://utkarshsingh.xyz

Re: [PATCH] org-table-import: Make it more smarter for interactive use

2021-04-19 Thread Utkarsh Singh
onvert-region' for region BEG0 to END0. List of preferred separator: COMMA, TAB, SEMICOLON, COLON or SPACE. If region contains a line which doesn't contain the required separator then discard the separator and search again using next separator." (let ((beg (save-excursion (goto-

[PATCH] org-table-import: Make it more smarter for interactive use

2021-04-18 Thread Utkarsh Singh
out the separator in the -following way: - -- when each line contains a TAB, assume TAB-separated material; -- when each line contains a comma, assume CSV material; -- else, assume one or more SPACE characters as separator. +The command tries to be smart and figure out the separator using +`org-table-guess-seperator'. When non-nil, SEPARATOR specifies the field separator in the lines. It can have the following values: -- Utkarsh Singh http://utkarshsingh.xyz

[PATCH] org-table-import: Give option to import interactively even if filename doesn't match

2021-04-16 Thread Utkarsh Singh
)) + (not (yes-or-no-p "File doesn't have .txt, .tsv or .csv as extension. Do you still want to continue? "))) (user-error "Cannot import such file")) (unless (bolp) (insert "\n")) (let ((beg (point)) -- Utkarsh Singh http://utkarshsingh.xyz