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

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


Still some funny thing

bor@itsrm2:/tools%> zsh -f
itsrm2% fpath=(/tools/src/zsh-3.1.5-pws-12/Completion/*(/))
itsrm2% source /tools/src/zsh-3.1.5-pws-12/Completion/Core/compinit
itsrm2% cdpath=(~ /tools/src)
itsrm2% cd s/*3TAB  ==>
itsrm2% cd save/SIspl31
SIspl31/           ncftp-3.0beta18/   tcl8.0.3/          zsh-3.1.5-pws-12/
ao13/              patch-2.5.3/       tk8.0.3/
autoconf-2.13/     samba-2.0.3/       top-3.4/
mc-4.5.13/         sendmail-8.9.3/    wget-1.5.3/

Note, that SIspl31 does *not* have autoremoved slash. This is true for all
cases, when directory is in cdpath and not in current dir (save is ~/save).
Continueing menu completion:

itsrm2% cd save/ao13
SIspl31/           ncftp-3.0beta18/   tcl8.0.3/          zsh-3.1.5-pws-12/
ao13/              patch-2.5.3/       tk8.0.3/
autoconf-2.13/     samba-2.0.3/       top-3.4/
mc-4.5.13/         sendmail-8.9.3/    wget-1.5.3/

but (/tools/src/autoconf-2.13)

itsrm2% cd src/autoconf-2.13/
SIspl31/           ncftp-3.0beta18/   tcl8.0.3/          zsh-3.1.5-pws-12/
ao13/              patch-2.5.3/       tk8.0.3/
autoconf-2.13/     samba-2.0.3/       top-3.4/
mc-4.5.13/         sendmail-8.9.3/    wget-1.5.3/

cheers

/andrej


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