From 4748eff7d2e97ff652f5d75d33b9aad12d7d917f Mon Sep 17 00:00:00 2001 From: "Barton E. Schaefer" Date: Sun, 27 Oct 2013 14:12:54 -0700 Subject: Some syntax adjustments in _expand_word_and_keep. Add a working URL. --- ChangeLog | 3 +++ Functions/Zle/keeper | 27 +++++++++++++++++---------- 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index c24084b1a..659aba150 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2013-10-27 Barton E. Schaefer + * unposted (cf. users/18063): Functions/Zle/keeper: clean up + some syntax nits, add working link to old Unix Review article + * 31912: Src/exec.c: in closemn(), distinguish closing for >&- from closing for a real redirect. Fixes knock-on multios bug introduced by workers/20666 way back in 2005. 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 # # +# Article still available on the Wayback Machine: +# +# # 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 -- cgit 1.4.1