zsh-workers
 help / color / mirror / code / Atom feed
From: Sven Wischnowsky <wischnow@informatik.hu-berlin.de>
To: zsh-workers@sunsite.auc.dk
Subject: PATCH: RE: _path_files and _cd  with explicit glob pattern
Date: Fri, 19 Mar 1999 12:03:23 +0100 (MET)	[thread overview]
Message-ID: <199903191103.MAA01592@beta.informatik.hu-berlin.de> (raw)
In-Reply-To: "Andrej Borsenkow"'s message of Fri, 19 Mar 1999 12:59:51 +0300


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


             reply	other threads:[~1999-03-19 11:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-03-19 11:03 Sven Wischnowsky [this message]
1999-03-19 18:46 ` Andrej Borsenkow

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=199903191103.MAA01592@beta.informatik.hu-berlin.de \
    --to=wischnow@informatik.hu-berlin.de \
    --cc=zsh-workers@sunsite.auc.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).