about summary refs log tree commit diff
diff options
context:
space:
mode:
authorTanaka Akira <akr@users.sourceforge.net>1999-12-13 14:06:30 +0000
committerTanaka Akira <akr@users.sourceforge.net>1999-12-13 14:06:30 +0000
commitdcc6d87c9fd16fa868fe2dffffbf724b7ae71511 (patch)
tree19e4358cd2965f87f477e39502748a606faf194d
parenta5f7a6272d0c834cf315dced8ce93ecac3f3a295 (diff)
downloadzsh-dcc6d87c9fd16fa868fe2dffffbf724b7ae71511.tar.gz
zsh-dcc6d87c9fd16fa868fe2dffffbf724b7ae71511.tar.xz
zsh-dcc6d87c9fd16fa868fe2dffffbf724b7ae71511.zip
zsh-workers/9020
-rw-r--r--Completion/Core/_path_files15
-rw-r--r--Doc/Zsh/compsys.yo12
2 files changed, 20 insertions, 7 deletions
diff --git a/Completion/Core/_path_files b/Completion/Core/_path_files
index 993d0e89a..cafec3c09 100644
--- a/Completion/Core/_path_files
+++ b/Completion/Core/_path_files
@@ -224,12 +224,19 @@ for prepath in "$prepaths[@]"; do
 
     if [[ "$tpre$tsuf" = */* ]]; then
       tmp2=( ${^tmp1}*(-/) )
-      [[ ! -o globdots && "$PREFIX" = .* ]] &&
-          tmp2=( "$tmp2[@]" ${^tmp1}.*(-/) . .. )
+      if [[ ! -o globdots && "$PREFIX" = .* ]]; then
+        tmp2=( "$tmp2[@]" ${^tmp1}.*(-/) )
+	zstyle -t ":completion${curcontext}:paths" special-dirs &&
+	    tmp2=( "$tmp2[@]" . .. )
+      fi
     else
       tmp2=( ${^tmp1}${^~pats} )
-      [[ ! -o globdots && "$PREFIX" = .* ]] &&
-          tmp2=( "$tmp2[@]" ${^tmp1}.${^~pats} . .. )
+      if [[ ! -o globdots && "$PREFIX" = .* ]]; then
+        tmp2=( "$tmp2[@]" ${^tmp1}.${^~pats} )
+        [[ "$sopt" = */* ]] &&
+	    zstyle -t ":completion${curcontext}:paths" special-dirs &&
+	    tmp2=( "$tmp2[@]" . .. )
+      fi
     fi
     tmp1=( "$tmp2[@]" )
 
diff --git a/Doc/Zsh/compsys.yo b/Doc/Zsh/compsys.yo
index ea70421d8..d59a1798e 100644
--- a/Doc/Zsh/compsys.yo
+++ b/Doc/Zsh/compsys.yo
@@ -647,7 +647,8 @@ for names of directories in directories from the tt(cdpath) array when
 completing for the tt(cd) builtin command
 )
 item(tt(paths))(
-used to look up the values of the tt(expand) and tt(cursor) styles
+used to look up the values of the tt(expand), tt(cursor) and
+tt(special-dirs) styles
 )
 item(tt(pods))(
 for perl pods
@@ -1191,6 +1192,11 @@ to tt(menu), then the expansions are only sorted when they are offered
 as single strings (not in the string containing all possible
 expansions).
 )
+item(tt(special-dirs))(
+Normally, the completion code will not produce the directory names
+tt(.) and tt(..) as possible completions. If this style is set to
+`true', it will.
+)
 item(tt(stop))(
 If set to `true', the tt(_history_complete_word) bindable
 command will always insert matches as if menucompletion were started
@@ -1894,8 +1900,8 @@ These functions also accept the `tt(-J)', `tt(-V)', `tt(-1)',
 `tt(-2)', `tt(-n)', `tt(-X)', `tt(-M)', `tt(-P)', `tt(-S)', `tt(-q)',
 `tt(-r)', and `tt(-R)' options from the tt(compadd) builtin.
 
-Finally, the tt(_path_files) function  uses the styles tt(expand) and
-tt(cursor) with the tt(paths) tag.
+Finally, the tt(_path_files) function  uses the styles tt(expand),
+tt(cursor) and tt(special-dirs) with the tt(paths) tag.
 )
 findex(_parameters)
 item(tt(_parameters))(