From: Mikael Magnusson <mikachu@gmail.com>
To: zsh workers <zsh-workers@zsh.org>
Subject: Re: [PATCH] correced example in zle doc
Date: Sat, 13 Sep 2014 15:51:43 +0200 [thread overview]
Message-ID: <CAHYJk3Ruq=hmbwkUc9__OhDzYU+Es7A_dkqwn+=_assav_370w@mail.gmail.com> (raw)
In-Reply-To: <201409131441340736.007AF864@localhost>
On 13 September 2014 14:41, Manuel Presnitz <mpy@gmx.net> wrote:
> Hi,
>
> the given example in the zshzle man page does not follow the suggestion to check substrings in $ZLE_STATE in alphabetically order. (For reference: The alphabetically sorting was introduced in 30425.)
>
>> The substrings are sorted in alphabetical order so that if you want to test for two specific
>> substrings in a future-proof way, you can do match by doing:
>>
>> if [[ $ZLE_STATE == *insert*globalhistory* ]]; then ...; fi
>
>
> With the attached path the example works now as intended; credit for discovering that bug in the doc goes to Volker Siegel (http://superuser.com/questions/691925/zsh-how-to-zle-widgets-directly/691935#comment1060599_691935).
>
> ---Manuel.
>
>
>
> diff --git a/Doc/Zsh/zle.yo b/Doc/Zsh/zle.yo
> index 2a907c5..e586536 100644
> --- a/Doc/Zsh/zle.yo
> +++ b/Doc/Zsh/zle.yo
> @@ -948,7 +948,7 @@ The substrings are sorted in alphabetical order so that if you want to
> test for two specific substrings in a future-proof way, you can do match
> by doing:
>
> -example(if [[ $ZLE_STATE == *insert*globalhistory* ]]; then ...; fi)
> +example(if [[ $ZLE_STATE == *globalhistory*insert* ]]; then ...; fi)
> )
> enditem()
We could use *insert*~^*globalhistory* here and it would work in any
order (needs extendedglob set, but you can always enable it in a
widget function locally anyway).
--
Mikael Magnusson
prev parent reply other threads:[~2014-09-13 13:51 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-13 12:41 Manuel Presnitz
2014-09-13 13:51 ` Mikael Magnusson [this message]
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='CAHYJk3Ruq=hmbwkUc9__OhDzYU+Es7A_dkqwn+=_assav_370w@mail.gmail.com' \
--to=mikachu@gmail.com \
--cc=zsh-workers@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).