From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21000 invoked by alias); 27 Oct 2010 09:32:06 -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: 28371 Received: (qmail 9670 invoked from network); 27 Oct 2010 09:32:04 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received-SPF: none (ns1.primenet.com.au: domain at kth.se does not designate permitted sender hosts) X-Virus-Scanned: by amavisd-new at kth.se X-KTH-Auth: auno [213.100.34.83] X-KTH-mail-from: auno@kth.se X-KTH-rcpt-to: zsh-workers@zsh.org Message-ID: <4CC7EB88.8020105@kth.se> Date: Wed, 27 Oct 2010 11:06:16 +0200 From: Mikael Auno User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.12) Gecko/20100915 Thunderbird/3.0.8 MIME-Version: 1.0 To: zsh-workers@zsh.org Subject: Re: Prefixed backslash removed when completing command References: <4BF51CF3.8010609@kth.se> In-Reply-To: <4BF51CF3.8010609@kth.se> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Peter Stephenson wrote: > Mikael Auno wrote: >> Hi. I don't know if prefixing a command with a backslash to suppress >> alias expansion is a intentional feature or not. If it is though, tab >> completing a (complete or incomplete) command prefixed with a >> backslash ought not remove the backslash. Current behavior seems to >> be to complete something like "\mpla" to "mplayer" and not to >> "\mplayer" as I would expect. >> >> I would be happy to try to fix it myself if no one has time to do it. >> A pointer on where to start looking in that case would be good though >> as I'm not at all familiar with the code of Zsh. > > You're quite right that this should work better, but I suspect fixing it is > a real pig. Quoting is one of the messiest parts of completion (regular > viewers will know this is rather a strong statement). I think fixing it > properly by leaving all quoting in place isn't going to be easy (to put it > mildly). > > I think you have a workaround, though: use an initial single quote. Not > only does that get kept, the closing single quote is put in place > afterwards. Is this good enough? (It would be good to document this but > goodness knows where it goes.) (I did not see this reply until now as I am not on the list and as such did not receive the reply directly. I only saw it now as I happened to find the online archive of the mailing list.) If I am not completely misunderstanding your reply, I think you misunderstood my issue. My issue has nothing to do with either single or double quotes (they are only there in the original message to separate the examples from the rest of the text), but with the backslash. When I try to tab complete something starting with a leading backslash, e.g. \mpla, then it is completed to mplayer (without a leading backslash) instead of \mplayer (with a leading backslash) as I would expect. I hope this clarifies the issue. Mikael Auno