From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20428 invoked by alias); 24 Jul 2016 04:26:49 -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: 38933 Received: (qmail 22305 invoked from network); 24 Jul 2016 04:26:49 -0000 X-Qmail-Scanner-Diagnostics: from mail-pa0-f65.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.220.65):SA:0(0.0/5.0):. Processed in 0.204042 secs); 24 Jul 2016 04:26:49 -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=tEYPltQ0whN3+KMyJoirLJ15ycnN4JL1IuXqkUNwC9c=; b=Z7FZ8SOQCAj+X1ZoD8OnWFsdsM7x52CSxqjp1I5uVkOAr5IwrZEdzhUy2TLvNyvTkn ocHmb4cbb9dssM+RHbjgctOmzjk7peblC56FaC8MELVHNxRkWb4/z3D1XVqEHEtq6MkS G/fZIwuMyT3VreSQxQ8/QQOGGv2/D6qvbDgDp8rPn+hEeS4/20r2NqJTUxsu5lBuUwfa 07EwSPRx/znTCLBZ+NaU4H9jozOrBV0KH2+6SgESyF1rIxjiEG4N9bvWmJCdpk9Npydi oTaoMDNGJtB3fbc9PAEOFJ+SMhDXI9JvWa6fu1rPMGl8m1Zy0uLD3Qy6vwhqYCrziTH6 FptQ== 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=tEYPltQ0whN3+KMyJoirLJ15ycnN4JL1IuXqkUNwC9c=; b=C7wTPvXiq6r/cs/kE4NHxLDuSx/nbVNzMhq2QHF7Osq+FpxsAIPL+Po2UQkgGFudz/ kwu6nN5hzMba4KSTK6s+VaZg8FauDM/0tqSJfKIZaKoWXS/6mtq2lq6fJy7ItH5O/AIl 1n7RL1rswSCkX1m4dqsMQbj0CmYISnHg3ufN6UBblCS11XR93VEFM5z0gMbIywFc5y4Q YI5m7BaPmykXyBiaXvqlqvECsb8pU4Jav1TtPwxHi0WG7eST9emIhESEmmKJ4x+GDW5P jvoYumOxWtgs0AU9Fp2tky71yypSY+FUcXtSuRHo5HN93uwwuCvJX0LP4Xkx0978yqnw a1+g== X-Gm-Message-State: AEkoousyldwMbAXANLHo51ZhkY9mPKuv/Wse3Pw8DY/y9QhRJR+F1W/IE0xWUY+NkOfDQQ== X-Received: by 10.66.242.166 with SMTP id wr6mr19158291pac.147.1469334403392; Sat, 23 Jul 2016 21:26:43 -0700 (PDT) From: Bart Schaefer Message-Id: <160723181445.ZM20105@torch.brasslantern.com> Date: Sat, 23 Jul 2016 18:14:45 -0700 In-Reply-To: <20160723212335.GA20872@tarsus.local2> Comments: In reply to Daniel Shahaf "[PATCH] add-zle-hook-widget zle-line-pre-redraw issue" (Jul 23, 9:23pm) References: <20160723212335.GA20872@tarsus.local2> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-workers@zsh.org Subject: Re: [PATCH] add-zle-hook-widget zle-line-pre-redraw issue MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Jul 23, 9:23pm, Daniel Shahaf wrote: } } The reason appears to be that, while in azhw:zle-line-init $WIDGET is } "zle-line-init", in azhw:zle-line-pre-redraw $WIDGET is the name of the } widget the user invoked (e.g., "self-insert"), so the 'zstyle -a' does } not find the registered hooks. If zsh-syntax-highlighting doesn't depend on that behavior, it's probably unlikely that anything else does. However, Mikael will have to weigh in on whether he chose do to this intentionally. } Each of the following alternative patches solves the issue: The "second option" obviously isn't finished / leaves a lot of dead code behind. However, I think the first option is the correct one, unless there's a good reason to leave $WIDGET alone; the context that's being saved/restored by redrawhook() is important, because we're in the middle of an arbitrary other widget This is actually related to what I was saying about it not being appropriate to stick a list of callbacks on any widget. We can easily special-case add-zle-hook-widget to find the name another way for this particular hook. $funcstack[1] for example. Incidentally, I tried making ALL the possible hooks be zle -M "$WIDGET $funcstack[1]" and learned two things. (1) pre-redraw is in fact the only hook that doesn't change $WIDGET, and (2) having all the hooks call "zle -M" garbles the output quite thoroughly, especially in vi mode.