Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: HIST_IGNORE_DUPS also ignores command lines that differ by a space between quotes



On Fri, Mar 15, 2024 at 5:53 AM Vincent Lefevre <vincent@xxxxxxxxxx> wrote:
>
> On 2024-03-13 22:13:09 -0700, Bart Schaefer wrote:
> > Doing a full syntax analysis here would make it a lot more complicated
> > and a lot slower.
>
> I don't think you need to do a full syntax analysis. Isn't this just
> related to tokenization (something like that)?

Tokenization is performed by lexical analysis.

> Note that spelling correction, which occurs *before* the line is put
> in the history, detects quoted text and won't try to correct it.

Spelling correction is actually performed by the lexer, at the same
time as alias expansion.

> it seems that "quoted status" can be taken into account at that point.

Not without separately storing both the original and lexed state of
the text.  Which is in fact done internally, but for hopefully obvious
reasons is not done in the history file, which (during
reading/writing) is where most duplicate elimination has to occur.




Messages sorted by: Reverse Date, Date, Thread, Author