[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#55315: [elpa/csv-mode] [PATCH] CSV separator guessing
From: |
Simen Heggestøyl |
Subject: |
bug#55315: [elpa/csv-mode] [PATCH] CSV separator guessing |
Date: |
Mon, 09 May 2022 13:03:48 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.1 (gnu/linux) |
Mattias Engdegård <mattiase@acm.org> writes:
> 8 maj 2022 kl. 21.31 skrev Simen Heggestøyl <simenheg@runbox.com>:
>
>> Am I right in thinking that the use of
>> `regexp-quote' in the `csv-set-separator' case gives the right result?
>
> Yes, I think so. `csv-set-separator` should probably escape the character in
> `csv--skip-chars`, however:
>
> (setq-local csv--skip-chars (format "^\n%c" sep))
>
> should be
>
> (setq-local csv--skip-chars (format "^\n\\%c" sep))
>
> I'm not sure if a separator can be chosen that needs escaping here but
> better be safe; who knows how the code will be used.
Ah, thanks, I misread the docstring of `skip-chars-forward':
(but not at the end of a range; quoting is never needed there)
I somehow misinterpreted that as quoting not being necessary at the end
of the string fed to `skip-chars-forward'.
Updated patch with your proposed fix attached.
0001-Add-CSV-separator-guessing-functionality.patch
Description: Text Data