Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [PATCH] correced example in zle doc
- X-seq: zsh-workers 33158
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: zsh workers <zsh-workers@xxxxxxx>
- Subject: Re: [PATCH] correced example in zle doc
- Date: Sat, 13 Sep 2014 15:51:43 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=sIn8vpjK1DsYpCNjiXIfoe1Krh85xokQnYUfyuf1oc8=; b=liApogRmjJLLO7TmBr9jfVSexE5Xr95v86vnk0VB/RLUemSyieraulFViDbtVIRBJR gGISVJxRWtKTD72lDrQq3cy82Leoj4UYqskte/AEIcQuUdEqnblcrzcg/jCkLe6WeWnP k0S3pagRo6Pyv/Aw5nMOnplqwld6LvF8O9VpaiSozqeYaQb2yvdevasVJMCr2vZ+Oukk j3v8Wg3mBsDUiBLj5pEizoMBaGmjqk4CDCy2Dgqd0UjgD51rPq5C4cxlDVCB9MxzW5i3 VbHv0PNyy4sCGipB4C5b/HPagMJdk+dz9zzFm1yVu37ChRzpsTiNdjObARJir54D8sIp aybg==
- In-reply-to: <201409131441340736.007AF864@localhost>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <201409131441340736.007AF864@localhost>
On 13 September 2014 14:41, Manuel Presnitz <mpy@xxxxxxx> 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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author