Hi Andreas, Andreas Röhler <andreas.roeh...@easy-emacs.de> writes:
> attached a org-table-import.patch Thanks for this patch. I test it against latest master and got this error: ,---- | Debugger entered--Lisp error: (wrong-type-argument stringp nil) | re-search-forward(nil #<marker at 57 in tst.org> t) | (while (re-search-forward separator end t) (replace-match " | " t t)) | (let* ((beg (min beg0 end0)) (end (copy-marker (max beg0 end0))) (separator (cond ((and separator (stringp separator)) separator) ((eq 4 (prefix-numeric-value separator)) (read-from-minibuffer "Separator char: "))))) (goto-char beg) (unless separator (setq separator (org-guess-separator))) (goto-char beg) (while (re-search-forward separator end t) (replace-match " | " t t)) (goto-char beg) (org-table-align)) | org-table-convert-region(14 57 nil) | call-interactively(org-table-convert-region t nil) | execute-extended-command(nil) | call-interactively(execute-extended-command nil nil) `---- Beside this problem... > removes limitations of hard-coded separator char(s). > `org-guess-separator' accepts and detects all chars as field separators. > It works based on the assumption, that char looked for appears in equal > number at each row. This looks clever, but is it safe? E.g. if cells of the table are surrounded by double-quotes, you'll have the same number of quotes in each row, but the double-quote char by itself is _not_ the separator. So I'm not sure about this heuristics -- want to ear/test more. > Also a default value > `org-table-import-default-separator' should make > guessing faster in some cases. That an easier way and I would favor it: keep the current behavior, but add an option for a list of separators that the user can set. Org would then test this list sequentially. What do you think? -- Bastien