Re: PATCH: hiding of specials and namerefs
Philippe Altherr <[email protected]> Tue, 4 Aug 2026 12:23:32 +0200
| Newsgroups | gmane.comp.shells.zsh.devel |
|---|---|
| Message-ID | <CAGdYchs4_4fFAeQm=A527Aq4uzNXk7RM4qFXhdboYBYRJ9c9eA@mail.gmail.com> |
--000000000000aa496a0658360c1f
Content-Type: multipart/alternative; boundary="000000000000aa49690658360c1d"
--000000000000aa49690658360c1d
Content-Type: text/plain; charset="UTF-8"
>
> + if (usepm && (on & PM_HIDE) &&
> + (pm->node.flags & (PM_SPECIAL|PM_AUTOLOAD)) &&
> + *pm->level <= locallevel*) {
Since my first review, I was disturbed by the last condition. First I
thought that it was wrong and instead should be "pm->level == locallevel"
but no, we need the "<" in case one attempts a "typeset -gh" from a local
scope. Now, it occurred to me that the condition isn't needed at all; it's
always true because the parameter table is never supposed to contain a
parameter whose level is higher than the locallevel. The condition should
be dropped.
Philippe
--000000000000aa49690658360c1d
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div dir=3D"ltr"><blockquote class=3D"gmail_quote" style=
=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding=
-left:1ex">+ =C2=A0 =C2=A0if (usepm && (on & PM_HIDE) &&=
;<br>+ (pm->node.flags & (PM_SPECIAL|PM_AUTOLOAD)) &&<br>+ <=
b>pm->level <=3D locallevel</b>) {</blockquote><div><br></div><div>Si=
nce my first review, I was disturbed by the last condition. First I thought=
that it was wrong and instead should be "pm->level =3D=3D locallev=
el" but no, we need the "<" in case one attempts=C2=A0a &=
quot;typeset -gh" from a local scope. Now, it occurred=C2=A0to me that=
the condition isn't needed at all; it's always true because the pa=
rameter table is never supposed to contain a parameter whose level is highe=
r than the locallevel. The condition should be dropped.</div><div><br></div=
><div>Philippe</div><div><br></div></div></div>
--000000000000aa49690658360c1d--
--000000000000aa496a0658360c1f
Content-Type: text/plain; charset="US-ASCII"; name="workers-55030-update.txt"
Content-Disposition: attachment; filename="workers-55030-update.txt"
Content-Transfer-Encoding: base64
Content-ID: <f_mseidkop0>
X-Attachment-Id: f_mseidkop0
ZGlmZiAtLWdpdCBhL1NyYy9idWlsdGluLmMgYi9TcmMvYnVpbHRpbi5jCmluZGV4IGUzNWQ3ZmUy
Yy4uNTVmYTdmZmIyIDEwMDY0NAotLS0gYS9TcmMvYnVpbHRpbi5jCisrKyBiL1NyYy9idWlsdGlu
LmMKQEAgLTIyMTAsOCArMjIxMCw3IEBAIHR5cGVzZXRfc2luZ2xlKGNoYXIgKmNuYW1lLCBjaGFy
ICpwbmFtZSwgUGFyYW0gcG0sIGludCBmdW5jLAogCSovCiAgICAgfQogICAgIGlmICh1c2VwbSAm
JiAob24gJiBQTV9ISURFKSAmJgotCShwbS0+bm9kZS5mbGFncyAmIChQTV9TUEVDSUFMfFBNX0FV
VE9MT0FEKSkgJiYKLQlwbS0+bGV2ZWwgPD0gbG9jYWxsZXZlbCkgeworCShwbS0+bm9kZS5mbGFn
cyAmIChQTV9TUEVDSUFMfFBNX0FVVE9MT0FEKSkpIHsKICNpZiAwCiAJendhcm5uYW0oY25hbWUs
ICIlczogY2FuJ3QgY2hhbmdlIHBhcmFtZXRlciBhdHRyaWJ1dGUiLCBwbmFtZSk7CiAJLyogcmV0
dXJuIE5VTEw7ICovCS8qIHRoaXMgaGFzIGFsd2F5cyBiZWVuIGEgbm8tb3AgKi8K
--000000000000aa496a0658360c1f--