From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16287 invoked by alias); 2 Nov 2014 03:09:59 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 19309 Received: (qmail 8366 invoked from network); 2 Nov 2014 03:09:47 -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.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=rOe7ltZhFffsWxUhHjTvukWmI4lQowfn7Ds1gEeSKjo=; b=VxygwpTdUKJDi6pqk4uSVcwrHqT8JbZTH6r0kvr2lTKhwSC3NAlhjor7IfOBeNlIiD uOE9r5Mdd5iEFADrtks1y4KZGTsM6/4CPC6HVnRxW+5N0luHP3j+uu8+cN6r6HAtSE9k UG9A+J5fpRwejS82f17bUOoXtOTCJxz0W2ckqeFjR8SBcg+HYA5dlWnzK8UwmsEAsP8q 5EKabd2T33/bcLRuL9MkgMG+qVUo4q6aBQKw5AbuxJangssleREUN5yy9LraNqrUsXZv juN9QfG06l8DeTA+kT/U62OH5T9IVDekzGg4A5R0Y5jQubWFIvJs1f0uq0fPdvd2ZTYE SjPg== X-Received: by 10.224.5.3 with SMTP id 3mr52305910qat.38.1414897782751; Sat, 01 Nov 2014 20:09:42 -0700 (PDT) Message-ID: <5455A075.1040208@gmail.com> Date: Sat, 01 Nov 2014 23:09:41 -0400 From: Sonny Michaud User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: Zsh Users Subject: Re: Sundry Completion Questions ($_ $(^^) $(!!:s//) References: <54557CF5.8030000@gmail.com> In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Thanks for the response, it really clarifies a lot. I did not have _expand in my completer, but I see how it ends up producing gibberish. On 11/01/2014 10:08 PM, Bart Schaefer wrote: > On Nov 1, 2014 5:39 PM, "Sonny Michaud" wrote: >> 1) I noticed that $_ does not expand. > It expands for me. It doesn't expand to anything very useful, because its > value changes during the execution of the completion functions, but it does > expand. > > Do you have _expand in your "completer" zstyle? > >> 2) Quick history substitution does not expand in subcommands. > Quick history substitution is a command-line construct, not a command > syntax construct. It only works when the quick-history character appears > as the first character of the input buffer. > >> 3) Since the above does not work, I usually use $(!!:s/foo/bar), which > has bizarre behavior, depending on whether or not a trailing slash is > provided. > > History syntax doesn't interact with shell command syntax in the way you > are expecting. *Everything* after the second slash, *including* the > closing paren, is part of the history reference unless you close the > history syntax by adding the third slash. > > History substitution is a purely lexical replacement which occurs before > any shell-syntax analysis of the input is performed. >