From: Hong Xu <xuhdev@gmail.com>
To: Bart Schaefer <schaefer@brasslantern.com>
Cc: "zsh-workers@zsh.org" <zsh-workers@zsh.org>
Subject: Re: Suggestion: chmod +x auto completion only completes files that do not have executable permission
Date: Tue, 22 May 2012 16:31:41 +0800 [thread overview]
Message-ID: <4FBB4EED.5000504@gmail.com> (raw)
In-Reply-To: <120521091901.ZM32541@torch.brasslantern.com>
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
prev parent reply other threads:[~2012-05-22 8:32 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-18 8:56 Hong Xu
2012-05-21 16:19 ` Bart Schaefer
2012-05-22 8:31 ` Hong Xu [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4FBB4EED.5000504@gmail.com \
--to=xuhdev@gmail.com \
--cc=schaefer@brasslantern.com \
--cc=zsh-workers@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).