zsh-users
 help / color / mirror / code / Atom feed
* can combination of zstyle -e and -a cause infinite loop?
@ 2014-03-04  8:45 Amm
  2014-03-04 16:03 ` Bart Schaefer
  0 siblings, 1 reply; 3+ messages in thread
From: Amm @ 2014-03-04  8:45 UTC (permalink / raw)
  To: zsh-users

Hello,


I got this curious question when trying to find
solution of something else.
(based on Bart's solution in some other e-mail)


if I use zstyle like this:


zstyle -e ':completion:*' matcher-list \

    'zstyle -a ":completion:$curcontext" matcher-list reply'


OR

if I write something like this in two lines:

zstyle -e ':completion:*' matcher-list \

    'zstyle -a ":completion:b" matcher-list reply'
zstyle -e ':completion:b' matcher-list \

    'zstyle -a ":completion:a" matcher-list reply'


Will any of the two cases above cause infinite loops?

Or zsh will detect these loops?


Just curious to know, I have not tried! :fear:


Amm



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: can combination of zstyle -e and -a cause infinite loop?
  2014-03-04  8:45 can combination of zstyle -e and -a cause infinite loop? Amm
@ 2014-03-04 16:03 ` Bart Schaefer
  2014-03-05  2:51   ` Amm
  0 siblings, 1 reply; 3+ messages in thread
From: Bart Schaefer @ 2014-03-04 16:03 UTC (permalink / raw)
  To: zsh-users

On Mar 4,  4:45pm, Amm wrote:
}
} Will any of the two cases above cause infinite loops?
} 
} Or zsh will detect these loops?

They'll be detected.  Testing either of the mutually recurisive styles
will always "fail":

    zstyle -a sets the array to empty but returns 0
    zstyle -s sets the scalar to empty but returns 0
    zstyle -b sets the scalar to "no" and returns 1
    zstyle -m returns 1
    zstyle -t returns 1
    zstyle -T returns 0

(This might differ if the recursive call is not the only part of one
of the eval'd strings that assigns to $reply.)

All of them print to stderr:

    zsh: job table full or recursion limit exceeded


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: can combination of zstyle -e and -a cause infinite loop?
  2014-03-04 16:03 ` Bart Schaefer
@ 2014-03-05  2:51   ` Amm
  0 siblings, 0 replies; 3+ messages in thread
From: Amm @ 2014-03-05  2:51 UTC (permalink / raw)
  To: zsh-users

> ----- Original Message -----

> From: Bart Schaefer <schaefer@brasslantern.com>
> 
> They'll be detected.  Testing either of the mutually recurisive styles
> will always "fail":
> 
> All of them print to stderr:
>     zsh: job table full or recursion limit exceeded

Thanks again for clarification, that helped.
(for both my e-mails that you replied to)


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-03-05  2:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-03-04  8:45 can combination of zstyle -e and -a cause infinite loop? Amm
2014-03-04 16:03 ` Bart Schaefer
2014-03-05  2:51   ` Amm

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).