about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog8
-rw-r--r--Completion/Core/_expand7
-rw-r--r--Completion/User/_nedit2
3 files changed, 13 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 2144794d9..d893793fb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,8 +1,16 @@
+2000-05-01  Bart Schaefer  <schaefer@zsh.org>
+
+	* 11043: Completion/Core/_expand, Completion/User/_nedit: Catch
+	an eval-time parse error by forcing the eval into a subshell;
+	don't fail on nonexistent ~/.nedit file.
+
 2000-05-01  Oliver Kiddle  <opk@zsh.org>
 
 	* 11041: Completion/User/.distfiles, Completion/User/_bzip2:
 	Use of _arguments for bzip2 completion
 
+2000-04-31  Oliver Kiddle  <opk@zsh.org>
+
 	* 11037: Etc/MACHINES, Etc/NEWS, Etc/completion-style-guide,
 	Etc/zsh-development-guide: spelling corrections
 
diff --git a/Completion/Core/_expand b/Completion/Core/_expand
index 1a96e654e..293ad3649 100644
--- a/Completion/Core/_expand
+++ b/Completion/Core/_expand
@@ -32,13 +32,14 @@ fi
 exp=("$word")
 
 # First try substitution. That weird thing spanning multiple lines
-# changes quoted spaces, tabs, and newlines into spaces.
+# changes quoted spaces, tabs, and newlines into spaces and protects
+# this function from aborting on parse errors in the expansion.
 
 { zstyle -s ":completion:${curcontext}:" substitute expr ||
   { [[ "$curcontext" = expand-word:* ]] && expr=1 } } &&
     [[ "${(e):-\$[$expr]}" -eq 1 ]] &&
-    exp=( "${(e)exp//\\[ 	
-]/ }" )
+    exp=( ${(f)"$(print -lR - ${(e)exp//\\[ 	
+]/ } 2>/dev/null)"} )
 
 # If the array is empty, store the original string again.
 
diff --git a/Completion/User/_nedit b/Completion/User/_nedit
index a3fcd9785..5261a54a9 100644
--- a/Completion/User/_nedit
+++ b/Completion/User/_nedit
@@ -44,7 +44,7 @@ else
     "$nedit_common[@]"
 fi
 
-[[ $state = lang ]] &&
+[[ $state = lang && -f ~/.nedit ]] &&
     _wanted neditlanguages expl 'language mode' \
         compadd -  ${(f)"$(sed -n \
             '/^nedit.languageMode/,/^nedit/ s/.*	\([^:]*\).*/\1/p' < ~/.nedit)"}