zsh-workers
 help / color / mirror / code / Atom feed
From: Sven Wischnowsky <wischnow@informatik.hu-berlin.de>
To: zsh-workers@sunsite.auc.dk
Subject: Re: PATCH: Re: completion after ../
Date: Mon, 24 Jan 2000 10:10:53 +0100 (MET)	[thread overview]
Message-ID: <200001240910.KAA02702@beta.informatik.hu-berlin.de> (raw)
In-Reply-To: Tanaka Akira's message of 22 Jan 2000 03:11:48 +0900


Tanaka Akira wrote:

> ...
> 
> The updated _comp_ignore is not used.

Ouch. The patch should fix this.

> > Note however, that there is no automatic switching to list-only and no 
> > way to get at the ignored directories on a second TAB or something
> > like this. The ignored names are put in the alternate set so that one
> > gets them if no other names match.
> > 
> > 
> > I think what sometimes irritated me can be fixed with `pwd' or maybe
> > `pwd ..' and Tanaka's with `parent' or `parent ..'. I hope.
> 
> Hm.  It's not enough for me.  Sometimes I hit <TAB> after a path which
> contains only one directory.  Suppose zsh-3.1.6-dev-15 is installed
> in its own prefix /app/zsh-3.1.6-dev-15 and the current working
> directory is /app/zsh-3.1.6-dev-15/share/zsh/3.1.6-dev-15/functions.
> When completion is tried as `cd ../../../<TAB>', the alternative set
> has only one entry `zsh' and non-alternative set is empty if I
> understand the style correctly and it works well.  So zsh completes
> the line as `cd ../../../zsh/'.  But it frustrates me because I must
> remove `zsh/' before adding `../'.

[ This should be quite easy using undo... but, see below. ]

>  I hope a style to automatic
> switching to list-only.  Although I tried to do it, I couldn't find a
> way.

I have several problems with this. First, at least for me, this is
probably quite irritating. Second: how to do it. It is possible, of
course, but we would have to set some flag when parent directories
have been ignored, and test that flag at the very end of completion
because only then do we know if there is only one match. I.e. the code 
for it would be scattered between _path_files and, say, _main_complete. 

Maybe it is enough if we add a special value to ignore_parents so that 
the special-dirs (`..' and `.' are added to the alternate set if there 
were ignored directories (we could also do that only if ignore-parents 
leaves the normal set empty and the alternate set with only one
string, but if _path_files is called more than once or any other
completion function is called, the result may again be not what one
wants).

Or maybe we write a completer (a real, top-level completer) that
registers a post-completion function which checks if there are only
alternate matches (or only one alternate match) and no normal one and, 
if this is the case, makes a list be shown instead of the match(es) be 
used. That would be quite easy (set compstate[insert]='',
compstate[list]='list force'), , but I'm not sure if this is enough or 
the right thing at all.

Bye
 Sven

diff -ru ../z.old/Completion/Core/_path_files Completion/Core/_path_files
--- ../z.old/Completion/Core/_path_files	Mon Jan 24 09:58:01 2000
+++ Completion/Core/_path_files	Mon Jan 24 09:59:14 2000
@@ -326,6 +326,8 @@
 	    [[ "$i" -ef "$PWD" ]] && _comp_ignore=( "$_comp_ignore[@]" "${(q)i}" )
 	  done
         fi
+       (( $#_comp_ignore )) && (( $expl[(I)-F] )) ||
+           expl=( "$expl[@]" -F _comp_ignore )
       fi
       if [[ "$sopt" = *[/f]* && ( -o globdots || "$PREFIX" = .* ) ]] &&
 	  zstyle -s ":completion${curcontext}:paths" special-dirs atmp; then

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


             reply	other threads:[~2000-01-24  9:11 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-01-24  9:10 Sven Wischnowsky [this message]
2000-02-17 23:33 ` Tanaka Akira
  -- strict thread matches above, loose matches on Subject: below --
2000-02-21  9:28 Sven Wischnowsky
2000-02-18  9:39 Sven Wischnowsky
2000-02-20 12:17 ` Tanaka Akira
2000-01-21 13:39 Sven Wischnowsky
2000-01-21 18:11 ` Tanaka Akira

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=200001240910.KAA02702@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).