From: Daniel Shahaf <d.s@daniel.shahaf.name>
To: Zsh Users <zsh-users@zsh.org>
Subject: Re: prevent some lines directly coming from the history from being executed
Date: Thu, 2 Jun 2022 09:59:30 +0000 [thread overview]
Message-ID: <20220602095930.GA9365@tarpaulin.shahaf.local2> (raw)
In-Reply-To: <CAH+w=7Y3w6=_-Q+JtGztDWWhv-rV+iDCZmr7Pxkyr6V=Oy=6QQ@mail.gmail.com>
Bart Schaefer wrote on Sun, May 29, 2022 at 21:04:54 -0700:
> On Sun, May 29, 2022 at 3:55 PM Daniel Shahaf <d.s@daniel.shahaf.name> wrote:
> >
> > Bart Schaefer wrote on Sat, 28 May 2022 18:43 +00:00:
> > > On Sat, May 28, 2022 at 3:06 AM Daniel Shahaf <d.s@daniel.shahaf.name> wrote:
> > >> +cindex(widgets, shadowing standard)
> > >
> > > "Shadow(ing)" is not a term I'd think to search for in this context.
> >
> > [...] I think "shadow" is the right term
> > here, so how about:
> >
> > +cindex(widgets, shadowing standard)
> > +cindex(widgets, overriding standard)
>
> By comparison to a number of other index entries, I think
>
> standard widgets, shadowing
> standard widgets, overriding
>
> Or even
>
> widgets, standard, shadowing
> widgets, standard, overriding
>
> would fit the pattern better.
Let's see:
% grep -h 'cindex.*widget' *.yo | me
cindex(completion, widgets)
cindex(completion widgets, examining and setting state in)
cindex(completion widgets, adding specified matches)
cindex(completion widgets, modifying special parameters)
cindex(completion widgets, condition codes)
cindex(completion widgets, example)
.
cindex(widgets, rebinding)
cindex(rebinding widgets)
.
cindex(widgets, binding)
cindex(binding widgets)
.
cindex(widgets, invoking)
cindex(invoking widgets)
.
cindex(widgets, calling)
cindex(calling widgets)
.
cindex(widgets, defining)
cindex(defining widgets)
.
cindex(completion widgets, creating)
cindex(widgets)
cindex(widgets, user-defined)
cindex(widgets, standard)
Your second option makes sense to me.
I'll also add a pair of "${verb}ing standard widgets" entries for
consistency with the 5 pairs above.
I don't think it's likely people would look for "standard widgets" under 's'…
>
I'll also change the example code so the `zle -N` runs _after_ the
function is defined, to avoid spurious "No such shell function `myfunc'"
warnings if someone copy-pastes the example line by line.
> > +User-defined widgets may shadow (override) standard widgets: for instance,
> >
> > >> +However, each standard widget `var(foo)' is also available under the
> > >
> > > I would probably have used something like var(std)
> >
> > Personally I find it easier to read with "foo", but I suppose that's
> > a matter of taste. I'll write it whichever way is the house style.
>
> There are plenty of "foo" already in the doc, so as you prefer.
>
*nod*
> > >> +Therefore, for forward compatibility with future versions of the shell,
> > >> +it is recommended that user-defined widgets should not have names
> > >> starting with `tt(.)'.
> > >
> > > It's actually prohibited to name a user-defined widget the same as one
> > > of the reserved dot-names, so this recommendation could be more
> > > specific.
> >
> > OK, can spell out the problem. Wouldn't that make the paragraph a bit
> > of a wall of text, though? Also, it would further break the flow
>
> Hm. How about, picking up after
> +This makes the standard widget available to be called or bound even when
> +its usual name has been redefined.
>
> These names are reserved and cannot be created as user-defined
> widgets, so for compatibility with possible future revisions of the
> shell, it is recommended that users avoid naming widgets with a
> leading `tt(.)'.
Thanks. I'll include this in v3.
next prev parent reply other threads:[~2022-06-02 10:00 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-24 15:47 Vincent Lefevre
2022-05-24 18:58 ` Bart Schaefer
2022-05-25 2:54 ` Vincent Lefevre
2022-05-25 3:59 ` Bart Schaefer
2022-05-25 8:49 ` Vincent Lefevre
2022-05-26 1:25 ` Bart Schaefer
2022-05-26 14:36 ` Vincent Lefevre
2022-05-26 15:53 ` Daniel Shahaf
2022-05-26 16:13 ` Peter Stephenson
2022-05-27 12:40 ` Daniel Shahaf
2022-05-28 0:07 ` Vincent Lefevre
2022-05-28 10:06 ` Daniel Shahaf
2022-05-28 18:43 ` Bart Schaefer
2022-05-29 22:55 ` Daniel Shahaf
2022-05-30 4:04 ` Bart Schaefer
2022-05-30 9:07 ` Peter Stephenson
2022-06-02 9:59 ` Daniel Shahaf
2022-06-02 10:19 ` Daniel Shahaf
2022-06-02 9:59 ` Daniel Shahaf [this message]
2022-05-30 9:02 ` Vincent Lefevre
2022-06-02 10:17 ` Daniel Shahaf
2022-06-02 13:54 ` Vincent Lefevre
2022-05-26 16:37 ` Bart Schaefer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220602095930.GA9365@tarpaulin.shahaf.local2 \
--to=d.s@daniel.shahaf.name \
--cc=zsh-users@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).