From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27277 invoked by alias); 12 Apr 2015 22:09:39 -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: 20148 Received: (qmail 2868 invoked from network); 12 Apr 2015 22:09:37 -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=-0.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,LONGWORDS,RCVD_IN_DNSWL_LOW autolearn=no 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; bh=Yb79BxtLDtkizybH5p3+GiZRVnEP2bWFaCmu8i+eFCA=; b=FqY8+xQMF3uXudgvUWyGPQEZkKzDeFENnHhU/+IbrocdbpjdcaiKWCiNTJk7wYhss+ 0Dh5zJ9lc7Ap6wfS7mXc08FlVJhes7uE1TjD9X3Ip7/DRHoCVeSwIXvkFQRtkJU4YXJH 3FROczBJCV6zT6fqhVftUFt+nPdlHOPIJfQsLc7bD5plNTvCjRYd0jIXQOMNRH3fTm4P +a2hpUqYoQ7hUnGJg1Cu658pL8X7n91Tz8PSsvI56IOY1V2n+7T9tiY6b4wWUmwLl4YZ mO6OQwxqcdjGfkQrzJiFK7aSiJO/gTq6QjMc2RMCZuwJ1QjOPhSd8GwvTg23bRqoUvzj 9c/g== X-Received: by 10.68.227.195 with SMTP id sc3mr21308574pbc.64.1428876575078; Sun, 12 Apr 2015 15:09:35 -0700 (PDT) Message-ID: <552AED13.7070806@gmail.com> Date: Mon, 13 Apr 2015 08:09:23 +1000 From: Aleksandrina Nikolova User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: zsh-users@zsh.org Subject: Re: mkdir completion not offering ignored patterns References: <5528B4C2.3010001@gmail.com> <150411134410.ZM27516@torch.brasslantern.com> <5529A5C2.3090603@gmail.com> <150412101826.ZM21679@torch.brasslantern.com> In-Reply-To: <150412101826.ZM21679@torch.brasslantern.com> Content-Type: multipart/mixed; boundary="------------080801060002010101070008" --------------080801060002010101070008 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit On 13/04/15 03:18, Bart Schaefer wrote: > >> 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. Oh, sorry about this, I thought the options I have set don't affect the style in particular, but you're right. I attach a more complete .zshrc with the options I have set as well. > 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 '' Great find! Although that workaround did not work for me, the one that did (a more ugly one, but...) was to simply remove the call to _messages: functions[_mkdir]="${functions[_mkdir]:s/ || _message 'name of directory'/}" And now it works great. Thank you! --------------080801060002010101070008 Content-Type: text/plain; charset=UTF-8; name="zshrc" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="zshrc" ######## COMPLETION, EXPANSION & MATCHING ######### autoload -Uz compinit compinit autoload +X _mkdir functions[_mkdir]="${functions[_mkdir]:s/ || _message 'name of directory'/}" setopt extendedglob zstyle :compinstall filename '/home/aleksandrina/.zshrc' zstyle ':completion:*' completer _expand _complete _prefix _ignored _complete:-separators _match _approximate zstyle ':completion:*:expand:*' add-space true zstyle ':completion:*:prefix:*' add-space false zstyle ':completion:*' accept-exact false zstyle ':completion:*' accept-exact-dirs false zstyle ':completion:*:paths' ambiguous true zstyle ':completion:*' insert-tab false zstyle ':completion:*' insert-unambiguous true zstyle ':completion:*' last-prompt true zstyle ':completion:*' list-dirs-first true zstyle ':completion:*' list-grouped true zstyle ':completion:*' list-packed true zstyle ':completion:*' list-suffixes true zstyle ':completion:*' list-separator '#' zstyle ':completion:*' original true zstyle ':completion:*' path-completion true zstyle ':completion:*' rehash true zstyle ':completion:*' remove-all-dups true zstyle ':completion:*' prefix-hidden false zstyle ':completion:*' squeeze-slashes false zstyle ':completion:*' expand suffix zstyle ':completion:*' fake-parameters 'DISPLAY:scalar' zstyle ':completion:*' group-name '' zstyle ':completion:*' list-colors ${(s.:.)~~LS_COLORS} zstyle ':completion:*' list-prompt %Smatch %M, line %L: Hit '' for more, or the character to insert%s zstyle ':completion:*' select-prompt %SScrolling active: current selection at %p%s zstyle ':completion:*' menu select=2 zstyle ':completion:*' auto-description true zstyle ':completion:*' verbose true zstyle ':completion:*' word false zstyle ':completion:*:auto-describe' format 'specify: %d' zstyle ':completion:*:descriptions' format ' %F{cyan}%B%d:%b%f' zstyle ':completion:*:-command-:*' completer _expand _complete _prefix _match _approximate _history _ignored zstyle ':completion:*:-command-:*' group-order aliases functions builtins commands zstyle ':completion:*:-command-:*' tag-order "aliases suffix-aliases reserved-words functions:-non-ignored builtins commands" parameters functions zstyle ':completion:*:functions-non-ignored' ignored-patterns '_*' zstyle ':completion:*:complete-separators:*' matcher-list '' 'r:|[._-]=** r:[^[:upper:]0-9]||[[:upper:]0-9]=** r:|=** l:|=**' '+m:{[:lower:][:upper:]}={[:upper:][:lower:]}' zstyle ':completion:*:approximate:*' max-errors 1 numeric zstyle ':completion:*:correct:*' max-errors 3 numeric zstyle ':completion:*:expand:*' glob true zstyle ':completion:*:expand:*' substitute true zstyle ':completion:*:expand:*' suffix true zstyle ':completion:*:expand:*' tag-order expansions zstyle ':completion:*:match:*' match-original true zstyle ':completion:*:ignore:*' single-ignored menu zstyle ':completion:*:cd:*' tag-order local-directories "path-directories named-directories directory-stack users" zstyle ':completion:*:((*-|)files|(*-|)directories)' ignored-patterns '(*/|).[^/]##' zstyle ':completion:*:jobs' prefix-needed false zstyle ':completion:*:jobs' numbers true zstyle ':completion:*:processes' list-colors '=(#b) #([0-9]#)*=0=01' zstyle ':completion:*:processes' insert-ids single (( $UID )) && zstyle ':completion:*:processes' command "ps -u $USER" \ || zstyle ':completion:*:processes' command 'ps -e' zstyle ':completion:*:sudo::' environ PATH="/sbin:/usr/sbin:$PATH" HOME="/root" zstyle ':completion:*' complete true # _expand_alias zstyle ':completion:*' complete-options false # cd, pushd zstyle ':completion:*' stop true # _history_complete_word zstyle ':completion:*' recent-dirs-insert fallback zstyle ':chpwd:*' recent-dirs-default true setopt autocd cdablevars chasedots chaselinks unsetopt autoremoveslash listtypes setopt braceccl cshnullglob extendedglob globassign globdots globsubst histsubstpattern numericglobsort rcexpandparam rematchpcre setopt extendedhistory histexpiredupsfirst histignoredups histignorespace histreduceblanks incappendhistory sharehistory unsetopt histbeep setopt interactivecomments promptsubst rcquotes unsetopt beep unsetopt checkjobs hup setopt autopushd pushdignoredups pushdsilent --------------080801060002010101070008--