* [PATCH] correced example in zle doc
@ 2014-09-13 12:41 Manuel Presnitz
2014-09-13 13:51 ` Mikael Magnusson
0 siblings, 1 reply; 2+ messages in thread
From: Manuel Presnitz @ 2014-09-13 12:41 UTC (permalink / raw)
To: zsh-workers
[-- Attachment #1: Type: text/plain, Size: 1150 bytes --]
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()
[-- Attachment #2: zle.yo.patch --]
[-- Type: application/octet-stream, Size: 450 bytes --]
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()
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] correced example in zle doc
2014-09-13 12:41 [PATCH] correced example in zle doc Manuel Presnitz
@ 2014-09-13 13:51 ` Mikael Magnusson
0 siblings, 0 replies; 2+ messages in thread
From: Mikael Magnusson @ 2014-09-13 13:51 UTC (permalink / raw)
To: zsh workers
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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-09-13 13:51 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-13 12:41 [PATCH] correced example in zle doc Manuel Presnitz
2014-09-13 13:51 ` Mikael Magnusson
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).