about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2008-02-23 18:33:57 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2008-02-23 18:33:57 +0000
commitfd2e321313b400ce3e1f223c93d531696d98be62 (patch)
tree1e50a002741c32f07ee0608aad252c12044d5795
parent485a008075ce19bfdf19922c803d1637ebb5255e (diff)
downloadzsh-fd2e321313b400ce3e1f223c93d531696d98be62.tar.gz
zsh-fd2e321313b400ce3e1f223c93d531696d98be62.tar.xz
zsh-fd2e321313b400ce3e1f223c93d531696d98be62.zip
24588: tweak glob qualifier completion
24590: turn down error reporting when unquoting
-rw-r--r--ChangeLog6
-rw-r--r--Completion/Zsh/Type/_globquals20
-rw-r--r--Completion/Zsh/Type/_history_modifiers3
-rw-r--r--Src/exec.c5
-rw-r--r--Src/lex.c2
5 files changed, 20 insertions, 16 deletions
diff --git a/ChangeLog b/ChangeLog
index 7ad5991c9..c7448d726 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2008-02-23  Peter Stephenson  <p.w.stephenson@ntlworld.com>
 
+	* 24590: Src/exec.c, Src/lex.c: tame overzealous error
+	report when unquoting.
+
+	* 24588: Completion/Zsh/Type/_globquals,
+	Completion/Zsh/Type/_history_modifiers: tweaks
+
 	* 24585: Completion/Base/Utility/_alternative,
 	Completion/Unix/Type/_path_files,
 	Completion/Zsh/Type/_delimiters,
diff --git a/Completion/Zsh/Type/_globquals b/Completion/Zsh/Type/_globquals
index 0262c8b6f..0ad71b72c 100644
--- a/Completion/Zsh/Type/_globquals
+++ b/Completion/Zsh/Type/_globquals
@@ -56,24 +56,18 @@ while [[ -n $PREFIX ]]; do
 
     (d)
     # complete/skip device
-    if [[ -z $PREFIX ]]; then
-      _message device ID
+    if ! compset -p '[[:digit:]]##'; then
+      _message "device ID"
       return
     fi
-    # It's pointless trying to complete the device.
-    # Simply assume it's done.
-    compset -p '[[:digit:]]##'
     ;;
 
     (l)
     # complete/skip link count
-    if [[ PREFIX = ([-+]|) ]]; then
-      _message link count
+    if ! compset -P '([-+]|)[[:digit:]]##'; then
+      _message "link count"
       return
     fi
-    # It's pointless trying to complete the link count.
-    # Simply assume it's done.
-    compset -P '([-+]|)[[:digit:]]##'
     ;;
 
     (u)
@@ -162,9 +156,9 @@ while [[ -n $PREFIX ]]; do
     # complete/skip range: check for closing bracket
     if ! compset -P "(-|)[[:digit:]]##(,(-|)[[:digit:]]##|)]"; then
       if compset -P "(-|)[[:digit:]]##,"; then
-	_message end of range
+	_message "end of range"
       else
-	_message start of range
+	_message "start of range"
       fi
       return
     fi
@@ -172,7 +166,7 @@ while [[ -n $PREFIX ]]; do
 
     (:)
     # complete modifiers and don't stop completing them
-    _history_modifiers
+    _history_modifiers q
     return
     ;;
   esac
diff --git a/Completion/Zsh/Type/_history_modifiers b/Completion/Zsh/Type/_history_modifiers
index 085867159..3d112e1e6 100644
--- a/Completion/Zsh/Type/_history_modifiers
+++ b/Completion/Zsh/Type/_history_modifiers
@@ -53,9 +53,10 @@ while true; do
     [[ -n $PREFIX ]] && return 1
 
     list=("\::modifier")
-    [[ $type = g ]] && list+=("):end of qualifiers")
+    [[ $type = q ]] && list+=("):end of qualifiers")
     # strictly we want a normal suffix if end of qualifiers
     _describe -t delimiters "delimiter" list -Q -S ''
+    return
   else
     list=(
       "s:substitute string"
diff --git a/Src/exec.c b/Src/exec.c
index 83479bc88..9ec49e11a 100644
--- a/Src/exec.c
+++ b/Src/exec.c
@@ -46,7 +46,10 @@ enum {
 /**/
 int noerrexit;
 
-/* suppress error messages */
+/*
+ * noerrs = 1: suppress error messages
+ * noerrs = 2: don't set errflag on parse error, either
+ */
  
 /**/
 mod_export int noerrs;
diff --git a/Src/lex.c b/Src/lex.c
index a3b03c8a4..4128f109a 100644
--- a/Src/lex.c
+++ b/Src/lex.c
@@ -1619,7 +1619,7 @@ parse_subst_string(char *s)
      * Historical note: we used to check here for olen == l, but
      * that's not necessarily the case if we stripped an RCQUOTE.
      */
-    if (c != STRING || errflag) {
+    if (c != STRING || (errflag && !noerrs)) {
 	fprintf(stderr, "Oops. Bug in parse_subst_string: %s\n",
 		errflag ? "errflag" : "c != STRING");
 	fflush(stderr);