Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Hiding specials, and namerefs
- X-seq: zsh-workers 55002
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- Cc: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: Re: Hiding specials, and namerefs
- Date: Mon, 20 Jul 2026 02:40:40 +0200
- Arc-authentication-results: i=1; mx.google.com; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=YHbX7G+0xZM5E0xpZctgge2xtyJ1M9hR8axsj6nO2io=; fh=vuDAGjptCPc/P1/HEZ3j98yPJEW1XjuEoEAmmwDS/+U=; b=haPVVy+x4f3WbZJboYp7zYqm4AftYcMR7fQ5h6Ql20JcEs1smOcAk7LlWRkH2HkAGk 9aXeMSEYle4x+gIlhvZ4xzdCvEeowMxTPwPinRJj52K1zWqXkWoSSRQaU91eoS2Q3GFB F/OAwxkY2oPO7kbR3ijNFB2UWxsBZK29Pb/+FD7sLWulhoCZ3ucoUyu+/NE3RULogu72 VI49vi8OB+Aa5Dyr9APXpPlgxtAXyci2H9dfybW8C5E0W+UxqbOSbi2grxhGfe+pztWi sKRMpwNUbWm+IVQYzdIEd+Fw+3uiZwWD4tXpoMUJrLOyIcPeikDwvFYZ34+KYKdKkJkt Z5ow==; darn=zsh.org
- Arc-seal: i=1; a=rsa-sha256; t=1784508053; cv=none; d=google.com; s=arc-20260327; b=nRamS8u4bOztUQX/JV7Cf/VEzYz29AS/24sZzTcm02R4xsDLa26lk5fHdTLdGgN5Mz zZDimBr9T9KSG9O5PgAnU0LtzqESe1Ny2SnZ2q220xSaPWJuaA6NOgJBK0QvkFEThveM juQ8Nl+ArjqLe3iqcMdL2t/8PL29FHM4UOQiPowbwcM2d+AVBCkb7sKmYwXc1SIEO/q0 iFaoL2k9BO4mi6qpc6iMsQOezpy4raC0YecD2uUSNiTqKM8pz4UYE1J/VJ0z2+X/d2P/ xfl+j6sD1ybJSeCS+8nEiRQUl5EoZP6n16da4xnnaXbtADPDkd7vtL4+qsfCXTt6/zkY 2VWA==
- Archived-at: <https://zsh.org/workers/55002>
- In-reply-to: <CAH+w=7ZVUPRKBpRVOGX4eSqbKNFyt8PrYC4r37GMGu1KJO8Egg@mail.gmail.com>
- List-id: <zsh-workers.zsh.org>
- References: <CAH+w=7ZVUPRKBpRVOGX4eSqbKNFyt8PrYC4r37GMGu1KJO8Egg@mail.gmail.com>
On Mon, Jul 20, 2026 at 1:54 AM Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
>
> 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
I think that would make sense, I vaguely remember being confused why
typeset -h seemingly didn't work, only to realize later it was because
of magic scope. Ah, here it is, 34994 (and 35007). If I had gotten an
error, I would probably have been confused for a shorter period of
time.
--
Mikael Magnusson
Messages sorted by:
Reverse Date,
Date,
Thread,
Author