Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: [PATCH] typeset reply array



I think that some of these will break things. For example, if you keep 
_comp_dumpfile local to compinit, when/if compinit calls compdump,
problems might ensue.

I don't know why we can't call compdump with an argument though.

On Sat, May 17, 2008 at 12:55:24PM +0100, martin f. krafft wrote:
> From: martin f. krafft <madduck@xxxxxxxxxxx>
> 
> With warn_create_global set, the function otherwise causes warnings
> like this:
> 
>   url-quote-magic:1: array parameter reply created globally in
>   function
> 
> Signed-off-by: martin f. krafft <madduck@xxxxxxxxxx>
> ---
>  Functions/Zle/url-quote-magic |    3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)
> 
> diff --git a/Functions/Zle/url-quote-magic b/Functions/Zle/url-quote-magic
> index 826d26d..e15d117 100644
> --- a/Functions/Zle/url-quote-magic
> +++ b/Functions/Zle/url-quote-magic
> @@ -65,11 +65,12 @@ zstyle -m ':url-quote-magic:\*' url-metas '*' ||
>      zstyle ':url-quote-magic:*' url-metas '*?[]^(|)~#{}='
>  
>  zstyle -m ':url-quote-magic:\*' url-seps '*' ||
> -    zstyle -e ':url-quote-magic:*' url-seps 'reply=(";&<>${histchars[1]}")'
> +    zstyle -e ':url-quote-magic:*' url-seps 'typeset -a reply; reply=(";&<>${histchars[1]}")'
>  
>  zstyle -m :url-quote-magic url-globbers '*' ||
>      zstyle -e :url-quote-magic url-globbers \
>  	'zmodload -i zsh/parameter;
> +	 typeset -a reply;
>  	 reply=( noglob
>  		 ${(k)galiases[(R)(* |)(noglob|urlglobber|globurl) *]:-}
>  		 ${(k)aliases[(R)(* |)(noglob|urlglobber|globurl) *]:-} )'
> -- 
> 1.5.5.1

On Sat, May 17, 2008 at 01:11:17PM +0100, martin f. krafft wrote:
> With warn_create_global set, the function otherwise causes warnings
> like this:
> 
> compinit:123: scalar parameter _comp_dumpfile created globally in function
> compinit:130: array parameter _comp_options created globally in function
> compinit:164: scalar parameter _comp_setup created globally in function
> compinit:169: array parameter compprefuncs created globally in function
> compinit:170: array parameter comppostfuncs created globally in function
> 
> Signed-off-by: martin f. krafft <madduck@xxxxxxxxxx>
> ---
>  Completion/compinit |    8 +++++---
>  1 files changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/Completion/compinit b/Completion/compinit
> index a4edd24..30dc26c 100644
> --- a/Completion/compinit
> +++ b/Completion/compinit
> @@ -120,13 +120,14 @@ typeset -gA _lastcomp
>  # Remember dumpfile.
>  if [[ -n $_i_dumpfile ]]; then
>    # Explicitly supplied dumpfile.
> -  _comp_dumpfile="$_i_dumpfile"
> +  local _comp_dumpfile="$_i_dumpfile"
>  else
>    _comp_dumpfile="${ZDOTDIR:-$HOME}/.zcompdump"
>  fi
>  
>  # The standard options set in completion functions.
>  
> +typeset -a _comp_options
>  _comp_options=(
>         bareglobqual
>         extendedglob
> @@ -157,6 +158,7 @@ _comp_options=(
>  # have a valid stdin descriptor (zle closes it before calling widgets)
>  # and don't get confused by user's ZERR trap handlers.
>  
> +typeset -l _comp_setup
>  _comp_setup='setopt localoptions localtraps ${_comp_options[@]};
>               local IFS=$'\'\ \\t\\r\\n\\0\''
>               exec </dev/null;
> @@ -165,8 +167,8 @@ _comp_setup='setopt localoptions localtraps ${_comp_options[@]};
>  # These can hold names of functions that are to be called before/after all
>  # matches have been generated.
>  
> -compprefuncs=()
> -comppostfuncs=()
> +typeset -a compprefuncs; compprefuncs=()
> +typeset -a comppostfuncs; comppostfuncs=()
>  
>  # Loading it now ensures that the `funcstack' parameter is always correct.
>  
> -- 
> 1.5.5.1



Messages sorted by: Reverse Date, Date, Thread, Author