From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28954 invoked by alias); 9 Jun 2013 18:07:27 -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: X-Seq: 31465 Received: (qmail 6610 invoked from network); 9 Jun 2013 18:07:11 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 Received-SPF: neutral (ns1.primenet.com.au: 209.85.215.170 is neither permitted nor denied by SPF record at ntlworld.com) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-proxyuser-ip:date:from:to:subject:message-id:in-reply-to :references:x-mailer:mime-version:content-type :content-transfer-encoding:x-gm-message-state; bh=NbIix9kpdKpjBOjnYMa/fCVEQpTDlEC0HyDZ9xigPyM=; b=KiDeCdUqTHOhHndtt3VBFCan0jggNn31pD6kIvSPjsRQ+/5vh2PvGHSC7Lw2ieHH0Y FhGphyJrH9QMwUfbrkOw8+30BFrYoaPsUYMv3kwmSlaGUIXyNltM3OSclqeUsoJ+iCyo I5EyjcAbS7YHXZBcINenwRrCYCCWwB6S+JYIv1LrwXz6UTglCmptMpBjCR9hH0jQXaos t0xIVY/errEGjpEbxPf37zjxHS6NSkc/uB5IlXVEZ0siYkAWH0Ra3PlKPgQM4AgB5fY4 kS6PSLYHqiRkW2zxmNJW0v96oqrinncE/zFixS3R6d5WDsP4u9uyAYBSsc7mal3shEC5 glQg== X-Received: by 10.14.111.7 with SMTP id v7mr1346545eeg.84.1370801222234; Sun, 09 Jun 2013 11:07:02 -0700 (PDT) X-ProxyUser-IP: 86.6.30.159 Date: Sun, 9 Jun 2013 19:06:58 +0100 From: Peter Stephenson To: Zsh hackers list Subject: Re: PATCH: configurability of pattern characters, part 2 Message-ID: <20130609190658.5ac533e3@pws-pc.ntlworld.com> In-Reply-To: <20130604094447.1260b2d5@pwslap01u.europe.root.pri> References: <20130601002954.0e30d7b9@pws-pc.ntlworld.com> <130531232223.ZM13592@torch.brasslantern.com> <20130602000911.532328c4@pws-pc.ntlworld.com> <20130604094447.1260b2d5@pwslap01u.europe.root.pri> X-Mailer: Claws Mail 3.8.0 (GTK+ 2.24.7; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Gm-Message-State: ALoCoQkrgSQtGcEtR36QOw6A2NfTOvS5BvtNF1ughMuDvtvWuhJQ4DUeW6LH39JsffbnCbeX9AqS On Tue, 04 Jun 2013 09:44:47 +0100 Peter Stephenson wrote: > On Mon, 03 Jun 2013 23:45:39 -0700 > Bart Schaefer wrote: > > schaefer<503> disable -p \* > > schaefer<504> print * > > zsh: no match > > I think that's because I haven't yet got around to haswilds(), so it > thinks there are patterns in it, but finds they don't turn into > anything. haswilds() is going to have to expand somewhat. This fixes haswilds() and completion. This should render the original patch basically functional, however I think it needs a little work within pattern.c to render disabling of features associated with parentheses working (to be clear: I don't expect any existing feature to be broken by anything I've done so far). As I noted somewhere in the documentation, I'm not planning on making the pattern enables and disables affect parsing, just whether the pattern is used as a pattern. Once I've fixed parentheses and written some tests that should be it. diff --git a/Completion/compinit b/Completion/compinit index 7b8a346..f9d2c57 100644 --- a/Completion/compinit +++ b/Completion/compinit @@ -163,8 +163,9 @@ _comp_options=( typeset -g _comp_setup='local -A _comp_caller_options; _comp_caller_options=(${(kv)options[@]}); - setopt localoptions localtraps ${_comp_options[@]}; + setopt localoptions localtraps localpatterns ${_comp_options[@]}; local IFS=$'\'\ \\t\\r\\n\\0\'' + enable -p \| \~ \( \? \* \[ \< \^ \# exec start && isset(KSHGLOB) && + ((str[-1] == Quest && !zpc_disables[ZPC_KSH_QUEST]) || + (str[-1] == Star && !zpc_disables[ZPC_KSH_STAR]) || + (str[-1] == '+' && !zpc_disables[ZPC_KSH_PLUS]) || + (str[-1] == '!' && !zpc_disables[ZPC_KSH_BANG]) || + (str[-1] == '@' && !zpc_disables[ZPC_KSH_AT])))) + return 1; + break; + + case Bar: + if (!zpc_disables[ZPC_BAR]) + return 1; + break; + + case Star: + if (!zpc_disables[ZPC_STAR]) + return 1; + break; + + case Inbrack: + if (!zpc_disables[ZPC_INBRACK]) + return 1; + break; + + case Inang: + if (!zpc_disables[ZPC_INANG]) + return 1; + break; + + case Quest: + if (!zpc_disables[ZPC_QUEST]) + return 1; + break; + + case Pound: + if (isset(EXTENDEDGLOB) && !zpc_disables[ZPC_HASH]) + return 1; + break; + + case Hat: + if (isset(EXTENDEDGLOB) && !zpc_disables[ZPC_HAT]) + return 1; + break; + } + } + return 0; +} -- Peter Stephenson Web page now at http://homepage.ntlworld.com/p.w.stephenson/