From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3120 invoked by alias); 14 May 2018 08:11:55 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: List-Unsubscribe: X-Seq: 42769 Received: (qmail 15981 invoked by uid 1010); 14 May 2018 08:11:55 -0000 X-Qmail-Scanner-Diagnostics: from mail-ot0-f182.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(74.125.82.182):SA:0(-1.9/5.0):. Processed in 1.695369 secs); 14 May 2018 08:11:55 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_PASS,T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.1 X-Envelope-From: sgniazdowski@gmail.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=SpqFqFH4HlFPECDsCrTEg7WzqCFItvzc+x8Ifcdf4wU=; b=TFO1309vWXZEPOSp43caljsw2x/cUElTcJy9FzrSBCfAGkIP1a0KgYhsdTKAImCxIe 0taG1D0xCAZmtjjODRHY9YmeGsQ1kJuKneezxzgHRG7OQGO5rDpputf9HCTv8clR7gvh QMwvPnuNFd9itrolQakmUzqe8ufSbPr1hU6IgvVxK+hLh4W/4M18AIeLgXCViRNzZBnP sRHmmocicCSyraI8XuzfMe6SI4fIwudGpl90U0KLLOY5DXAWujzBi1CWGXOQ1XZK5UWN kVsv6Pif++9uwhyFlsZeR+FuaJP7ePjc+8n2fMHLAUzQOx7HfH0sYPlVgmN4VdWa/eXH eLgw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=SpqFqFH4HlFPECDsCrTEg7WzqCFItvzc+x8Ifcdf4wU=; b=e6qkdJvNNGy0LNJY39grDPP4XRqwrrY7g0i57xbRpAO25FnKXlzqVo1CYP/8eIhVp9 +14CJoeg0agniM46ZCUyQYBRfQ57zzddmGFLEbc0yRwHJ4V3qiJyGgCUpH7FvjCxCJDE B/msPkR2bTIXEx+Nq3c85+Cp1yXd43npJylZNC+N39+Cw1uMsOh4SbkqK5DFcNKOuTdC y7+eDwDX3ZEGJBYPcxrcNSK9QPJUETlTG5YaRjggbMlvhfvWAIiNdqXNRFDKdxr0ORZl N+01BlFye9Z6Vhu+3M6CUfkO63n3LBPuefzu/aqdIMgFiSskO/fyjGX2g4dGEVRgyy1n ptpQ== X-Gm-Message-State: ALKqPwf1K59ALI19iMxSAVJ+u9LOlJnEyOTEQh+YAohXR5k2EUoY5QL4 D5lhE2mhV9G7WdRQfnu3FX31npl0yE3LrwQR1u8= X-Google-Smtp-Source: AB8JxZpZ6GOTCjezG/NdZKi4MMK4dCdYaKSQsxG2bPEPRxmwKEHslqXZ6KFOLMz3bqcFsmL22hnXtFQOnPH3C/gLErI= X-Received: by 2002:a9d:5134:: with SMTP id c49-v6mr6699998oth.174.1526285511126; Mon, 14 May 2018 01:11:51 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <20180514063611.GA7263@chaz.gmail.com> References: <20180513212553.GA29028@chaz.gmail.com> <20180514063611.GA7263@chaz.gmail.com> From: Sebastian Gniazdowski Date: Mon, 14 May 2018 10:11:30 +0200 Message-ID: Subject: Re: [PATCH] [[:blank:]] only matches on SPC and TAB To: Sebastian Gniazdowski , Zsh hackers list Content-Type: text/plain; charset="UTF-8" On 14 May 2018 at 08:36, Stephane Chazelas wrote: > [[:blank:]], [[:space:]]... are POSIX character classes, > supported by most utilities that do wildcard or regexp matching. > > I know of no other utility than zsh whose [[:space:]] includes > all the characters classified as "space" in the locale and where > [[:blank:]] doesn't include all the "blank" ones. Do you think some middle-way is possible? I mean, enabling :blank: to that much new characters and observing ML for user reports (who knows, maybe there wouldn't be many or any, but yeah, "who knows") is like compiling 32 bit product on 64 bit compiler and continue selling it without break. Well, to be honest, I was hired in one work when this happened and it worked. By middle-way I mean: to look at the possible characters, recognize ones that are crucial for lowering the oddity of Zshell's :blank:, and include just a few in :blank:, doing some thinking if some of chosen characters doesn't have a potential to break something. It's a difficult situation because from one point of view, nothing should break, exotic spaces don't occur often and even if they did, they shouldn't break anything, the code should behave as more robust. But from other point of view, any character added to :blank: has its twin-code assigned that will break. > It seems to me that if you wanted to match on only SPC and TAB > and not the other horizontal spacing characters classified as > such in the locale, you should use [ $'\t']. See also [[:IFS:]] > and [[:IFSSPACE:]] though they depend on the value of $IFS and > include \n by default (and \0 for [[:IFS:]]). I've greped some projects to check if they used :blank:: - https://github.com/zsh-users/zsh-syntax-highlighting/blob/5b539663c0d740a0c00169d5ecbd58e47ff16252/highlighters/main/main-highlighter.zsh#L959 - https://github.com/zsh-users/zaw/blob/91c5e1a179ba543458e341a4d8e95c75f762f5c6/sources/ssh-hosts.zsh#L13 - Zshells distributed functions: _complete, _expand_alias, _description, _main_complete, _bsd_pkg, compinstall, zcalc, etc. quite many. - my 3 past projects, most notably Zshelldoc, which parses scripts to extract functions. These uses aren't drastic, and I think all those projects would work after replacing :blank: with :space:. But there's no way to be sure. Who knows maybe some DevOp wanted to uplift some system at work and proposed use of Zsh, and has :blank: in his scripts. -- Best regards, Sebastian Gniazdowski