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

Re: Issue with histreduceblanks



On Thu, Sep 26, 2013 at 10:42 PM, Bart Schaefer
<schaefer@xxxxxxxxxxxxxxxx> wrote:
> On Sep 26, 12:52am, Raghavendra Prabhu wrote:
> }
> } On Thu, Sep 19, 2013 at 1:42 AM, Peter Stephenson
> } <p.w.stephenson@xxxxxxxxxxxx> wrote:
> } >
> } > Are there any non-ASCII characters on the line that might be confusing
> } > the algorithm (the option pre-dates handling of multibyte characters)?
> }
> } Sorry for the delay in replying (it had ended in my Junk due to
> } Precedence headers).
>
> You didn't really answer Peter's question.  Also I think something is
> being lost in the cut-and-paste-and-email process, because this ..

Ah, sorry for not replying on that earlier, there are no non-ASCII
characters there, the line is just  "Only two kinds of witnesses
exist.  The first live in a neighborhood where".
.
>
> } Archie% Only two kinds of witnesses exist.  The first live in a
> } neighborhood where
> } zsh: command not found: Only
>
> ... obviously has a newline where there must not have been one in your
> original string.

There is no newline there, it was just that the line was wrapped in the mail.

>To have much hope of debugging this, we need a copy
> of EXACTLY what you typed, including what might be characters that
> "look like" spaces but really are not.
>
> } b)  Also tested with print as requested
>
> Did you see/try this?
Yes.

Tested with different combinations:

==================
zsh -f
Archie% setopt histreduceblanks
Archie% Only two kinds of witnesses exist.  The first live in a
neighborhood where
zsh: command not found: Only
Archie% Only two kinds of witnesses exist. he  fisst lvee in a
neighorrhood werre
Archie% print Only two kinds of witnesses exist. he  fisst lvee in a
neighorrhood werre !#:7 !#:8 !#:9
print Only two kinds of witnesses exist. he  fisst lvee in a
neighorrhood werre he fisst lvee
Only two kinds of witnesses exist. he fisst lvee in a neighorrhood
werre he fisst lvee
Archie% print Only two kinds of witnesses exist. he fisst leee in a
neighrrrhood werre he fisst veee
Archie% print Only two kinds of witnesses exist.  The first live in a
neighborhood where !#:7 !#:8 !#:9
print Only two kinds of witnesses exist.  The first live in a
neighborhood where The first live
Only two kinds of witnesses exist. The first live in a neighborhood
where The first live
Archie% print Only two kinds of witnesses exist. he  fisst lvee in a
neighorrhood whrre he  fisst ivee
Archie%
========================


>
>> If that were the case, I would expect history ops that reference words by
>> position would also be confused.  E.g., something like
>>
>> zsh% print Only two kinds of witnesses exist.  The first live in a neighborhood where !#:7 !#:8 !#:9
>>
>> would likely substitute the wrong substrings for !#:7 etc., because the
>> same array of word positions is used to condense blanks.
>



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