zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <pws@csr.com>
To: Peter Stephenson <pws@csr.com>
Cc: "zsh workers" <zsh-workers@sunsite.dk>
Subject: Re: Change in FIGNORE behavior
Date: Wed, 30 May 2007 11:29:34 +0100	[thread overview]
Message-ID: <20070530112934.3950357b@news01.csr.com> (raw)
In-Reply-To: <200705300945.l4U9jUbE009607@news01.csr.com>

On Wed, 30 May 2007 10:45:29 +0100
Peter Stephenson <pws@csr.com> wrote:
> > Even though FIGNORE is set, if there are no other matches,
> > completion should match the backup file, right?  That's the way the
> > shell used to behave.  I've done a little bisecting and it appears
> > this behavior changed sometime between 2007-05-15 and 007-05-23.
> 
> This is supposed to be handled by the _ignored completer;
> is some change causing that not to be set?  If not, maybe the output
> of _complete_debug would be helpful.

I've found what's causing it by using the default set of completers: it's
the effect of the change in (R) on this code in _ignored:

  zstyle -a ":completion:${curcontext}:" completer comp ||
    comp=( "${(@)_completers[1,_completer_num-1][(R)_ignored(|:*),-1]}" )

With

  _completers=(_complete _ignored)
  _completer_num=2

comp used to get set to _complete, now its empty.  It previously worked
because a failure to find _ignored(|:*) set the second start subscript to 0
which was interpreted as 1.  I presume the idea is we only want completers
starting from any previous occurence of _ignored, or the start.  This is a
bit too opaque for my liking anyway.  This expands that form where it
occurs in both _ignored and _prefix.

I'm glad somebody spotted this.

Index: Completion/Base/Completer/_ignored
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Base/Completer/_ignored,v
retrieving revision 1.1
diff -u -r1.1 _ignored
--- Completion/Base/Completer/_ignored	2 Apr 2001 11:07:28 -0000	1.1
+++ Completion/Base/Completer/_ignored	30 May 2007 10:25:26 -0000
@@ -5,9 +5,13 @@
 [[ _matcher_num -gt 1 || $compstate[ignored] -eq 0 ]] && return 1
 
 local comp
+integer ind
 
-zstyle -a ":completion:${curcontext}:" completer comp ||
-  comp=( "${(@)_completers[1,_completer_num-1][(R)_ignored(|:*),-1]}" )
+if ! zstyle -a ":completion:${curcontext}:" completer comp; then
+  comp=( "${(@)_completers[1,_completer_num-1]}" )
+  ind=${comp[(I)_ignored(|:*)]}
+  (( ind )) && comp=("${(@)comp[ind,-1]}")
+fi
 
 local _comp_no_ignore=yes tmp expl \
       _completer _completer_num \
Index: Completion/Base/Completer/_prefix
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Base/Completer/_prefix,v
retrieving revision 1.4
diff -u -r1.4 _prefix
--- Completion/Base/Completer/_prefix	5 Dec 2003 10:35:24 -0000	1.4
+++ Completion/Base/Completer/_prefix	30 May 2007 10:25:26 -0000
@@ -7,9 +7,13 @@
 local comp curcontext="$curcontext" tmp suf="$SUFFIX" \
       _completer \
       _matcher _c_matcher _matchers _matcher_num
+integer ind
 
-zstyle -a ":completion:${curcontext}:" completer comp ||
-  comp=( "${(@)_completers[1,_completer_num-1][(R)_prefix(|:*),-1]}" )
+if ! zstyle -a ":completion:${curcontext}:" completer comp; then
+  comp=( "${(@)_completers[1,_completer_num-1]}" )
+  ind=${comp[(I)_prefix(|:*)]}
+  (( ind )) && comp=("${(@)comp[ind,-1]}")
+fi
 
 if zstyle -t ":completion:${curcontext}:" add-space; then
   ISUFFIX=" $SUFFIX"


-- 
Peter Stephenson <pws@csr.com>                  Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK                          Tel: +44 (0)1223 692070


To access the latest news from CSR copy this link into a web browser:  http://www.csr.com/email_sig.php

To get further information regarding CSR, please visit our Investor Relations page at http://ir.csr.com/csr/about/overview


  reply	other threads:[~2007-05-30 10:31 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-30  1:56 Vin Shelton
2007-05-30  9:45 ` Peter Stephenson
2007-05-30 10:29   ` Peter Stephenson [this message]
2007-05-30 10:58     ` Bart Schaefer
2007-05-30 11:27       ` Peter Stephenson
2007-05-30 12:54         ` Peter Stephenson
2007-06-04  9:49           ` Peter Stephenson
2007-06-04 16:56             ` Bart Schaefer
2007-06-05 14:19               ` Peter Stephenson
2007-06-15 10:09                 ` Peter Stephenson
2007-06-15 10:22                   ` Stephane Chazelas
2007-06-15 10:30                     ` Peter Stephenson
2007-06-18 13:32                   ` Peter Stephenson
2007-06-20  5:13                     ` Version emulation (Re: Change in FIGNORE behavior) Bart Schaefer

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=20070530112934.3950357b@news01.csr.com \
    --to=pws@csr.com \
    --cc=zsh-workers@sunsite.dk \
    /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).