zsh-workers
 help / color / mirror / code / Atom feed
* PATCH: _cd
@ 1999-07-02 17:04 Tanaka Akira
  0 siblings, 0 replies; 3+ messages in thread
From: Tanaka Akira @ 1999-07-02 17:04 UTC (permalink / raw)
  To: zsh-workers

I think that the completion code for pushd [-+] is also useful with
cd.

--- Completion/Builtins/_cd-	Sat Jul  3 01:55:59 1999
+++ Completion/Builtins/_cd	Sat Jul  3 01:56:50 1999
@@ -5,7 +5,7 @@
 #    and the string doesn't begin with ~, /, ./ or ../.
 #  - In the second argument to cd for the form `cd old new', completes
 #    possible `new' strings by examining `old' and $PWD.
-#  - After pushd - or pushd +, completes numbers, but the listing
+#  - After - or +, completes numbers, but the listing
 #    gives you the list of directories to complete.  This turns on
 #    menu-completion and lists the possibilities automatically, otherwise
 #    it's not a lot of use.  If you don't type the + or - it will
@@ -25,7 +25,7 @@
   # Now remove all the common parts of $PWD and the completions from this
   rep=(${${rep#${PWD%%$words[2]*}}%${PWD#*$words[2]}})
   (( ! $#rep )) || compadd $rep
-elif [[ $words[1] = pu* && $PREFIX = [-+]* ]]; then
+elif [[ $PREFIX = [-+]* ]]; then
   # pushd: just complete the numbers, but show the full directory list with
   # numbers.
   # For - we do the same thing, but reverse the numbering (other

-- 
Tanaka Akira


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

* Re: PATCH: _cd
@ 1999-09-17  9:43 Sven Wischnowsky
  0 siblings, 0 replies; 3+ messages in thread
From: Sven Wischnowsky @ 1999-09-17  9:43 UTC (permalink / raw)
  To: zsh-workers


I wrote:

> This discussion about `don't always include the directoies from
> cdpath' made me think that this probably should be configurable in the 
> new system. I haven't done that yet, though, because maybe this could
> be done together with the other changes for `_files' (using the same
> config key, I mean). And btw. this config key (`path_merge_*' or
> whatever) should probably allow to define this on a per-command and/or 
> per-pattern basis. Which almost looks like a task for an array or
> association. Hm.

I've just stepped back some more...

Some time ago we had some people here asking if it were possible to
see first only, say, `*.tar' files and then hit some to to get the
directories. Now we have this discussion about showing options or
not. Why not combine them? What I'm thinking about is a combination of 
a completer that would be stuck in front of the `completer' key and
uses some config keys and/or parameters/arrays/whatevers to set up
some completion-system-global parameter(s). These are then used by all 
completion functions concerned to find out which matches should be
generated (and how, thinking about descriptions). And with (an
improved (and renamed) version of) `_verbose_list' one could get this
`first-this-and-then-that' behaviour.

This is big (quite some work), but if done well, should hopefully keep 
us from more such requests (or simplify implementing them).

We'll need some more discussion about this, though. Or maybe people
are already fed up with increasing complexity.

Bye
 Sven


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


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

* PATCH: _cd
@ 1999-09-17  9:29 Sven Wischnowsky
  0 siblings, 0 replies; 3+ messages in thread
From: Sven Wischnowsky @ 1999-09-17  9:29 UTC (permalink / raw)
  To: zsh-workers


This discussion about `don't always include the directoies from
cdpath' made me think that this probably should be configurable in the 
new system. I haven't done that yet, though, because maybe this could
be done together with the other changes for `_files' (using the same
config key, I mean). And btw. this config key (`path_merge_*' or
whatever) should probably allow to define this on a per-command and/or 
per-pattern basis. Which almost looks like a task for an array or
association. Hm.

Anyway. With cdablevars set doing `cd <TAB>' gave me `cd wischnow'.

Rather irritating that.

Bye
 Sven

diff -u oldcompletion/Builtins/_cd Completion/Builtins/_cd
--- oldcompletion/Builtins/_cd	Fri Sep 17 09:32:39 1999
+++ Completion/Builtins/_cd	Fri Sep 17 11:24:21 1999
@@ -67,7 +67,7 @@
   # variable names, but it hardly seems worth it.
   # Note we need a tilde because cdablevars also allows user home
   # directories, hence we also need nonomatch to suppress error messages.
-  if [[ -o cdablevars && ! -d ${tdir::=${PREFIX%%/*}} &&
+  if [[ -o cdablevars && -n "$PREFIX" && ! -d ${tdir::=${PREFIX%%/*}} &&
     -d ${~tdir2::="~$tdir"} ]]; then
       PREFIX="~$PREFIX"
       _path_files -/

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


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

end of thread, other threads:[~1999-09-17  9:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-07-02 17:04 PATCH: _cd Tanaka Akira
1999-09-17  9:29 Sven Wischnowsky
1999-09-17  9:43 Sven Wischnowsky

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