From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24294 invoked by alias); 2 Oct 2014 01:11:15 -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: 33317 Received: (qmail 29557 invoked from network); 2 Oct 2014 01:11:13 -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=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 From: Bart Schaefer Message-id: <141001181118.ZM6305@torch.brasslantern.com> Date: Wed, 01 Oct 2014 18:11:18 -0700 In-reply-to: <20141001173917.295076d6@pwslap01u.europe.root.pri> Comments: In reply to Peter Stephenson "Re: _expand_alias does not expand aliases that contain an "!"" (Oct 1, 5:39pm) References: <140830133206.ZM13172@torch.brasslantern.com> <140831135017.ZM739@torch.brasslantern.com> <140914113029.ZM31296@torch.brasslantern.com> <140914135552.ZM31608@torch.brasslantern.com> <20141001150324.1cdad6c9@pwslap01u.europe.root.pri> <20141001150641.02e52281@pwslap01u.europe.root.pri> <20141001151501.2eac05ef@pwslap01u.europe.root.pri> <141001092934.ZM5952@torch.brasslantern.com> <20141001173917.295076d6@pwslap01u.europe.root.pri> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-workers@zsh.org Subject: Re: _expand_alias does not expand aliases that contain an "!" MIME-version: 1.0 Content-type: text/plain; charset=us-ascii On Oct 1, 5:39pm, Peter Stephenson wrote: } Subject: Re: _expand_alias does not expand aliases that contain an "!" } } On Wed, 01 Oct 2014 09:29:34 -0700 } Bart Schaefer wrote: } > Maybe we just need something along the lines of makecommaspecial() that } > can be called from hbegin() to set ISPECIAL on bangchar, and called in } > the completion code to temporarily switch it off/on. } > } > Then inittyptab() never has to mess with examining bangchar, and the } > new makebangspecial() can be called from histcharsetfn() instead of } > doing a full inittyptab(). } } That certainly sounds possible, if you know where to put those calls. } } Here's the other proposal, done entirely local to inittyptab(), and } untested. This looks fine, though it doesn't solve the problem of needing to turn off special-ness during completion. Of course there's a conflict: If completion does not include expansion, then bangchar should be quoted if it results from completion. Otherwise it will already have expanded and therefore appear only where it does not need quoting (theoretically). Of course history expansion could produce a string containing yet another bangchar, which would then be subject to history expansion AGAIN upon accept-line. (I suppose the fact this has never been mentioned shows how rare it is in practice.) Let me see if I can produce a patch for this (and back out the changes to _expand_alias) before you do 5.0.7.