zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-workers@zsh.org
Subject: Re: add-zle-hook-widget: infinite recursion ("job table full or recursion limit exceeded")
Date: Tue, 30 Aug 2016 16:31:38 -0700	[thread overview]
Message-ID: <160830163138.ZM26309@torch.brasslantern.com> (raw)
In-Reply-To: <20160830172302.GA16145@fujitsu.shahaf.local2>

On Aug 30,  5:23pm, Daniel Shahaf wrote:
} Subject: add-zle-hook-widget: infinite recursion ("job table full or recur
}
} +add-zle-hook-widget:21> '(anon)' zle-line-pre-redraw f
} +(anon):2> emulate -L zsh
} +(anon):5> zmodload -e zsh/zle
} +(anon):5> return 1

Ah ...

} Running 'zmodload zsh/zle' before the call appears to prevent hte
} problem.  I can do that in my callsite (z-sy-h's "make check"), but
} I assume zsh shouldn't enter an infinite loop, either.

Need to move the sanity checks out of the anonymous function.  Unless
someone suggests a variation of "return" that works like "break 2".


diff --git a/Functions/Misc/add-zle-hook-widget b/Functions/Misc/add-zle-hook-widget
index c47d9a3..572de25 100644
--- a/Functions/Misc/add-zle-hook-widget
+++ b/Functions/Misc/add-zle-hook-widget
@@ -18,10 +18,6 @@
 #
 # The -L option lists the hooks and their associated widgets.
 
-() { # Preserve caller global option settings
-
-emulate -L zsh
-
 # This is probably more safeguarding than necessary
 zmodload -e zsh/zle || return 1
 { zmodload zsh/parameter && zmodload zsh/zleparameter } || {
@@ -29,6 +25,10 @@ zmodload -e zsh/zle || return 1
     return 1
 }
 
+() { # Preserve caller global option settings
+
+emulate -L zsh
+
 # Setup - create the base functions for hook widgets that call the others
 
 local -a hooktypes=( zle-isearch-exit zle-isearch-update


  reply	other threads:[~2016-08-30 23:31 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-30 17:23 Daniel Shahaf
2016-08-30 23:31 ` Bart Schaefer [this message]
2016-08-31  2:22   ` Daniel Shahaf
2016-08-31  3:28     ` 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=160830163138.ZM26309@torch.brasslantern.com \
    --to=schaefer@brasslantern.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).