From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12276 invoked by alias); 12 Apr 2015 17:18:54 -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: 20145 Received: (qmail 19122 invoked from network); 12 Apr 2015 17:18:40 -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.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 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:content-type; bh=eCPkQ2ATMLxe8T/VzxCJVXaAnTnCm/lbxWFtiAH/pYo=; b=cSsjTBPRp+4xz1PKdiQutUmKNhA2/0NCsjLG8Qqx5iM5V5B8BzkMAEPKnmB3s0CJ56 jnVym8+vTvHBsu2vst0qQFumhG/AjpUmNaMIWEo5TVuWl5mTT2TjzTRZ8WldWEcTwwLO gEcg3wOlHrv7qX8/9tCDETWZs975d2Mi2GhyNzFZz9lCXUaQeY5Bmrrn8XYAJy+CUPnp KEpfRr2qy4dMv5jjJgJLO0JunHnnBl708M165cGyNoOl5QNjIxN/G+DtNTgGIQQeK1HB guhYEQtb+TZGaV+4hkSiB/eePGolr+aICwYepOOxTSK+M7TDmbqU4MOt1MQmSUomcT+W Ocog== X-Gm-Message-State: ALoCoQnv8kj60BU70pV4PoWb2E3rS58j9RBQlpDT8fQ8jC9gmDBitk4bqiYDt2QLqDk+1SBK7uQp X-Received: by 10.182.56.196 with SMTP id c4mr9583162obq.26.1428859111362; Sun, 12 Apr 2015 10:18:31 -0700 (PDT) From: Bart Schaefer Message-Id: <150412101826.ZM21679@torch.brasslantern.com> Date: Sun, 12 Apr 2015 10:18:26 -0700 In-Reply-To: <5529A5C2.3090603@gmail.com> Comments: In reply to Aleksandrina Nikolova "Re: mkdir completion not offering ignored patterns" (Apr 12, 8:52am) References: <5528B4C2.3010001@gmail.com> <150411134410.ZM27516@torch.brasslantern.com> <5529A5C2.3090603@gmail.com> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-users@zsh.org Subject: Re: mkdir completion not offering ignored patterns MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii So, disregard my previous message (see below). On Apr 12, 8:52am, Aleksandrina Nikolova wrote: } Subject: Re: mkdir completion not offering ignored patterns } } On 12/04/15 06:44, Bart Schaefer wrote: } > autoload +X _mkdir } > functions[_mkdir]="${functions[_mkdir]:s/_wanted/_tags directories;_requested}" } } Hi and thank you for replying! Your suggested solution changes nothing } for me though, not sure why it works for you. If it's of any importance, } my zsh version is 5.0.7 Hm. I must have tweaked something else in the course of trying things that led to that, because *just* that's not sufficient for me either. I went back through and discovered that I had not fully cleared some test styles and still had an ignored-patterns with a different context. Re-reading your original description more closely: > I have set the > completion system to ignore hidden files and only show them when there > are no other options (no other files in the listed directory or I > explicitly type . at the beginning). This actually should be the default behavior with no ignored-patterns set at all. So that made me confused about this: > zstyle ':completion:*:((*-|)files|(*-|)directories)' ignored-patterns '(*/|).[^/]##' > > Commenting the second one disables hiding of hidden files for all > commands and I get those offered by mkdir along with non-hidden ones. The only thing I can figure out is that you must use the GLOB_DOTS option, which causes _path_files to generate matches for hidden files. Perhaps that is an option for which completion should have a style override. Once I got that straight I was able to find the real reason for: > It works perfectly with all > commands but mkdir, which simply refuses to offer hidden files, ever. Which turns out to be that _mkdir calls _message which breaks out of the loop over _completers in _main_complete, so the _ignored completer in your style is never reached. This would not happen if you did not have a "format" style for the context with tag "descriptions" (which is used as a fallback for tag "messages"). _message really ought to be called only when there is no possibility of other completions being generated, not merely to suggest what ought to be typed at that point. Either that or it needs some option (the inverse of "_message -e"?) that tells _main_complete to continue even though a message is pending. There is at least a workaround: zstyle ':completion::*:mkdir::messages' format ''