zsh-workers
 help / color / mirror / code / Atom feed
* setopt globdots in _path_files
@ 1999-11-04 20:19 Oliver Kiddle
  1999-11-05  9:00 ` Bart Schaefer
  0 siblings, 1 reply; 3+ messages in thread
From: Oliver Kiddle @ 1999-11-04 20:19 UTC (permalink / raw)
  To: Zsh workers

_path_files in bart-8 does a setopt globdots. The result is that all my
dot files are listed when I complete files without my typing the
initial dot. I think that _path_files should honour the user's setting
of globdots so if the option is required for some part of _path_files
to work properly, it should make sure it still behaves as if it hadn't
set globdots. Otherwise the patch below should do.

Oliver Kiddle

--- Completion/Core/_path_files.bak	Wed Nov  3 06:19:51 1999
+++ Completion/Core/_path_files	Thu Nov  4 20:06:45 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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: setopt globdots in _path_files
  1999-11-04 20:19 setopt globdots in _path_files Oliver Kiddle
@ 1999-11-05  9:00 ` Bart Schaefer
  0 siblings, 0 replies; 3+ messages in thread
From: Bart Schaefer @ 1999-11-05  9:00 UTC (permalink / raw)
  To: Zsh workers

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.

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: setopt globdots in _path_files
@ 1999-11-05  9:24 Sven Wischnowsky
  0 siblings, 0 replies; 3+ messages in thread
From: Sven Wischnowsky @ 1999-11-05  9:24 UTC (permalink / raw)
  To: zsh-workers


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@informatik.hu-berlin.de


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~1999-11-05  9:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-11-04 20:19 setopt globdots in _path_files Oliver Kiddle
1999-11-05  9:00 ` Bart Schaefer
1999-11-05  9:24 Sven Wischnowsky

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).