From: Peter Stephenson <pws@csr.com>
To: zsh-workers@sunsite.dk (Zsh hackers list)
Subject: Re: Buglet in zsh perforce completion function
Date: Mon, 11 Jun 2007 10:03:40 +0100 [thread overview]
Message-ID: <20070611100340.44e0390c@news01.csr.com> (raw)
In-Reply-To: <070610011909.ZM32437@torch.brasslantern.com>
On Sun, 10 Jun 2007 01:19:09 -0700
Bart Schaefer <schaefer@brasslantern.com> wrote:
> } Also you've said that -p and -W are the same string, which
> } by my reading means [...] it would test for
> } the file "$dir/$dir/..." which can't possibly be what you mean.
>
> ... still stands.
I think they do different things, since normal file completion uses
this form, at least in the context in question:
compadd -Qf -J files -X 'Completing file' -F _comp_ignore -p \
macrame/ -W macrame/ -R _perforce_file_suffix -M 'r:|/=* r:|=*' -a tmp1
However, I'm just going to avoid the problem by commenting out the
code that's causing it, which doesn't do very much. It ought to be
possible to replace it using fake or fake-files, but currently the tags in
_perforce aren't helpful enough.
Index: Completion/Unix/Command/_perforce
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Unix/Command/_perforce,v
retrieving revision 1.36
diff -u -r1.36 _perforce
--- Completion/Unix/Command/_perforce 28 Nov 2006 21:57:28 -0000 1.36
+++ Completion/Unix/Command/_perforce 11 Jun 2007 08:59:59 -0000
@@ -858,14 +858,20 @@
}
-(( $+functions[_perforce_subdirs] )) ||
-_perforce_subdirs() {
- # This has no other function than to offer to add the `...' used
- # by Perforce to indicate a recursive search of directories.
- # Bit pathetic, really.
- compset -P '*/'
- compadd "$@" '...'
-}
+# This has no other function than to offer to add the `...' used
+# by Perforce to indicate a recursive search of directories.
+# Bit pathetic, really.
+#
+# This has been causing odd effects with prefixes so is turned off.
+#(( $+functions[_perforce_subdirs] )) ||
+#_perforce_subdirs() {
+# if [[ $PREFIX = */* ]]; then
+# local dir=${PREFIX%%[^/]#}
+# compadd "$@" -J subdirs -p $dir ...
+# else
+# compadd "$@" -J subdirs ...
+# fi
+#}
(( $+functions[_perforce_depot_dirs] )) ||
@@ -1076,7 +1082,8 @@
altfiles+=("client-dirs:client directory:_perforce_client_dirs")
fi
altfiles+=("depot-dirs:directory in depot:_perforce_depot_dirs"
- "subdirs:subdirectory search:_perforce_subdirs")
+# "subdirs:subdirectory search:_perforce_subdirs"
+ )
_alternative $altfiles
elif [[ -n $unmaintained && -z $dodirs ]]; then
# a la _cvs_nonentried_files: directories are never maintained,
@@ -1113,7 +1120,7 @@
altfiles+=("$type-files:$type file:_perforce_${type}_files")
done
- altfiles+=("subdirs:subdirectory search:_perforce_subdirs")
+# altfiles+=("subdirs:subdirectory search:_perforce_subdirs")
if zstyle -t ":completion:${curcontext}:" depot-files; then
altfiles+=("depot-dirs:directory in depot:_perforce_depot_dirs")
else
@@ -1126,13 +1133,15 @@
altfiles+=("depot-files:file in depot:_perforce_depot_files")
fi
altfiles+=("depot-dirs:directory in depot:_perforce_depot_dirs"
- "subdirs:subdirectory search:_perforce_subdirs")
+# "subdirs:subdirectory search:_perforce_subdirs"
+ )
_alternative $altfiles
else
# Look locally.
- _alternative \
- "files:file:_path_files -R _perforce_file_suffix $dodirs" \
- "subdirs:subdirectory search:_perforce_subdirs"
+# _alternative \
+# "files:file:_path_files -R _perforce_file_suffix $dodirs" \
+# "subdirs:subdirectory search:_perforce_subdirs"
+ _path_files -R _perforce_file_suffix $dodirs
fi
}
--
Peter Stephenson <pws@csr.com> Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK Tel: +44 (0)1223 692070
To access the latest news from CSR copy this link into a web browser: http://www.csr.com/email_sig.php
To get further information regarding CSR, please visit our Investor Relations page at http://ir.csr.com/csr/about/overview
prev parent reply other threads:[~2007-06-11 9:04 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <C28AFFCD.FC29%ken.williams@thomson.com>
2007-06-05 18:12 ` Peter Stephenson
2007-06-10 1:59 ` Bart Schaefer
2007-06-10 8:19 ` Bart Schaefer
2007-06-11 9:03 ` Peter Stephenson [this message]
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=20070611100340.44e0390c@news01.csr.com \
--to=pws@csr.com \
--cc=zsh-workers@sunsite.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).