From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9154 invoked by alias); 3 Jun 2016 19:29:07 -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: 21609 Received: (qmail 11145 invoked from network); 3 Jun 2016 19:29:06 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=from:message-id:date:in-reply-to:comments:references:to:subject :mime-version; bh=7sYUn92W9GihBqK4YDloqePz30L0wamtbLl6fcdPTRQ=; b=rkQL2ztce/F+ptTZOo892d0pjRhgubADDqmUTc4qvoycO0i2WTj4rtXr22j+LPIOLf bGiF1ECrdibQDyAFONM6d0oChIonPNI45T8BXSRmCcT3MMibdrMHFsdWlYVT+qmsXN4v c0LIqWJn44klheUh2DrxOk36Ny4n86iy26wLC7+2zzt1xrr/brfkCMoMxfweOTnifpR5 4OGcgWBw9nvykXM8yKs16FF6/FkJuLq5tKMNtW+NJxW0XdW3F2vo611NsCpncZ5t+vM+ SlC3cKWxL/9t5RrEM1OvAn7ffeocojn4ZrQ64Tj80D+upG/glD+YeC4TNktrlPoSuN9w 0H4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:message-id:date:in-reply-to:comments :references:to:subject:mime-version; bh=7sYUn92W9GihBqK4YDloqePz30L0wamtbLl6fcdPTRQ=; b=mgD6jSmLw5T3Jx0+XNk1Ehp/Tcy6TyeDPJcgCReqlNNb8ARNEbNBgsJxMKQjCSkIdL 0dLNyhzRQsYMFwsY01V8ntYD60VYBFiY8mmygqeM0jmzb8+ZcLhVMAFEaBttJuxskwdO mIpX1SuVPV0ayLmb+loh6K1GmkleC151NTknfnnujyXSPvvpFObyGpjcFMXn0DW9vIJQ +4G2fUGmanYh3vYdL24RLX1IPniACsHZZvlEbNK8ku05rMtDIQrZQnvCedLuE7VmwUYj EyU15u1wCJgOpztcWnlJ/E2fi9FA+iJMFdLR7uGEBOzIRUjY6VZtHG3XaJ+k8tEiAjOz XA0Q== X-Gm-Message-State: ALyK8tI5/8GHJLtlud1pSWAWn+bFGWkp+ltuY59DxfxNnAxhTXXLia3uswZb5f9iGyYeqQ== X-Received: by 10.66.152.111 with SMTP id ux15mr6986205pab.43.1464982145019; Fri, 03 Jun 2016 12:29:05 -0700 (PDT) From: Bart Schaefer Message-Id: <160603122905.ZM24555@torch.brasslantern.com> Date: Fri, 3 Jun 2016 12:29:05 -0700 In-Reply-To: <20160603053123.GA26773@fujitsu.shahaf.local2> Comments: In reply to Daniel Shahaf "X=`cat ~/y` completion" (Jun 3, 5:31am) References: <20160603053123.GA26773@fujitsu.shahaf.local2> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-users@zsh.org Subject: Re: X=`cat ~/y` completion MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii [This is more properly a -workers discussion but I'll continue on -users because we started here.] On Jun 3, 5:31am, Daniel Shahaf wrote: } Subject: X=`cat ~/y` completion } } Consider the following two cases: } } % X=`cat $HOME/t } % X=`cat ~/t } } In 'zsh -f' + compinit, the former works but the latter doesn't. } I expect the latter to behave as the former does. } } --- } } The last related discussion seems to be 35515/35539. I don't think those are related, completing after ~/ works elsewhere. The real difficulty seems to follow from testing $compstate[quote] on line 276: } 276 elif [[ "$pre[1]" = \~ && -z "$compstate[quote]" ]]; then } 277 } 278 # It begins with `~', so [...] The word on line does begin with tilde, but that's ignored because it is inside the backticks. The test could be either != [\'\"] or = (|\`) but I went with the latter because the former confuses vim syntax highlighting. diff --git a/Completion/Unix/Type/_path_files b/Completion/Unix/Type/_path_files index c64ebf5..14c4cc7 100644 --- a/Completion/Unix/Type/_path_files +++ b/Completion/Unix/Type/_path_files @@ -273,7 +273,7 @@ if [[ "$pre" = [^][*?#^\|\<\>\\]#(\`[^\`]#\`|\$)*/* && "$compstate[quote]" != \' orig="${orig[1,(in:i:)/][1,-2]}" donepath= prepaths=( '' ) -elif [[ "$pre[1]" = \~ && -z "$compstate[quote]" ]]; then +elif [[ "$pre[1]" = \~ && "$compstate[quote]" = (|\`) ]]; then # It begins with `~', so remember anything before the first slash to be able # to report it to the completion code. Also get an expanded version of it