From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20938 invoked by alias); 22 May 2012 08:32:28 -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: 30487 Received: (qmail 1291 invoked from network); 22 May 2012 08:32:27 -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.6 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED,RCVD_IN_DNSWL_LOW, T_DKIM_INVALID autolearn=no version=3.3.2 Received-SPF: pass (ns1.primenet.com.au: SPF record at _spf.google.com designates 209.85.210.43 as permitted sender) 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:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=yoizutXG/ni9XLxiVbnEoLO0GTJzpwXaIF1B8OdqqYQ=; b=Ssb/7txrKpnPcUr4TJ26H5gJXapk/Ykwe9qLYEZ6vETmCmld870oykSqbtgmzb1WEy jFOe3uPp67D2L+othKNTidpo6ffLh3Me9J+2woaxNhnvdPlcY4QTchTdqsOK+hGtVn2W s3Z5l8S/nAHNmAWFhM/JnvXgUwMBWyKEM74g7sKJZ11rLBeCAvi0NjT69NBY9naQCLLO z7mXs7T9dyQJCimY5eSQQ72XQ16TBcOrs69p/BCCUPyzqEHOvVgCYzYzbINB1H5BSqWV zutSd55+Ddx/PsXIElzP05lsszoem6wzQixlRIY54uLL0+xn27mQwIdFLHexAI0KY2RO 2qXQ== Message-ID: <4FBB4EED.5000504@gmail.com> Date: Tue, 22 May 2012 16:31:41 +0800 From: Hong Xu User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:12.0) Gecko/20120428 Thunderbird/12.0.1 MIME-Version: 1.0 To: Bart Schaefer CC: "zsh-workers@zsh.org" Subject: Re: Suggestion: chmod +x auto completion only completes files that do not have executable permission References: <8CECA1C5-C06C-4888-B5C9-21C8DF5EC2C6@gmail.com> <120521091901.ZM32541@torch.brasslantern.com> In-Reply-To: <120521091901.ZM32541@torch.brasslantern.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit On 05/22/2012 12:19 AM, Bart Schaefer wrote: > On May 18, 4:56pm, Hong Xu wrote: > } > } I have a suggestion about chmod auto completion here. We could > } complete only chmod +x with files that do not have executable > } permission, and vice versa. We could also apply this rule to chmod +r, > } chmod +w, etc. What do you think? > > As far as I can tell, chmod completion already does this. _chmod has > this snippet: > > for spec in ${(s:,:)words[2]} > do > if [[ ${spec#*[+-=]} != [rwxst]## ]] > then > _files&& ret=0 > return ret > fi > specs+=(${${(M)spec##[+-=]*}:+a}$spec) > done > _wanted files expl file _files -g "*(-.^f:${(j.,.)specs}:)"&& ret=0 > > Do you have a case where it's failing? Weird, now it works for me like a charm. Thanks anyway! Hong