about summary refs log tree commit diff
path: root/Functions
diff options
context:
space:
mode:
authorBarton E. Schaefer <schaefer@zsh.org>2013-10-27 14:12:54 -0700
committerBarton E. Schaefer <schaefer@zsh.org>2013-10-27 14:12:54 -0700
commit4748eff7d2e97ff652f5d75d33b9aad12d7d917f (patch)
tree6239b359d9b4a8a8dfaf222a0532fd6cca04e6cd /Functions
parentc39d2f8e494010030b0c5258f004a38bbb30deee (diff)
downloadzsh-4748eff7d2e97ff652f5d75d33b9aad12d7d917f.tar.gz
zsh-4748eff7d2e97ff652f5d75d33b9aad12d7d917f.tar.xz
zsh-4748eff7d2e97ff652f5d75d33b9aad12d7d917f.zip
Some syntax adjustments in _expand_word_and_keep. Add a working URL.
Diffstat (limited to 'Functions')
-rw-r--r--Functions/Zle/keeper27
1 files changed, 17 insertions, 10 deletions
diff --git a/Functions/Zle/keeper b/Functions/Zle/keeper
index c29b22d6f..a40125771 100644
--- a/Functions/Zle/keeper
+++ b/Functions/Zle/keeper
@@ -4,6 +4,9 @@
 # Shell Corner column on UnixReview.com in January 2005 at the URL
 # <http://www.unixreview.com/documents/s=9513/ur0501a/ur0501a.htm>
 #
+# Article still available on the Wayback Machine:
+# <http://web.archive.org/web/20050207041146/http://www.unixreview.com/documents/s=9513/ur0501a/ur0501a.htm>
+#
 # A few minor edits have been made to those functions for this file.  Key
 # bindings are commented out to avoid clashes with any existing bindings.
 ##
@@ -69,17 +72,21 @@ zstyle ':completion:expand-kept-result:*' completer _insert_kept
 # "_insert_kept".
 
 _expand_word_and_keep() {
-    function compadd() {
-        local -A args
-        zparseopts -E -A args J:
-        if [[ $args[-J] == all-expansions ]]
-        then
-            builtin compadd -A kept "$@"
-            kept=( ${(Q)${(z)kept}} )
-        fi
-        builtin compadd "$@"
+    {
+        function compadd {
+            local -A args
+            zparseopts -E -A args J:
+            if [[ $args[-J] == all-expansions ]]
+            then
+                builtin compadd -A kept "$@"
+                kept=( ${(Q)${(z)kept}} )
+            fi
+            builtin compadd "$@"
+        }
+        _expand_word
+    } always {
+        unfunction compadd
     }
-    { _expand_word } always { unfunction compadd }
 }
 
 zle -C _expand_word complete-word _expand_word_and_keep