zsh-workers
 help / color / mirror / code / Atom feed
* PATCH: RE: _path_files and _cd  with explicit glob pattern
@ 1999-03-19 11:03 Sven Wischnowsky
  1999-03-19 18:46 ` Andrej Borsenkow
  0 siblings, 1 reply; 2+ messages in thread
From: Sven Wischnowsky @ 1999-03-19 11:03 UTC (permalink / raw)
  To: zsh-workers


Andrej Borsenkow wrote:

> Ehem ... cd first looks in the current directory. So
> 
> bor@itsrm2:~/test%> ls -l cd
> total 0
> drwxr-xr-x   2 bor      sinix         96 Mar 19 12:55 foo
> bor@itsrm2:~/test%> echo $cdpath
> /home/bor/test/cd
> bor@itsrm2:~/test%> cd c/*oTAB
>   Beeps, but
> bor@itsrm2:~/test%> cd cd/foo
> bor@itsrm2:~/test/cd/foo%>
> 
> So, it looks, like cd completion ignores current directory

Right. The patch fixes also a little problem I just stumbled over in
`_path_files' (it was too eager to switch on menu-behavior).

Bye
 Sven

diff -u oc/Builtins/_cd Completion/Builtins/_cd
--- oc/Builtins/_cd	Mon Mar 15 10:08:49 1999
+++ Completion/Builtins/_cd	Fri Mar 19 11:59:54 1999
@@ -59,7 +59,7 @@
 
   return ret
 elif [[ $PREFIX != (\~|/|./|../)* && $#cdpath -ne 0 ]]; then
-  _path_files -W cdpath -/
+  _path_files -W "(. $cdpath)" -/
 else
   _path_files -/
 fi
diff -u oc/Core/_path_files Completion/Core/_path_files
--- oc/Core/_path_files	Mon Mar 15 12:51:38 1999
+++ Completion/Core/_path_files	Fri Mar 19 11:57:25 1999
@@ -111,7 +111,7 @@
 
 [[ $compstate[insert] = *menu || -n "$_comp_correct" ||
    ( $#compstate[pattern_match] -ne 0 &&
-     "$orig" != "${orig:q}" ) ]] && menu=yes
+     "${orig#\~}" != "${${orig#\~}:q}" ) ]] && menu=yes
 
 
 # We will first try normal completion called with `compgen', but only if we

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


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

end of thread, other threads:[~1999-03-19 18:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-03-19 11:03 PATCH: RE: _path_files and _cd with explicit glob pattern Sven Wischnowsky
1999-03-19 18:46 ` Andrej Borsenkow

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