zsh-workers
 help / color / mirror / code / Atom feed
From: Tanaka Akira <akr@jaist.ac.jp>
To: zsh-workers@sunsite.auc.dk
Subject: Re: PATCH: Re: completion after ../
Date: 22 Jan 2000 03:11:48 +0900	[thread overview]
Message-ID: <rsqln5jwazf.fsf@crane.jaist.ac.jp> (raw)
In-Reply-To: Sven Wischnowsky's message of "Fri, 21 Jan 2000 14:39:14 +0100 (MET)"

In article <200001211339.OAA04917@beta.informatik.hu-berlin.de>,
  Sven Wischnowsky <wischnow@informatik.hu-berlin.de> writes:

> Let's try it...

I tried it but it doesn't work for me even after one typo fix.

Z:akr@is27e1u11% Src/zsh -f
is27e1u11% bindkey -e; fpath=($PWD/Completion/*(/)); autoload -U compinit; compinit -D; compdef _tst tst
is27e1u11% mkdir -p tstdir/{foo,bar}
is27e1u11% cd tstdir
is27e1u11% ls
bar  foo
is27e1u11% zstyle '*' ignore-parents parent
is27e1u11% ls foo/../<TAB>
bar/  foo/

`foo/' shouldn't be listed, I think.

set -x says (after the patch in this message is applied):
is27e1u11% ls foo/../<TAB>
...
+_description:33> zstyle -a :completion:complete::ls::files ignored-patterns _comp_ignore
+_description:36> _comp_ignore=( ) 
...
+_path_files:344> compadd -D tmp1 -F _comp_ignore - bar foo
...
+_path_files:308> zstyle -s :completion:complete::ls::files ignore-parents rem
...
+_path_files:320> _comp_ignore=( foo/../foo ) 
...
+_path_files:474> compadd -Qf -p foo/../ -W foo/../ -M r:|/=* r:|=*  -J -default- - bar foo
...

The updated _comp_ignore is not used.

> 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 `../'.  I hope a style to automatic
switching to list-only.  Although I tried to do it, I couldn't find a
way.

Index: Completion/Core/_path_files
===================================================================
RCS file: /projects/zsh/zsh/Completion/Core/_path_files,v
retrieving revision 1.1.1.61
diff -u -r1.1.1.61 _path_files
--- Completion/Core/_path_files	2000/01/21 16:33:49	1.1.1.61
+++ Completion/Core/_path_files	2000/01/21 17:28:33
@@ -311,7 +311,7 @@
         if [[ "$rem" = *parent* ]]; then
 	  for i in "$tmp2[@]"; do
 	    if [[ -d "$i" && "$i" = */* ]]; then
-	      remt="${i/*}"
+	      remt="${i%/*}"
 	      while [[ "$remt" = */* ]]; do
 		[[ "$remt" -ef "$i" ]] && break
 		remt="${remt%/*}"
-- 
Tanaka Akira


  reply	other threads:[~2000-01-21 18:12 UTC|newest]

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

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=rsqln5jwazf.fsf@crane.jaist.ac.jp \
    --to=akr@jaist.ac.jp \
    --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).