zsh-workers
 help / color / mirror / code / Atom feed
* Re: Things which used to work
@ 2000-02-14 10:28 Sven Wischnowsky
  0 siblings, 0 replies; 2+ messages in thread
From: Sven Wischnowsky @ 2000-02-14 10:28 UTC (permalink / raw)
  To: zsh-workers


Peter Stephenson wrote:

> Something's gone screwy with my file completion.  Consider completing after
> `gv '.
> 
> 
> First, I get the options even with no `-'.  The following used to work so
> that I didn't in this case:
> 
>     zstyle ':completion:*' prefix-needed no
>     zstyle ':completion:*:(options|signals)*' prefix-needed yes
> 
> (Actually, I didn't have the `*' at the end of the second pattern before,
> but I added it to see if it helped, but it didn't.  It shouldn't be
> necessary since `options' is a tag.)  Switching prefix-needed to yes
> globally does work, however.

The styles weren't sorted correctly.

> Second, if I type a directory name, I *only* get postscript files completed,
> and not directory names even if there are no postscript files.  It works if
> I type the first letter of a directory, but if that wasn't how it worked
> before.  Furthermore, the listing looks like this:
> 
> % gv ./             
> Completing postscript file
> Completing PDF file
> / 
> 
> Apart from the missing directories, I don't know where that final `/' came
> from.  (The rest is OK.)  I don't have any sort-tags style defined.

I had overlooked one use of $tmp2 in _path_files.

> Third, if I use the zmodload completion I get all the files in the relevant
> directories, not just those ending in .so, even though the glob pattern is
> explicit, and there are .so files present.  `zmodload zsh/...' seems to
> have given up completely.

Missing initialisation for $dopts in _files.


Bye
 Sven

diff -ru ../z.old/Completion/Core/_files Completion/Core/_files
--- ../z.old/Completion/Core/_files	Mon Feb 14 10:08:27 2000
+++ Completion/Core/_files	Mon Feb 14 11:20:22 2000
@@ -35,6 +35,8 @@
   elif [[ "$type" != *[/g]* ]]; then
     type="${type}/"
   fi
+else
+  dopts=()
 fi
 if zstyle -s ":completion:${curcontext}:globbed-files" file-patterns tmp &&
    [[ -n "$tmp" ]]; then
diff -ru ../z.old/Completion/Core/_path_files Completion/Core/_path_files
--- ../z.old/Completion/Core/_path_files	Mon Feb 14 10:08:28 2000
+++ Completion/Core/_path_files	Mon Feb 14 11:20:36 2000
@@ -276,9 +276,9 @@
       if [[ "$sopt" = *[/f]* && ( -o globdots || "$PREFIX" = .* ) ]] &&
 	  zstyle -s ":completion:${curcontext}:paths" special-dirs atmp; then
 	if [[ "$atmp" = (yes|true|1|on) ]]; then
-	  tmp2=( "$tmp2[@]" . .. )
+	  tmp1=( "$tmp1[@]" . .. )
 	elif [[ "$atmp" = .. ]]; then
-	  tmp2=( "$tmp2[@]" .. )
+	  tmp1=( "$tmp1[@]" .. )
         fi
       fi
     fi
@@ -333,7 +333,6 @@
       # if none of the patterns match.
 
       if [[ -z "$tpre$tsuf" && -n "$pre$suf" ]]; then
-        tmp1=( "$tmp2[@]" )
 	pfxsfx=(-S '' "$pfxsfx[@]")
 	break;
       elif [[ "$haspats" = no && -z "$tpre$tsuf" &&
diff -ru ../z.old/Src/Modules/zutil.c Src/Modules/zutil.c
--- ../z.old/Src/Modules/zutil.c	Mon Feb 14 10:14:09 2000
+++ Src/Modules/zutil.c	Mon Feb 14 10:29:20 2000
@@ -155,7 +155,7 @@
 	    tmp = 2;
 	}
     }
-    p->weight = weight + tmp;
+    p->weight = (weight += tmp);
 
     for (qq = NULL, q = s->pats; q && q->weight >= weight;
 	 qq = q, q = q->next);

--
Sven Wischnowsky                         wischnow@informatik.hu-berlin.de


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Things which used to work
@ 2000-02-13 18:43 Peter Stephenson
  0 siblings, 0 replies; 2+ messages in thread
From: Peter Stephenson @ 2000-02-13 18:43 UTC (permalink / raw)
  To: Zsh hackers list

Something's gone screwy with my file completion.  Consider completing after
`gv '.


First, I get the options even with no `-'.  The following used to work so
that I didn't in this case:

    zstyle ':completion:*' prefix-needed no
    zstyle ':completion:*:(options|signals)*' prefix-needed yes

(Actually, I didn't have the `*' at the end of the second pattern before,
but I added it to see if it helped, but it didn't.  It shouldn't be
necessary since `options' is a tag.)  Switching prefix-needed to yes
globally does work, however.


Second, if I type a directory name, I *only* get postscript files completed,
and not directory names even if there are no postscript files.  It works if
I type the first letter of a directory, but if that wasn't how it worked
before.  Furthermore, the listing looks like this:

% gv ./             
Completing postscript file
Completing PDF file
/ 

Apart from the missing directories, I don't know where that final `/' came
from.  (The rest is OK.)  I don't have any sort-tags style defined.


Third, if I use the zmodload completion I get all the files in the relevant
directories, not just those ending in .so, even though the glob pattern is
explicit, and there are .so files present.  `zmodload zsh/...' seems to
have given up completely.


It's quite possible this all relates to the change in style contexts, but
if so I haven't a clue how.  In case it does, here's my complete list of
styles.

    autoload -U compinit
    compinit
    zstyle ':completion:*' matcher 'm:{a-zA-Z}={A-Za-z}' 'r:|[.,_-]=* r:|=*'

    # This effectively replaces ZLS_COLORS
    zstyle -d ':completion:*::::'
    zstyle -d ':completion:*::::default'
    zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS}

    zstyle ':completion:*' completer _matcher _oldlist _complete _approximate
    # This one is a bit ugly. You may want to use only `*:correct'
    # if you also have the `correctword_*' or `approximate_*' keys.
    zstyle ':completion:*:(correct|approximate):*' max-errors 2 numeric
    zstyle ':completion:*:(correct|approximate):*' prompt \
      'Correcting (%e errors):'
    zstyle ':completion:*:oldlist:*' list 'never'
    zstyle ':completion:*:descriptions' format 'Completing %d'
    zstyle ':completion:*' prefix-needed no
    zstyle ':completion:*:(options|signals)*' prefix-needed yes
    zstyle ':completion:*:options' description 'true'
    zstyle ':completion:*' menu "select=6"
    zstyle ':completion:*:oldlist*' menu true
    zstyle ':completion:*' group-name ''
    zstyle ':completion:*:urls' path ~/.urls
    zstyle '*' hosts $hosts


-- 
Peter Stephenson <pws@pwstephenson.fsnet.co.uk>


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2000-02-14 10:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-02-14 10:28 Things which used to work Sven Wischnowsky
  -- strict thread matches above, loose matches on Subject: below --
2000-02-13 18:43 Peter Stephenson

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).