Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm
Precedence: bulk
X-No-Archive: yes
List-Id: Zsh Workers List <zsh-workers.zsh.org>
List-Post: <mailto:zsh-workers@zsh.org>
List-Help: <mailto:zsh-workers-help@zsh.org>
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,FREEMAIL_FROM,
	T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.1
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=googlemail.com; s=20120113;
        h=subject:to:references:from:message-id:date:user-agent:mime-version
         :in-reply-to;
        bh=fgKNkDoVTD8jDioq//R8jxNjS91VXXRL7EZ4luHoFjU=;
        b=CD7nWH4VLEhQ1zMIf3jOs4lc7MheIM+aQ+kwRKaqDZZ1i4ILOsvKSGkVUvv8arOumC
         25bbDoJvcWZiumzyhBDXCjKFi9fbMH9omZle81fUIEspv6meEA61MDA/a4WgclEJVWGO
         dLNviHT7G7F6zXI9XTtD6A085+/KFkW6C6Cv8ImaSxe2wvp0JJA7/lL63OEXDQ9vkSNn
         bkP+aTzJM0Hguw/WbU6962lR97btuueM55WYfAnryOn8I+L9/lDfF2mcs6uezOphPKhj
         sxZGIELUlQA1Esk/GvqPtHlIQem2opcROcE9uN8FHw45lcNCQQa9U1xlfA8o6F/GzpqB
         i9Fg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:subject:to:references:from:message-id:date
         :user-agent:mime-version:in-reply-to;
        bh=fgKNkDoVTD8jDioq//R8jxNjS91VXXRL7EZ4luHoFjU=;
        b=g0Qj2PHMxYqCoqHSxGBTHYnoWQGPnToa2TIdyUDmuHEA4r8NNhf0NGfihXU43SBhqI
         ec7+YvLxMriG3EaNC1xTTCdxfRfab0yFaXx2cBVNBgkPAn/u63mGMARNcr3rRYEnyeZl
         g0jHsZmh0wz1q1ig/0PfXn0QF+DjkoiSOttw3nlLPNcpMzbVk1oAQnw1yKxB9O5Lwrnt
         edoZ78P8paDTc/TgN1qnykuB/7qSXDiPaYohY/PcjEdy03a4MbcabhC4KSCdzRkc2XLP
         qmjAAdD264nQDnZCH7MZ2vsJ0D/llxAaAauK5i6WyfdQT8SPaIhMc1IaBeqmavSXweMj
         vZhg==
X-Gm-Message-State: AOPr4FWzlJkikLLdkH2aJsFifRw7icGJUORQo0CULRAvkxCPyvqgRUDLDKUYzx/zmYtyHA==
X-Received: by 10.28.45.212 with SMTP id t203mr10218942wmt.71.1460823462844;
        Sat, 16 Apr 2016 09:17:42 -0700 (PDT)
Subject: Re: [PATCH] Expose isearch and suffix regions to widgets.
To: zsh-workers@zsh.org
References: <1457905871-2808-1-git-send-email-m0viefreak.cm@googlemail.com>
 <CAH+w=7Z-xQKMoNVK2MeOyj1ND22B8-yceU8FSfCp3xm6kyKEzQ@mail.gmail.com>
 <CAH+w=7a=z+BnQmv027+4+3=KCEGXgtVf7hs+aSp+aVqKLJnebQ@mail.gmail.com>
 <570A50CF.2000600@googlemail.com> <20160411061647.GA5368@tarsus.local2>
 <160411072508.ZM24168@torch.brasslantern.com>
From: m0viefreak <m0viefreak.cm@googlemail.com>
Message-ID: <571265A4.9040000@googlemail.com>
Date: Sat, 16 Apr 2016 18:17:40 +0200
User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:38.0) Gecko/20100101
 Thunderbird/38.7.2
MIME-Version: 1.0
In-Reply-To: <160411072508.ZM24168@torch.brasslantern.com>
Content-Type: multipart/mixed;
 boundary="------------030906080605040206030107"
X-Seq: zsh-workers 38291

--------------030906080605040206030107
Content-Type: text/plain; charset=windows-1252
Content-Transfer-Encoding: 7bit



On 11.04.2016 16:25, Bart Schaefer wrote:
> On Apr 11,  6:16am, Daniel Shahaf wrote:
> } Subject: Re: [PATCH] Expose isearch and suffix regions to widgets.
> }
> } m0viefreak wrote on Sun, Apr 10, 2016 at 15:10:39 +0200:
> } > 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.
> } 
> } Rename the shell parameter, then?
> 
> ISEARCH_MATCH ?  (I wonder if, like $MATCH, it could contain the actual
> matched string, instead of merely being a boolean.)


I think ISEARCH_MATCH would be the ideal name, if the matched string was
exposed, but I haven't found a simple way to do that.

On the other hand, I would also like to keep the _ACTIVE part at the
end, to keep all four of those special parameters named similarly:

{YANK,SUFFIX,REGION,ISEARCH}_ACTIVE

What do you think of ISEARCHMATCH_{ACTIVE,START,END}?

That would still reflect that it's merely a boolean flag, while still
keeping the semantic that it describes the match.


--------------030906080605040206030107
Content-Type: text/plain; charset=UTF-8;
 name="0001-Change-names-of-ISEARCH_-parameters-to-ISEARCHMATCH_.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename*0="0001-Change-names-of-ISEARCH_-parameters-to-ISEARCHMATCH_.pa";
 filename*1="tch"

>From 94705d5f45981552bdf3241dc4b2aaa59a560d94 Mon Sep 17 00:00:00 2001
From: m0viefreak <m0viefreak.cm@googlemail.com>
Date: Sun, 10 Apr 2016 14:57:51 +0200
Subject: [PATCH] Change names of ISEARCH_* parameters to ISEARCHMATCH_*

---
 Doc/Zsh/zle.yo       | 21 +++++++++++----------
 Src/Zle/zle_params.c | 24 ++++++++++++------------
 2 files changed, 23 insertions(+), 22 deletions(-)

diff --git a/Doc/Zsh/zle.yo b/Doc/Zsh/zle.yo
index 161cef7..80d3f39 100644
--- a/Doc/Zsh/zle.yo
+++ b/Doc/Zsh/zle.yo
@@ -835,16 +835,17 @@ which always gives the number of the history line being added to the main
 shell's history.  tt(HISTNO) refers to the line being retrieved within
 zle.
 )
-vindex(ISEARCH_ACTIVE)
-vindex(ISEARCH_START)
-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.
+vindex(ISEARCHMATCH_ACTIVE)
+vindex(ISEARCHMATCH_START)
+vindex(ISEARCHMATCH_END)
+xitem(tt(ISEARCHMATCH_ACTIVE) (integer))
+xitem(tt(ISEARCHMATCH_START) (integer))
+item(tt(ISEARCHMATCH_END) (integer))(
+tt(ISEARCHMATCH_ACTIVE) indicates whether a part of the tt(BUFFER) is
+currently matched by an incremental search pattern. tt(ISEARCHMATCH_START)
+and tt(ISEARCHMATCH_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(ISEARCHMATCH_ACTIVE) is non-zero.
 
 All parameters are read-only.
 )
diff --git a/Src/Zle/zle_params.c b/Src/Zle/zle_params.c
index 7cbb3df..c6387bf 100644
--- a/Src/Zle/zle_params.c
+++ b/Src/Zle/zle_params.c
@@ -103,12 +103,12 @@ static const struct gsu_integer yankend_gsu =
 { get_yankend, set_yankend, zleunsetfn };
 static const struct gsu_integer yankactive_gsu =
 { get_yankactive, NULL, zleunsetfn };
-static const struct gsu_integer isearchstart_gsu =
-{ get_isearchstart, NULL, zleunsetfn };
-static const struct gsu_integer isearchend_gsu =
-{ get_isearchend, NULL, zleunsetfn };
-static const struct gsu_integer isearchactive_gsu =
-{ get_isearchactive, NULL, zleunsetfn };
+static const struct gsu_integer isearchmatchstart_gsu =
+{ get_isearchmatchstart, NULL, zleunsetfn };
+static const struct gsu_integer isearchmatchend_gsu =
+{ get_isearchmatchend, NULL, zleunsetfn };
+static const struct gsu_integer isearchmatchactive_gsu =
+{ get_isearchmatchactive, NULL, zleunsetfn };
 static const struct gsu_integer suffixstart_gsu =
 { get_suffixstart, NULL, zleunsetfn };
 static const struct gsu_integer suffixend_gsu =
@@ -164,9 +164,9 @@ static struct zleparam {
     { "YANK_START", PM_INTEGER, GSU(yankstart_gsu), NULL },
     { "YANK_END", PM_INTEGER, GSU(yankend_gsu), NULL },
     { "YANK_ACTIVE", PM_INTEGER | PM_READONLY, GSU(yankactive_gsu), NULL },
-    { "ISEARCH_START", PM_INTEGER, GSU(isearchstart_gsu), NULL },
-    { "ISEARCH_END", PM_INTEGER, GSU(isearchend_gsu), NULL },
-    { "ISEARCH_ACTIVE", PM_INTEGER | PM_READONLY, GSU(isearchactive_gsu), NULL },
+    { "ISEARCHMATCH_START", PM_INTEGER, GSU(isearchmatchstart_gsu), NULL },
+    { "ISEARCHMATCH_END", PM_INTEGER, GSU(isearchmatchend_gsu), NULL },
+    { "ISEARCHMATCH_ACTIVE", PM_INTEGER | PM_READONLY, GSU(isearchmatchactive_gsu), NULL },
     { "SUFFIX_START", PM_INTEGER, GSU(suffixstart_gsu), NULL },
     { "SUFFIX_END", PM_INTEGER, GSU(suffixend_gsu), NULL },
     { "SUFFIX_ACTIVE", PM_INTEGER | PM_READONLY, GSU(suffixactive_gsu), NULL },
@@ -540,21 +540,21 @@ set_yankend(UNUSED(Param pm), zlong i)
 
 /**/
 static zlong
-get_isearchstart(UNUSED(Param pm))
+get_isearchmatchstart(UNUSED(Param pm))
 {
     return isearch_startpos;
 }
 
 /**/
 static zlong
-get_isearchend(UNUSED(Param pm))
+get_isearchmatchend(UNUSED(Param pm))
 {
     return isearch_endpos;
 }
 
 /**/
 static zlong
-get_isearchactive(UNUSED(Param pm))
+get_isearchmatchactive(UNUSED(Param pm))
 {
     return isearch_active;
 }
-- 
2.8.0


--------------030906080605040206030107--

