From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4505 invoked by alias); 30 Aug 2016 23:31:13 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 39131 Received: (qmail 15583 invoked from network); 30 Aug 2016 23:31:13 -0000 X-Qmail-Scanner-Diagnostics: from mail-pf0-f196.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(209.85.192.196):SA:0(0.0/5.0):. Processed in 0.786222 secs); 30 Aug 2016 23:31:13 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.1 X-Envelope-From: schaefer@brasslantern.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: none (ns1.primenet.com.au: domain at brasslantern.com does not designate permitted sender hosts) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=from:message-id:date:in-reply-to:comments:references:to:subject :mime-version; bh=HU/dVwHeFW7O/iMJugL3KP6hbRNs/wZpIwKxNWrwwQc=; b=uySMpgSQ8w+7G4Ytc+1dsf+OsHUIpE7mAa0NL9CliLYsJR69nUaD32LNPdivl/7Cj8 k/mnGAIhb5LF/JH+eIxVMn4wdkTfGkdEC9LPjj2hS7RlnQuqVx/JtM5/E5RSD+kWWswL 8dSuyzT3dQs9O3BuXy3JqupRYhDvq6dAIp0MU26Dp4A1EXRQsH9O86mEdFFX1V/Ci/cw Lpvo6u2Lrwgno1HYDWz/IMa24Vt41obLUQb5XDw3qsAGkfwOX85j+owgGttPWFxlyd70 1H24nMZrZidvZoEX9KnPC4TtmuiBH8OH+YNABv8AWbXitUK1tJ8BHQOJHwQF1Li3d4jA ZPHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:message-id:date:in-reply-to:comments :references:to:subject:mime-version; bh=HU/dVwHeFW7O/iMJugL3KP6hbRNs/wZpIwKxNWrwwQc=; b=e2Q4iTLxX2rmWZVmPvHdwjTjPWjbWzWoQeN5fau8LkK19rezEtxoaxHia5UPZ2lFPu AWlmeZQ0yKxZg42v0Te972cB+Vo4o4Cpc+iaOpmCVJ48x4GUq5eODW9eKCyfK2zASuxl MWhlPTmpNANnOoBASa3wM0TzE13deWlFfn4X+3oOC08JAs28o3g1ybLPtLOtyGu/ts1X PtnBG2WS4409umvOrSt3Z3cFTTplzT96ivPdiXp+XFKidFNZxk+5/AmX4ounoV1cV587 81lALfOVlUmpnmGZCUP4xru/K4j34waXCkCJNhl3eWBxluytc3m7pX21Ui+ym+ZlTC18 A0/g== X-Gm-Message-State: AE9vXwOulkGaHPjkP6n0BDTncfB+KGyaEEo/R9HwrRIeF52n8N2G5Qj0SgvpTOKnKa+3Jg== X-Received: by 10.98.17.83 with SMTP id z80mr11474712pfi.38.1472599866631; Tue, 30 Aug 2016 16:31:06 -0700 (PDT) From: Bart Schaefer Message-Id: <160830163138.ZM26309@torch.brasslantern.com> Date: Tue, 30 Aug 2016 16:31:38 -0700 In-Reply-To: <20160830172302.GA16145@fujitsu.shahaf.local2> Comments: In reply to Daniel Shahaf "add-zle-hook-widget: infinite recursion ("job table full or recursion limit exceeded")" (Aug 30, 5:23pm) References: <20160830172302.GA16145@fujitsu.shahaf.local2> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-workers@zsh.org Subject: Re: add-zle-hook-widget: infinite recursion ("job table full or recursion limit exceeded") MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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