Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: setopt globdots in _path_files



Bart Schaefer wrote:

> On Nov 4,  8:19pm, Oliver Kiddle wrote:
> } Subject: setopt globdots in _path_files
> }
> } _path_files in bart-8 does a setopt globdots.
> 
> This was the second hunk in Sven's patch of 8479.  It would probably be
> better to back out that hunk, rather than simply remove globdots.

I suggest just using this patch instead of Oliver's.

The problem with just removing the `globdots' is that then even `.../.<TAB>'
doesn't work any more (if globdots is unset by the user).

Bye
 Sven

diff -u oldcompletion/Core/_path_files Completion/Core/_path_files
--- oldcompletion/Core/_path_files	Thu Nov  4 14:50:48 1999
+++ Completion/Core/_path_files	Fri Nov  5 10:20:58 1999
@@ -10,7 +10,7 @@
 
 typeset -U prepaths exppaths
 
-setopt localoptions nullglob rcexpandparam globdots
+setopt localoptions nullglob rcexpandparam
 unsetopt markdirs globsubst shwordsplit nounset
 
 local sopt='-' gopt='' opt
@@ -210,10 +210,15 @@
     # Get the matching files by globbing.
 
     if [[ "$tpre$tsuf" = */* ]]; then
-      tmp1=( ${^tmp1}*(-/) )
+      tmp2=( ${^tmp1}*(-/) )
+      [[ ! -o globdots && "$PREFIX" = .* ]] &&
+          tmp2=( "$tmp1[@]" ${^tmp1}.*(-/) )
     else
-      tmp1=( ${^tmp1}${^~pats} )
+      tmp2=( ${^tmp1}${^~pats} )
+      [[ ! -o globdots && "$PREFIX" = .* ]] &&
+          tmp2=( "$tmp1[@]" ${^tmp1}.${^~pats} )
     fi
+    tmp1=( "$tmp2[@]" )
 
     if [[ -n "$PREFIX$SUFFIX" ]]; then
       # See which of them match what's on the line.

--
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



Messages sorted by: Reverse Date, Date, Thread, Author