* Re: PATCH: Re: Standard setopts for completion system, again
@ 2000-10-18 7:13 Sven Wischnowsky
2000-10-18 7:28 ` Andrej Borsenkow
0 siblings, 1 reply; 6+ messages in thread
From: Sven Wischnowsky @ 2000-10-18 7:13 UTC (permalink / raw)
To: zsh-workers
Bart Schaefer wrote:
> ...
>
> Another choice (still in compinit) would be simply to stuff the desired
> options into an array:
>
> _comp_setopts=(nullglob rcexpandparam extendedglob unset
> no{markdirs,globsubst,shwordsplit,shglob,ksharrays,cshnullglob})
>
> and then reference them:
>
> setopt localoptions $_comp_setopts
I like this. Good idea.
We could even do `_comp_setopts=(setopt localoptions nullglob ...)'
and then just do `$_comp_setopt'. Or would that be too irritating?
Bye
Sven
--
Sven Wischnowsky wischnow@informatik.hu-berlin.de
^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: PATCH: Re: Standard setopts for completion system, again
2000-10-18 7:13 PATCH: Re: Standard setopts for completion system, again Sven Wischnowsky
@ 2000-10-18 7:28 ` Andrej Borsenkow
0 siblings, 0 replies; 6+ messages in thread
From: Andrej Borsenkow @ 2000-10-18 7:28 UTC (permalink / raw)
To: zsh-workers
>
>
> Bart Schaefer wrote:
>
> > ...
> >
> > Another choice (still in compinit) would be simply to stuff the desired
> > options into an array:
> >
> > _comp_setopts=(nullglob rcexpandparam extendedglob unset
> > no{markdirs,globsubst,shwordsplit,shglob,ksharrays,cshnullglob})
> >
> > and then reference them:
> >
> > setopt localoptions $_comp_setopts
>
> I like this. Good idea.
>
> We could even do `_comp_setopts=(setopt localoptions nullglob ...)'
> and then just do `$_comp_setopt'. Or would that be too irritating?
>
Someday somebody does _comp_setopt=(some-option $_comp_setopt). I prefer
Bart's version. It makes also usage more clear.
-andrej
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: PATCH: Re: Standard setopts for completion system, again
@ 2000-10-19 8:57 Sven Wischnowsky
0 siblings, 0 replies; 6+ messages in thread
From: Sven Wischnowsky @ 2000-10-19 8:57 UTC (permalink / raw)
To: zsh-workers
Bart Schaefer wrote:
> ...
>
> Another choice (still in compinit) would be simply to stuff the desired
> options into an array:
>
> _comp_setopts=(nullglob rcexpandparam extendedglob unset
> no{markdirs,globsubst,shwordsplit,shglob,ksharrays,cshnullglob})
>
> and then reference them:
>
> setopt localoptions $_comp_setopts
>
> I guess I slightly prefer the latter, since we're already cluttering the
> parameter space with completion stuff and I'd rather stay out of the alias
> space, but either one would be OK.
Here is the patch for it (committed soon). I hope nobody objects to me
naming the array `_comp_options'?
I've also initialised that array in what I hope is a more readable form.
Bye
Sven
Index: Completion/Commands/_bash_completions
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Commands/_bash_completions,v
retrieving revision 1.7
diff -u -r1.7 _bash_completions
--- Completion/Commands/_bash_completions 2000/10/06 05:18:25 1.7
+++ Completion/Commands/_bash_completions 2000/10/19 08:55:42
@@ -25,8 +25,7 @@
# that will not have been overridden, so you should add '~' to the
# list of keys at the top of the for-loop.
-setopt localoptions nullglob rcexpandparam extendedglob unset
-unsetopt markdirs globsubst shwordsplit shglob ksharrays cshnullglob
+setopt localoptions $_comp_options
local key=$KEYS[-1] expl
Index: Completion/Commands/_complete_debug
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Commands/_complete_debug,v
retrieving revision 1.10
diff -u -r1.10 _complete_debug
--- Completion/Commands/_complete_debug 2000/10/06 05:18:25 1.10
+++ Completion/Commands/_complete_debug 2000/10/19 08:55:42
@@ -1,7 +1,6 @@
#compdef -k complete-word \C-x?
-setopt localoptions nullglob rcexpandparam extendedglob unset
-unsetopt markdirs globsubst shwordsplit shglob ksharrays cshnullglob
+setopt localoptions $_comp_options
setopt localtraps noerrexit ; trap - ZERR
Index: Completion/Commands/_complete_help
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Commands/_complete_help,v
retrieving revision 1.10
diff -u -r1.10 _complete_help
--- Completion/Commands/_complete_help 2000/10/06 05:18:25 1.10
+++ Completion/Commands/_complete_help 2000/10/19 08:55:43
@@ -1,8 +1,8 @@
#compdef -k complete-word \C-xh
_complete_help() {
- setopt localoptions nullglob rcexpandparam extendedglob unset
- unsetopt markdirs globsubst shwordsplit shglob ksharrays cshnullglob
+ setopt localoptions $_comp_options
+
exec </dev/null # ZLE closes stdin, which can cause errors
local _sort_tags=_help_sort_tags text i j k
Index: Completion/Commands/_correct_word
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Commands/_correct_word,v
retrieving revision 1.4
diff -u -r1.4 _correct_word
--- Completion/Commands/_correct_word 2000/10/06 05:18:25 1.4
+++ Completion/Commands/_correct_word 2000/10/19 08:55:43
@@ -7,8 +7,7 @@
# If configurations keys with the prefix `correctword_' are
# given they override those starting with `correct_'.
-setopt localoptions nullglob rcexpandparam extendedglob unset
-unsetopt markdirs globsubst shwordsplit shglob ksharrays cshnullglob
+setopt localoptions $_comp_options
local curcontext="$curcontext"
Index: Completion/Commands/_expand_word
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Commands/_expand_word,v
retrieving revision 1.7
diff -u -r1.7 _expand_word
--- Completion/Commands/_expand_word 2000/10/11 12:19:24 1.7
+++ Completion/Commands/_expand_word 2000/10/19 08:55:43
@@ -2,8 +2,7 @@
# Simple completion front-end implementing expansion.
-setopt localoptions nullglob rcexpandparam extendedglob unset
-unsetopt markdirs globsubst shwordsplit shglob ksharrays cshnullglob
+setopt localoptions $_comp_options
local curcontext="$curcontext"
Index: Completion/Commands/_history_complete_word
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Commands/_history_complete_word,v
retrieving revision 1.8
diff -u -r1.8 _history_complete_word
--- Completion/Commands/_history_complete_word 2000/10/06 05:18:25 1.8
+++ Completion/Commands/_history_complete_word 2000/10/19 08:55:43
@@ -16,8 +16,7 @@
# range -- range of history words to complete
_history_complete_word () {
- setopt localoptions nullglob rcexpandparam extendedglob unset
- unsetopt markdirs globsubst shwordsplit shglob ksharrays cshnullglob
+ setopt localoptions $_comp_options
local expl direction stop curcontext="$curcontext"
local max slice hmax=$#historywords
Index: Completion/Commands/_next_tags
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Commands/_next_tags,v
retrieving revision 1.10
diff -u -r1.10 _next_tags
--- Completion/Commands/_next_tags 2000/10/06 05:18:25 1.10
+++ Completion/Commands/_next_tags 2000/10/19 08:55:43
@@ -3,8 +3,7 @@
# Main widget.
_next_tags() {
- setopt localoptions nullglob rcexpandparam extendedglob unset
- unsetopt markdirs globsubst shwordsplit shglob ksharrays cshnullglob
+ setopt localoptions $_comp_options
local ins ops="$PREFIX$SUFFIX"
Index: Completion/Core/_main_complete
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Core/_main_complete,v
retrieving revision 1.42
diff -u -r1.42 _main_complete
--- Completion/Core/_main_complete 2000/10/06 05:18:25 1.42
+++ Completion/Core/_main_complete 2000/10/19 08:55:43
@@ -16,8 +16,8 @@
# which makes the output of setopt and unsetopt reflect a different
# state than the global one for which you are completing.
-setopt localoptions nullglob rcexpandparam extendedglob unset
-unsetopt markdirs globsubst shwordsplit shglob ksharrays cshnullglob
+setopt localoptions $_comp_options
+
exec </dev/null # ZLE closes stdin, which can cause errors
# Failed returns from this code are not real errors
Index: Completion/Core/compinit
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Core/compinit,v
retrieving revision 1.10
diff -u -r1.10 compinit
--- Completion/Core/compinit 2000/07/26 08:54:58 1.10
+++ Completion/Core/compinit 2000/10/19 08:55:43
@@ -120,6 +120,21 @@
_comp_dumpfile="${ZDOTDIR:-$HOME}/.zcompdump"
fi
+# The standard options set in completion functions.
+
+_comp_options=(
+ nullglob
+ rcexpandparam
+ extendedglob
+ unset
+ NO_markdirs
+ NO_globsubst
+ NO_shwordsplit
+ NO_shglob
+ NO_ksharrays
+ NO_cshnullglob
+)
+
# These can hold names of functions that are to be called before/after all
# matches have been generated.
--
Sven Wischnowsky wischnow@informatik.hu-berlin.de
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: PATCH: Re: Standard setopts for completion system, again
2000-10-06 14:58 ` Bart Schaefer
@ 2000-10-18 4:31 ` Bart Schaefer
0 siblings, 0 replies; 6+ messages in thread
From: Bart Schaefer @ 2000-10-18 4:31 UTC (permalink / raw)
To: zsh-workers
On Fri, 6 Oct 2000 I wrote:
} Unfortunately, we heavily recommend autoloading all completion functions
} with "autoload -U", which means an alias won't be expanded!
It occurred to me somewhat later that, even with "autoload -U", an alias
*would* be expanded during an "eval". So we could put this:
alias _comp_setopt='setopt nullglob rcexpandparam extendedglob unset \
no{markdirs,globsubst,shwordsplit,shglob,ksharrays,cshnullglob}'
into compinit, and then in the completion functions like _main_complete:
eval _comp_setopt localoptions
Another choice (still in compinit) would be simply to stuff the desired
options into an array:
_comp_setopts=(nullglob rcexpandparam extendedglob unset
no{markdirs,globsubst,shwordsplit,shglob,ksharrays,cshnullglob})
and then reference them:
setopt localoptions $_comp_setopts
I guess I slightly prefer the latter, since we're already cluttering the
parameter space with completion stuff and I'd rather stay out of the alias
space, but either one would be OK.
--
Bart Schaefer Brass Lantern Enterprises
http://www.well.com/user/barts http://www.brasslantern.com
Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: PATCH: Re: Standard setopts for completion system, again
2000-10-06 12:53 Sven Wischnowsky
@ 2000-10-06 14:58 ` Bart Schaefer
2000-10-18 4:31 ` Bart Schaefer
0 siblings, 1 reply; 6+ messages in thread
From: Bart Schaefer @ 2000-10-06 14:58 UTC (permalink / raw)
To: zsh-workers
On Oct 6, 2:53pm, Sven Wischnowsky wrote:
}
} We use nonomatch not because of globbing, but because of ~... and
} =... expansion.
Aha! I wonder if there shouldn't be some clarification of this in the
doc (not the completion doc, the nullglob and file expansion doc -- the
doc for nullglob simply says "overrides nomatch", and the doc for file
expansion (as opposed to generation) doesn't mention nomatch at all).
} A good question might be if we should just move the nonomatch into
} _main_complete `and be done with it'. Instead of error messages we
} always want strings we can handle, or don't we?
I think we definitely *don't* want the functions to fail early, because
we rely on being able to restore state before returning. Whether we'd
rather have an unchanged string or no string at all, is another matter.
} Still no decision on how to move that init code into a function or
} alias. I think I'd prefer an alias since it makes it easier for
} function writers.
Unfortunately, we heavily recommend autoloading all completion functions
with "autoload -U", which means an alias won't be expanded!
--
Bart Schaefer Brass Lantern Enterprises
http://www.well.com/user/barts http://www.brasslantern.com
Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net
^ permalink raw reply [flat|nested] 6+ messages in thread
* PATCH: Re: Standard setopts for completion system, again
@ 2000-10-06 12:53 Sven Wischnowsky
2000-10-06 14:58 ` Bart Schaefer
0 siblings, 1 reply; 6+ messages in thread
From: Sven Wischnowsky @ 2000-10-06 12:53 UTC (permalink / raw)
To: zsh-workers
Bart Schaefer wrote:
> ...
>
> Grepping through the completion functions for `setopt', I find that I have
> some questions ....
>
> Builtins/_cd:14:setopt localoptions nonomatch
> Builtins/_popd:8:setopt extendedglob nonomatch
> Given these functions explicitly setopt nonomatch, does that mean that
> they intend patterns that don't match to remain unchanged? If that's
> the case, then they should also unsetopt nullglob.
We use nonomatch not because of globbing, but because of ~... and
=... expansion. So I only changed that extendedglob to localoptions.
A good question might be if we should just move the nonomatch into
_main_complete `and be done with it'. Instead of error messages we
always want strings we can handle, or don't we?
> Commands/_read_comp:26:setopt localoptions extendedglob nobadpattern # xtrace promptsubst
> It looks like this function could use a few more of the standard setopts
> than it has, especially ksharrays, but I wanted to double-check.
I'll leave that one to Peter.
> Core/_expand:10:setopt localoptions nullglob nonomatch
> Hmm, is it necessary to set both nullglob and nonomatch? Nullglob will
> make the patterns vanish before nomatch has a chance to complain. And
> this function ought either to get the rest of the standard setopts if it
> is meant to be called independent of _main_complete, or else it doesn't
> need any setopts at all.
See above and: I don't think completers should (or need to) be
designed to be callable stand-alone. The calling function has to make
sure that the function is called in the right environment -- we expect
that in some hundred completion functions anyway...
> Core/_path_files:13:setopt localoptions nullglob rcexpandparam
> Core/_path_files:14:unsetopt markdirs globsubst shwordsplit nounset
> User/_mailboxes:70: setopt localoptions nullglob
> User/_man:3:setopt localoptions rcexpandparam
> User/_perl_modules:49: setopt localoptions extendedglob
> Other cases where either all or none of the standard options seems to be
> the right thing. Am I missing something?
That _path_files surprised me a bit, but, yes, you are right. And it
even looks as if those (un|)setopts we copied from there to
_main_complete or the other way round. Maybe I once was to lazy to
remove them?
> ...
>
> I changed Sven's `no*' forms back into an unsetopt in _main_complete; I
> don't think it's significantly faster to use one command instead of two,
> and it's much easier to read without all those repeated `no's.
I don't care either way very much...
And the patch also removes the N's from glob qualifier lists where
possible (and if I found all places...).
Still no decision on how to move that init code into a function or
alias. I think I'd prefer an alias since it makes it easier for
function writers. We should thet put a note in the docs that the
completion functions can't be compiled correctly if compinit hasn't
been executed in that shell, though (and that may be a good reason to
use a function, of course; sigh).
Bye
Sven
Index: Completion/Bsd/_bsd_pkg
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Bsd/_bsd_pkg,v
retrieving revision 1.4
diff -u -r1.4 _bsd_pkg
--- Completion/Bsd/_bsd_pkg 2000/09/07 08:39:22 1.4
+++ Completion/Bsd/_bsd_pkg 2000/10/06 12:45:06
@@ -7,7 +7,7 @@
paths=( "${(@)${(@s.:.)PKG_PATH}:#}" )
_files "$@" -g \*.tgz && ret=0
(( $#path )) && _files "$@" -W paths -g \*.tgz && ret=0
- compadd "$@" - /usr/ports/packages/All/*.tgz(N) && ret=0
+ compadd "$@" - /usr/ports/packages/All/*.tgz && ret=0
return ret
}
@@ -37,7 +37,7 @@
'-d[remove empty directories]' \
'-f[force deinstallation]' \
'-p:prefix directory:_files -/' \
- '*:package to deinstall:compadd - /var/db/pkg/*(N\:t)'
+ '*:package to deinstall:compadd - /var/db/pkg/*(\:t)'
;;
pkg_info)
@@ -57,10 +57,10 @@
'-R[show list list of installed requiring packages]' \
'-m[show mtree files]' \
'-L[show full pathnames of files]' \
- '-e[test if package is installed]:package name:compadd - /var/db/pkg/*(N\:t)' \
+ '-e[test if package is installed]:package name:compadd - /var/db/pkg/*(\:t)' \
'-l:prefix directory:_files -/' \
'-t:mktemp template:_files -/' \
- '(-a)*:package name:compadd - /var/db/pkg/*(N\:t)'
+ '(-a)*:package name:compadd - /var/db/pkg/*(\:t)'
;;
esac
}
Index: Completion/Bsd/_kld
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Bsd/_kld,v
retrieving revision 1.4
diff -u -r1.4 _kld
--- Completion/Bsd/_kld 2000/09/07 08:39:22 1.4
+++ Completion/Bsd/_kld 2000/10/06 12:45:06
@@ -4,7 +4,7 @@
_kld_module() {
local ret=1
- compadd "$@" - /boot/kernel/*.ko(N:t) /modules/*.ko(N:t) && ret=0
+ compadd "$@" - /boot/kernel/*.ko(:t) /modules/*.ko(:t) && ret=0
_files "$@" -g \*.ko && ret=0
return ret
Index: Completion/Builtins/_autoload
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Builtins/_autoload,v
retrieving revision 1.2
diff -u -r1.2 _autoload
--- Completion/Builtins/_autoload 2000/04/01 20:43:43 1.2
+++ Completion/Builtins/_autoload 2000/10/06 12:45:06
@@ -6,5 +6,5 @@
_description files expl 'zwc file'
_files "$expl[@]" -g '*.zwc'
else
- _wanted functions expl 'shell function' compadd - ${^fpath}/*(N:t)
+ _wanted functions expl 'shell function' compadd - ${^fpath}/*(:t)
fi
Index: Completion/Builtins/_cd
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Builtins/_cd,v
retrieving revision 1.4
diff -u -r1.4 _cd
--- Completion/Builtins/_cd 2000/09/07 09:14:24 1.4
+++ Completion/Builtins/_cd 2000/10/06 12:45:06
@@ -19,7 +19,7 @@
# cd old new: look for old in $PWD and see what can replace it
local rep
# Get possible completions using word in position 2
- rep=(${~PWD/$words[2]/*}~$PWD(-/N))
+ rep=(${~PWD/$words[2]/*}~$PWD(-/))
# Now remove all the common parts of $PWD and the completions from this
rep=(${${rep#${PWD%%$words[2]*}}%${PWD#*$words[2]}})
(( $#rep )) && _wanted -C replacement strings expl replacement compadd -a rep
Index: Completion/Builtins/_compdef
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Builtins/_compdef,v
retrieving revision 1.7
diff -u -r1.7 _compdef
--- Completion/Builtins/_compdef 2000/05/31 09:38:26 1.7
+++ Completion/Builtins/_compdef 2000/10/06 12:45:06
@@ -33,7 +33,7 @@
_wanted commands expl 'completed command' compadd -k _comps
;;
cfun)
- list=( ${^fpath:/.}/_(|*[^~])(N:t) )
+ list=( ${^fpath:/.}/_(|*[^~])(:t) )
if zstyle -T ":completion:${curcontext}:functions" prefix-hidden; then
disp=( ${list[@]#_} )
_wanted functions expl 'completion function' \
Index: Completion/Builtins/_popd
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Builtins/_popd,v
retrieving revision 1.4
diff -u -r1.4 _popd
--- Completion/Builtins/_popd 2000/05/31 09:38:26 1.4
+++ Completion/Builtins/_popd 2000/10/06 12:45:06
@@ -5,7 +5,7 @@
# way round if pushdminus is set). Note that this function is also called
# from _cd for cd and pushd.
-setopt extendedglob nonomatch
+setopt localoptions nonomatch
local expl list lines revlines disp
Index: Completion/Core/_expand
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Core/_expand,v
retrieving revision 1.29
diff -u -r1.29 _expand
--- Completion/Core/_expand 2000/09/21 05:16:22 1.29
+++ Completion/Core/_expand 2000/10/06 12:45:06
@@ -7,7 +7,7 @@
# the expansions done produce no result or do not change the original
# word from the line.
-setopt localoptions nullglob nonomatch
+setopt localoptions nonomatch
[[ _matcher_num -gt 1 ]] && return 1
Index: Completion/Core/_path_files
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Core/_path_files,v
retrieving revision 1.31
diff -u -r1.31 _path_files
--- Completion/Core/_path_files 2000/10/05 07:31:00 1.31
+++ Completion/Core/_path_files 2000/10/06 12:45:06
@@ -10,9 +10,6 @@
typeset -U prepaths exppaths
-setopt localoptions nullglob rcexpandparam
-unsetopt markdirs globsubst shwordsplit nounset
-
exppaths=()
# Get the options.
@@ -317,7 +314,7 @@
# Force auto-mounting. There might be a better way...
- : ${^tmp1}/${PREFIX}${SUFFIX}/.(N/)
+ : ${^tmp1}/${PREFIX}${SUFFIX}/.(/)
# Get the matching files by globbing.
Index: Completion/Linux/_rpm
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Linux/_rpm,v
retrieving revision 1.17
diff -u -r1.17 _rpm
--- Completion/Linux/_rpm 2000/08/08 12:11:42 1.17
+++ Completion/Linux/_rpm 2000/10/06 12:45:06
@@ -269,7 +269,7 @@
_rpms_caching_policy () {
# rebuild if cache is more than a week old
- oldp=( "$1"(Nmw+1) )
+ oldp=( "$1"(mw+1) )
(( $#oldp )) && return 0
[[ /var/lib/rpm/packages.rpm -nt "$1" ]]
Index: Completion/User/_gcc
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/User/_gcc,v
retrieving revision 1.2
diff -u -r1.2 _gcc
--- Completion/User/_gcc 2000/09/07 08:39:22 1.2
+++ Completion/User/_gcc 2000/10/06 12:45:06
@@ -274,7 +274,7 @@
;;
library)
_wanted libraries expl library \
- compadd - ${^=LD_LIBRARY_PATH:-/usr/lib /usr/local/lib}/lib*.(a|so*)(N:t:fr:s/lib//) && ret=0
+ compadd - ${^=LD_LIBRARY_PATH:-/usr/lib /usr/local/lib}/lib*.(a|so*)(:t:fr:s/lib//) && ret=0
;;
esac
Index: Completion/User/_gdb
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/User/_gdb,v
retrieving revision 1.5
diff -u -r1.5 _gdb
--- Completion/User/_gdb 2000/09/07 08:39:22 1.5
+++ Completion/User/_gdb 2000/10/06 12:45:06
@@ -5,12 +5,12 @@
[[ "$PREFIX" = --* ]] &&
_arguments -- '*=(CORE|SYM)FILE:core file:_files' \
'*=EXECFILE:executable:_files -g \*\(-\*\)' \
- '*=TTY:terminal device:compadd /dev/tty\*\(N\)' && return 0
+ '*=TTY:terminal device:compadd /dev/tty\*' && return 0
if compset -P '-(cd|directory)='; then
_files -/
elif compset -P '-tty='; then
- _wanted devices expl 'terminal device' compadd - /dev/tty*(N)
+ _wanted devices expl 'terminal device' compadd - /dev/tty*
elif compset -P '-(exec|se)='; then
_description files expl executable
_files "$expl[@]" -g '*(-*)'
Index: Completion/User/_mailboxes
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/User/_mailboxes,v
retrieving revision 1.6
diff -u -r1.6 _mailboxes
--- Completion/User/_mailboxes 2000/09/07 08:39:22 1.6
+++ Completion/User/_mailboxes 2000/10/06 12:45:08
@@ -67,17 +67,15 @@
typeset -aU -g _mailbox_cache
typeset -aU -g _maildir_cache _mbox_cache _mh_cache _mutt_cache _pine_cache
- setopt localoptions nullglob
-
[[ -f ${~muttrc:-.} ]] &&
_mutt_cache=( ${=${(M)${(f)"$(<${~muttrc})"}:#mailboxes *}#mailboxes *} )
- _mbox_cache=( ${~maildirectory}/*(N^/) )
- _pine_cache=( ${~pinedirectory}/**/*(N.) )
+ _mbox_cache=( ${~maildirectory}/*(^/) )
+ _pine_cache=( ${~pinedirectory}/**/*(.) )
- dirboxes=( ${~maildirectory}/*(N/) )
+ dirboxes=( ${~maildirectory}/*(/) )
while (( $#dirboxes )); do
i=${dirboxes[1]}
@@ -87,7 +85,7 @@
elif j=( "$i"/<1-> ) && [[ -n "$j" ]]; then
_mh_cache=( "${_mh_cache[@]}" "$i" )
else
- _mbox_cache=( "${_mbox_cache[@]}" "$i"/*(N.) )
+ _mbox_cache=( "${_mbox_cache[@]}" "$i"/*(.) )
dirboxes=( $dirboxes "$i"/*(/) )
fi
done
Index: Completion/User/_man
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/User/_man,v
retrieving revision 1.6
diff -u -r1.6 _man
--- Completion/User/_man 2000/09/03 21:45:37 1.6
+++ Completion/User/_man 2000/10/06 12:45:08
@@ -1,7 +1,5 @@
#compdef man apropos whatis
-setopt localoptions rcexpandparam
-
local rep expl star approx mrd
if [[ $words[1] == man ]] && (( $words[(I)-l] + $words[(I)--local-file] )); then
@@ -26,7 +24,7 @@
fi
(( $#manpath )) || manpath=( ${(s.:.)$(manpath 2>/dev/null)} ) ||
- manpath=( /usr/man(-/N) /(opt|usr)/(dt|share|X11R6|local)/(cat|)man(-/N) )
+ manpath=( /usr/man(-/) /(opt|usr)/(dt|share|X11R6|local)/(cat|)man(-/) )
# `sman' is the SGML manual directory for Solaris 7.
# 1M is system administrator commands on SVR4
@@ -34,10 +32,10 @@
mrd=(${^manpath/\%L/${LANG:-En_US.ASCII}}/mandb(N))
if [[ $words[2] = (<->*|1M|l|n) ]]; then
rep=(
- $manpath/(sman|man|cat)${words[2]}/${~approx}$PREFIX${~star}$SUFFIX.*(N:t) )
+ $manpath/(sman|man|cat)${words[2]}/${~approx}$PREFIX${~star}$SUFFIX.*(:t) )
(($#mrd)) && rep[$#rep+1]=($(awk "\$2 == \"$words[2]\" {print \$1}" $mrd))
else
- rep=( $manpath/(sman|man|cat)*/${~approx}$PREFIX${~star}$SUFFIX.*(N:t) )
+ rep=( $manpath/(sman|man|cat)*/${~approx}$PREFIX${~star}$SUFFIX.*(:t) )
(($#mrd)) && rep[$#rep+1]=($(awk '{print $1}' $mrd))
fi
Index: Completion/User/_perl_modules
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/User/_perl_modules,v
retrieving revision 1.7
diff -u -r1.7 _perl_modules
--- Completion/User/_perl_modules 2000/08/02 13:45:52 1.7
+++ Completion/User/_perl_modules 2000/10/06 12:45:08
@@ -46,7 +46,6 @@
# complete Perl modules. Maybe her $path is wrong?
_message "Didn't find perl on \$PATH; guessing @INC ..."
- setopt localoptions extendedglob
inc=( /usr/lib/perl5{,/{site_perl/,}<5->.([0-9]##)}(N)
${(s.:.)PERL5LIB} )
fi
@@ -61,7 +60,7 @@
# Find all modules
if [[ -d $libdir && -x $libdir ]]; then
cd $libdir
- new_pms=( {[A-Z]*/***/,}*.pm~*blib*(N) )
+ new_pms=( {[A-Z]*/***/,}*.pm~*blib* )
cd $OLDPWD
fi
@@ -84,10 +83,10 @@
local _perllocals
# rebuild if cache is more than a week old
- oldp=( "$1"(Nmw+1) )
+ oldp=( "$1"(mw+1) )
(( $#oldp )) && return 0
- _perllocals=( /usr/lib/perl5/**/perllocal.pod(N) )
+ _perllocals=( /usr/lib/perl5/**/perllocal.pod )
if (( $#_perllocals )); then
for pod in $_perllocals; do
Index: Completion/User/_printers
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/User/_printers,v
retrieving revision 1.2
diff -u -r1.2 _printers
--- Completion/User/_printers 2000/07/06 12:40:01 1.2
+++ Completion/User/_printers 2000/10/06 12:45:08
@@ -11,7 +11,7 @@
if (( ! $+_lp_cache )); then
local file entry names i
- file=( /etc/(printcap|printers.conf)(N) )
+ file=( /etc/(printcap|printers.conf) )
_lp_cache=()
_lp_alias_cache=()
Index: Completion/User/_zdump
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/User/_zdump,v
retrieving revision 1.2
diff -u -r1.2 _zdump
--- Completion/User/_zdump 2000/09/07 08:39:22 1.2
+++ Completion/User/_zdump 2000/10/06 12:45:08
@@ -1,7 +1,7 @@
#compdef zdump
if (( ! $+_zoneinfo_dirs )); then
- _zoneinfo_dirs=( /usr/{share,lib,share/lib}/zoneinfo*(N/) )
+ _zoneinfo_dirs=( /usr/{share,lib,share/lib}/zoneinfo*(/) )
fi
_arguments '-v[lowest possible]' \
--
Sven Wischnowsky wischnow@informatik.hu-berlin.de
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2000-10-19 8:57 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-10-18 7:13 PATCH: Re: Standard setopts for completion system, again Sven Wischnowsky
2000-10-18 7:28 ` Andrej Borsenkow
-- strict thread matches above, loose matches on Subject: below --
2000-10-19 8:57 Sven Wischnowsky
2000-10-06 12:53 Sven Wischnowsky
2000-10-06 14:58 ` Bart Schaefer
2000-10-18 4:31 ` Bart Schaefer
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).