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

Hiding specials, and namerefs



Consider this:

local_nonspecial() { () {
  local -h BUFFER;
  local -n BUFFER=CURSOR;
  ((BUFFER-=3));
} }
zle -N local_nonspecial

Notes:
-- `typeset -hn ...` is not allowed, but can be worked around, so
probably should be allowed?
-- the ZLE parameters are already implicitly local on entry to a
widget function, so declaring them local again (even with -h) doesn't
change anything without introducing another scope.

(Noticed this while checking for side-effects of workers/54809)

Should there be an error or warning when attempting to "de-specialize"
a special parameter in the same scope where it already exists as a
special?

This is similar to this situation:
% typeset -i WATCH
typeset: WATCH: can't change type of autoloaded parameter




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