summary refs log tree commit diff
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2007-10-25 09:00:02 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2007-10-25 09:00:02 +0000
commitabdf7344833c13623b433b071f337128890eb063 (patch)
treee4fdea310d0de842ec1195f9861092629acb24a0
parent9fc8fe178590acb4407f0b9220ce160c851da037 (diff)
downloadzsh-abdf7344833c13623b433b071f337128890eb063.tar.gz
zsh-abdf7344833c13623b433b071f337128890eb063.tar.xz
zsh-abdf7344833c13623b433b071f337128890eb063.zip
users/12100: default to a case-insensitive matcher with NO_CASE_GLOB
-rw-r--r--ChangeLog6
-rw-r--r--Completion/Unix/Type/_path_files11
-rw-r--r--Doc/Zsh/compsys.yo5
3 files changed, 21 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 3ca6f3f0b..36a957a76 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2007-10-25  Peter Stephenson  <pws@csr.com>
+
+	* users/12100: Completion/Unix/Type/_path_files,
+	Doc/Zsh/compsys.yo: with NO_CASE_GLOB, use a case-insensitive
+	matcher if none is in effect.
+
 2007-10-24  Peter Stephenson  <p.w.stephenson@ntlworld.com>
 
 	* 24018: Doc/Zsh/mod_curses.yo, Src/Modules/curses.c:
diff --git a/Completion/Unix/Type/_path_files b/Completion/Unix/Type/_path_files
index f20a941c0..4176005c3 100644
--- a/Completion/Unix/Type/_path_files
+++ b/Completion/Unix/Type/_path_files
@@ -101,7 +101,16 @@ if (( $#ignore )); then
   (( $mopts[(I)-F] )) || mopts=( "$mopts[@]" -F _comp_ignore )
 fi
 
-(( $#matcher )) && mopts=( "$mopts[@]" "$matcher[@]" )
+if [[ $#matcher -eq 0 && -o nocaseglob ]]; then
+  # If globbing is case insensitive and there's no matcher,
+  # do case-insensitive matching.
+  matcher=( -M 'm:{a-zA-Z}={A-Za-z}' )
+fi
+
+if (( $#matcher )); then
+  # Add the current matcher to the options to compadd.
+  mopts=( "$mopts[@]" "$matcher[@]" )
+fi
 
 if zstyle -s ":completion:${curcontext}:" file-sort tmp1; then
   case "$tmp1" in
diff --git a/Doc/Zsh/compsys.yo b/Doc/Zsh/compsys.yo
index 780255e58..04fc6ecfa 100644
--- a/Doc/Zsh/compsys.yo
+++ b/Doc/Zsh/compsys.yo
@@ -1968,6 +1968,11 @@ quickly reduce the shell's performance.  As a rough rule of thumb,
 one to three strings will give acceptable performance.  On the other
 hand, putting multiple space-separated values into the same string does
 not have an appreciable impact on performance.
+
+If there is no current matcher or it is empty, and the option
+tt(NO_CASE_GLOB) is in effect, the matching for files is performed
+case-insensitively in any case.  However, any matcher must
+explicitly specify case-insensitive matching if that is required.
 )
 kindex(max-errors, completion style)
 item(tt(max-errors))(