From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23450 invoked by alias); 3 Jun 2013 08:50:29 -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: 31448 Received: (qmail 24997 invoked from network); 3 Jun 2013 08:50:23 -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=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI, SPF_HELO_PASS autolearn=ham version=3.3.2 Received-SPF: none (ns1.primenet.com.au: domain at samsung.com does not designate permitted sender hosts) X-AuditID: cbfec7f4-b7fd76d0000035e1-ed-51ac566fde58 Date: Mon, 03 Jun 2013 09:40:14 +0100 From: Peter Stephenson To: Zsh Hackers' List Subject: Re: PATCH: configurability of pattern characters, part 1 Message-id: <20130603094014.4728e466@pwslap01u.europe.root.pri> In-reply-to: <130602001627.ZM15649@torch.brasslantern.com> References: <20130601002954.0e30d7b9@pws-pc.ntlworld.com> <130531232223.ZM13592@torch.brasslantern.com> <20130601211836.550bd8ac@pws-pc.ntlworld.com> <130602001627.ZM15649@torch.brasslantern.com> Organization: Samsung Cambridge Solution Centre X-Mailer: Claws Mail 3.7.9 (GTK+ 2.22.0; i386-redhat-linux-gnu) MIME-version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFuphluLIzCtJLcpLzFFi42I5/e/4Nd38sDWBBhvmGlocbH7I5MDoserg B6YAxigum5TUnMyy1CJ9uwSujP3vD7EUXOWvmLbzBXMD43KeLkZODgkBE4kb648xQ9hiEhfu rWfrYuTiEBJYyijx4U0nI4SznElix6ZlYFUsAqoStxYfZgSx2QQMJaZumg1kc3CICGhLtH8U AzGFBRwlLh/IBKngFbCX+L5hOTuIzSlgJfGp4Tk7xMiTjBLTfs8CG8kvoC9x9e8nJogj7CVm XjnDCNEsKPFj8j0WEJtZQEti87YmVghbXmLzmrfMExgFZiEpm4WkbBaSsgWMzKsYRVNLkwuK k9JzDfWKE3OLS/PS9ZLzczcxQkLwyw7GxcesDjEKcDAq8fAGeqwJFGJNLCuuzD3EKMHBrCTC eyUQKMSbklhZlVqUH19UmpNafIiRiYNTqoExWjD7dLTXi6K1azfPMuqZXBRx31Aq/YvzRBOn jd98XKcJHTte98FifdHkcnNHt7eHH1pby/sJle0+92z18y0GjXOmJNW3lzR4n2ZIK1G4UWn0 WpldzS1i/cyXDZdOFfzed+2SoKhttlvF2+tu+V+/5Wo0M1y4JDu3krVj1+tPMb2P4xZs/1qu xFKckWioxVxUnAgAMF3KvR8CAAA= On Sun, 02 Jun 2013 00:16:27 -0700 Bart Schaefer wrote: > On Jun 1, 9:18pm, Peter Stephenson wrote: > } > } The simple meaning for enable -p is that it reverses a disable, it > } doesn't explicitly enable something that's not allowed by the options. > > Agreed. In the other cases of disable, you have to create something a > different way (function, alias) before you can disable/enable it, so > I think that's fine here too. > > I'm still not entirely clear what happens in e.g. this case: > > % setopt kshglob > % disable -p '+(' > % setopt kshglob > > Does the setopt re-enable '+(' or does it remain disabled? It remains disabled: that's a separate set of controls. < What about: > > % setopt kshglob > % disable -p '+(' > % unsetopt kshglob > % setopt kshglob It will stay disabled until you "enable -p '+('" or enter an emulation. But if you enter a non-ksh emulation in which you "setopt kshglob" it will pop up. By the way, I suspect I need to do more work on the various expressions with parentheses to make everything work smoothly. > } "disable -p" should output the current settings, which we could save. > > Explicit save/restore not necessary with the patch in 31444, right? Yes, I'll just need to ensure LOCAL_PATTERNS is set with the other completion options and use enable -p to ensure extendedglob patterns are enabled. > } Or how about readonly zsh/parameter arrays corresponding to enabled and > } disabled patterns? Same idea, just slightly more efficient to save. > > I think it'd be fine to add these, though calling one of them $patterns > is likely to clash with some existing scripts. I'd vote for having it > be readonly like $builtins and $reswords. The writable zsh/parameter > hashes are for objects that can be created/deleted by the user, but we > are not allowing the user to create new pattern tokens. It seems like I don't really have a use for these for now. pws