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

Re: [PATCH] [[:blank:]] only matches on SPC and TAB



On 14 May 2018 at 17:51, Stephane Chazelas <stephane.chazelas@xxxxxxxxx> wrote:
> I just noticed that on NetBSD, in locales using UTF-8 or
> GB18030, isblank() returns true on \v (vertical TAB), not in any
> other locale! So does iswblank(). So out goes my claim that
> "blank" should be for horizontal spaces. On OpenBSD (where only
> UTF-8 charsets are supported in locales other than C/POSIX),
> iswblank() matches on \v and \f.
>
> What a mess!

Maybe seeing Zsh as a platform is a way. I suspect that the person
which decided to match non-horizontal space on NetBSD or OpenBSD via
:blank: was himself thinking in platform terms. So basically "in Zsh
world [[:blank:]] is ...". I feel that BSD coders like such
power-of-creation moments, "in NetBSD world it will be that way...".
Too bad character classes shine in control code, "if :space:, then,
else" and such play in a creator is actually very influential and long
term. So one option is to leave [[:blank:]] as it is, I would be happy
to use it in code and comfortably include tabs in various initially
0x20-space comparisons (BTW., [ $'\t'] doesn't work in [[ ... ]], the
space needs to be backslashed). The other way is to make it very
normal, without bumps. The other is to join systems that prevail in
numbers or market share.

-- 
Best regards,
Sebastian Gniazdowski



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