From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6362 invoked by alias); 11 Apr 2016 06:28:04 -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: 38267 Received: (qmail 3946 invoked from network); 11 Apr 2016 06:28:01 -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=-1.9 required=5.0 tests=BAYES_00,T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.1 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= daniel.shahaf.name; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=mesmtp; bh=PUIsQ+r1xLjmqWcBQ6mLfFxcsxA=; b=MRLDnW BLGDC0IVEdPro5aJRFw4WaheaZs5AzjD3e1fgUEWfBLXlSbUyQJDVxFEtMvZeRMp VhPUDwYKqBfSXac/LNU5HQPeMRxnOueVGdQsxSGrlcc5elbvYzcnN4MB9OgZDFvw N+YZRi1miCj/FVBt8+jj+KtPhdO89cRlXSUSg= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=smtpout; bh=PUIsQ+r1xLjmqWcBQ6mLfFxcsxA=; b=gK0ai 24W07bZFhFWz6hSjRpg01C9XO28InEdZcBLp7WejMoC25FcEt+9qaVhBjGmOZsXN Gz4/iPt1hRLJBxN6im39QBb98hxqCyYo9W5gv1nbtbhA7MSUrUgHZn1iEupbnDVz Vj+KD/DZ0kRWv94Q2KbxH+SgkcE85TzRT/Nyi4= X-Sasl-enc: jP2hgRbSvdGakB+DA/nBJKWTiNW0rT8t3AWgLNr8Ip4i 1460355414 Date: Mon, 11 Apr 2016 06:16:47 +0000 From: Daniel Shahaf To: m0viefreak Cc: zsh-workers@zsh.org Subject: Re: [PATCH] Expose isearch and suffix regions to widgets. Message-ID: <20160411061647.GA5368@tarsus.local2> References: <1457905871-2808-1-git-send-email-m0viefreak.cm@googlemail.com> <570A50CF.2000600@googlemail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <570A50CF.2000600@googlemail.com> User-Agent: Mutt/1.5.21 (2010-09-15) m0viefreak wrote on Sun, Apr 10, 2016 at 15:10:39 +0200: > On 10.04.2016 07:35, Bart Schaefer wrote: > > And if the answer is going to be "during zle-isearch-update" then > > won't ISEARCH_ACTIVE always be true? > > No, I actually made a mistake in the docs for the original patch. > > ISEARCH_ACTIVE does not describe the fact that the minibuffer is active, > but the fact that a pattern that was typed in there does actually > matches the BUFFER. If the search pattern does not match ("failing > bck-i-search:") nothing is being underlined, and ISEARCH_ACTIVE will be 0. > > I attached a small patch to improve the wording in the docs. Rename the shell parameter, then? I know the C variable is called 'isearch_active', but the shell parameter's name is an interface, and I'd rather have the interface be named properly than have it accurately represent an implementation detail. (In z-sy-h I'll just track the rename, and pretend the ISEARCH_ACTIVE name never existed.) Cheers, Daniel P.S. I usually review patches such as the one below by converting them to wdiff format by piping them through 'wdiff -d'. It's a useful command but not too well known, I think... > From 87aaf78284752d04873aff4ece710ccc3279c563 Mon Sep 17 00:00:00 2001 > From: m0viefreak > Date: Sun, 10 Apr 2016 14:57:51 +0200 > Subject: [PATCH] Improve wording of the ISEARCH_ACTIVE parameter. > > --- > Doc/Zsh/zle.yo | 9 +++++---- > 1 file changed, 5 insertions(+), 4 deletions(-) > > diff --git a/Doc/Zsh/zle.yo b/Doc/Zsh/zle.yo > index 161cef7..c482a46 100644 > --- a/Doc/Zsh/zle.yo > +++ b/Doc/Zsh/zle.yo > @@ -841,10 +841,11 @@ vindex(ISEARCH_END) > xitem(tt(ISEARCH_ACTIVE) (integer)) > xitem(tt(ISEARCH_START) (integer)) > item(tt(ISEARCH_END) (integer))( > -tt(ISEARCH_ACTIVE) indicates whether an incremental search minibuffer > -is active. tt(ISEARCH_START) and tt(ISEARCH_END) give the location of > -the matched pattern and are in the same units as tt(CURSOR). They are > -only valid for reading when tt(ISEARCH_ACTIVE) is non-zero. > +tt(ISEARCH_ACTIVE) indicates whether a part of the tt(BUFFER) is > +currently matched by an incremental search pattern. tt(ISEARCH_START) > +and tt(ISEARCH_END) give the location of the matched part and are > +in the same units as tt(CURSOR). They are only valid for reading > +when tt(ISEARCH_ACTIVE) is non-zero. > > All parameters are read-only. > ) > -- > 2.7.4 >