From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Ergus Newsgroups: gmane.emacs.devel Subject: Re: isearch region or thing at point. Date: Mon, 29 Apr 2019 22:50:03 +0200 Message-ID: <24DC60AF-30A5-434D-B77A-9A01D2E801B2@aol.com> References: <20190427001453.isjx247kc3lu5fe4@Ergus> <87a7gcp51i.fsf@tcd.ie> <20190429004135.rn5tp2gnmbjovrxj@Ergus> <87h8agy4yf.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="----5KRDKB8JPV3JMN36299GZ8LXUC3VTW" Content-Transfer-Encoding: 7bit Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="67609"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: K-9 Mail for Android Cc: "Basil L. Contovounesios" , emacs-devel@gnu.org To: Juri Linkov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Apr 29 22:50:24 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hLDEF-000HQ3-7M for ged-emacs-devel@m.gmane.org; Mon, 29 Apr 2019 22:50:23 +0200 Original-Received: from localhost ([127.0.0.1]:35184 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hLDEE-0001e0-6B for ged-emacs-devel@m.gmane.org; Mon, 29 Apr 2019 16:50:22 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:51899) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hLDE4-0001d3-KX for emacs-devel@gnu.org; Mon, 29 Apr 2019 16:50:13 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hLDE3-0003Rj-6m for emacs-devel@gnu.org; Mon, 29 Apr 2019 16:50:12 -0400 Original-Received: from sonic310-11.consmr.mail.ir2.yahoo.com ([77.238.177.32]:46133) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hLDE2-0003Nq-DV for emacs-devel@gnu.org; Mon, 29 Apr 2019 16:50:11 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aol.com; s=a2048; t=1556571008; bh=nZHeabISSicfR5jtQRTQMw/NWXgzm6KqUkKjOSo3rc4=; h=Date:In-Reply-To:References:Subject:To:From:From:Subject; b=VH+9+1vI4e155EGD8ZA5x8PCiooJN8lOvsLXDT1fKYpYwo2qPRE5C0QEgPnDJhyi3230RDn0fLobCRVmVFrdiyGMxJ20JPV23chjTNdbmketgCbj9hmrhPj0+vDyY5fCRit1iv1F1yyGrFPVWR2QBMLcA3TZEDBkhsLPzcyastCLB7PIXIokVFSfVg2spWY9q5pqAtViQx6BZ4TeK2bgDZRss9SVIs0x1EVHYbER+P6b1RrRsgPLZwEoMG0w2xrXrzYDhABgqxoeTV36fl9GwPIu2RhRJh8ZePXn0bJVLWJE8SjMBt23/sox2xbiWy9M2xkue07V2uhxzmcGTTPOZw== X-YMail-OSG: Yh.LmUEVM1kpW_hrExLV6y9Vdr_CDnn5xFEyXrflIyL6xchbNA7wBjv9RwUt5s8 sQk_CfiIx7LPKPkYqPfIAZfTui8nWVnPaR_jgXbInv1tlcvAlszO40iXK6rj47jNnEGsgxAZcBbf DihZ3vZLLccnbKHC55ZksEhDjtiot_yfXXt7Rqg0CgA8pe5wPhvMVFu9BJyrxWp9PwjBgYbt41sV acPqQ5JNWDK5wr4p2800l6dOih78T_sCfW2FU4ZH5WOZHT.t6FSeG9y8sYYfMbrdh2ZknOglDQ14 HyFc1D_iR.jbe54OpelZ23A_3XkzM0oQfehPvDJ6cdwcYQ2ZxhtZNnoBy7IIl8cyFsyJhbq0LUX9 i9EPszXxqeh84hKS05nyLKleIDGrxmVxUI8DuLUV6M9Cu1LASuIP2wYsPnYArMgtChzOpIGjL.2T 3NWvNZOsBvHxWkokK_gHhsUIK7.5DydN5bpQvf_XgdYDO10GGllg.L4U7PlaosluUpVCXsaAEBOy 9p90ZXnG8Wxq24FmgoDBRW2V_P7_8lYbORekVCP1lH.mGya0A_AJsfNOfaKX69tUvZM7OQpVm4rc ACUQDM2._mSdo6yAFhCpRFxYHu0UWuL7eoJB1yv0gG4VXLg4VLUKjGqQnp5amKalrUpq52HL.vRx sBX8.U1zRzii0jaWLiqxj6BCye4H1_L2_iqBoDyvIojwwZ_ATbBvjOi..eAayHQt2WwqMMGdcQtp 1U6Bw_pfVn0L7Nk80ghI3D9p3W62Ks.TlKIBLDtysAp5pVBULlKlioYH.WMiwZaz_F0D2qXOvncg jOQ5KmTY6BpPN_DMq5xnMG4wDZRpaACX7QZ9btjmhg Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic310.consmr.mail.ir2.yahoo.com with HTTP; Mon, 29 Apr 2019 20:50:08 +0000 Original-Received: from 2.152.205.184.dyn.user.ono.com (EHLO [192.168.1.44]) ([2.152.205.184]) by smtp403.mail.ir2.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID 7a30ee8d606eeb9b86d203717327bd57; Mon, 29 Apr 2019 20:50:07 +0000 (UTC) In-Reply-To: <87h8agy4yf.fsf@mail.linkov.net> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 77.238.177.32 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:236037 Archived-At: ------5KRDKB8JPV3JMN36299GZ8LXUC3VTW Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi Juri: Thanks for replying=2E I will try a different implementation like the one = you suggested=2E But any way, in the previous patch could be easier just add more conditio= ns to filter and keep backward compatibility with the current behaviour=2E = (For example looking if the command just started, or providing the actual r= egion as a hint, look if the command was called interactively, add the extr= a code in the search-forward function only when the region in not empty and= so on=2E I would prefer such solutions to avoid forcing the user to learn = new bindings=2E In fact C-spc + isearch is something I use constantly and I haven't have a= ny issue today=2E But I understand that there should be corner cases I don't know=2E And usu= ally add features that potentially changes any detail in Emacs always finis= h in strong discussions in this mailing list=2E So I prefer to avoid that=2E Very thanks for your reply=2E On April 29, 2019 9:41:28 PM GMT+02:00, Juri Linkov wr= ote: >>>The closest to this that I'm aware of is >>>isearch-forward-symbol-at-point, bound to 'M-s =2E' by default=2E >>> >> I just made a small change in isearch=2Eel to enable region text auto >> insertion in transient-mark-mode=2E (patch attached) >> >> I did it as simple as I could=2E So please if you (or any anyone) could >> give a look and correct/improve/expose corner cases, or suggest a >better >> implementation will be very nice=2E >> >> I don't have corner cases right now, but I just started testing it=2E >> >> So any correction/suggestion/recommendation is very appreciated=2E > >Thanks, such addition is welcome=2E Currently searching the >active region requires invocation of several commands: M-w C-s M-y >with a bad side-effect of leaving the region in the kill-ring=2E > >However, adding a new option is not a satisfactory solution >because often isearch is used to extend the boundaries of the >active region, e=2Eg=2E by setting the region's beginning with C-SPC, >then searching the region's end and exiting isearch there=2E > >Fortunately, like Basil mentioned the command >isearch-forward-symbol-at-point >bound to 'M-s =2E' you could create a similar command bound to e=2Eg=2E '= M-s >r' >that would start isearch with the text from the active region=2E --=20 Enviado desde mi dispositivo Android con K-9 Mail=2E Por favor, disculpa m= i brevedad=2E ------5KRDKB8JPV3JMN36299GZ8LXUC3VTW Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi Juri:

Thanks for replying=2E I will try = a different implementation like the one you suggested=2E

But any wa= y, in the previous patch could be easier just add more conditions to filter= and keep backward compatibility with the current behaviour=2E (For example= looking if the command just started, or providing the actual region as a h= int, look if the command was called interactively, add the extra code in th= e search-forward function only when the region in not empty and so on=2E I = would prefer such solutions to avoid forcing the user to learn new bindings= =2E

In fact C-spc + isearch is something I use constantly and I have= n't have any issue today=2E

But I understand that there should be co= rner cases I don't know=2E And usually add features that potentially change= s any detail in Emacs always finish in strong discussions in this mailing l= ist=2E

So I prefer to avoid that=2E

Very thanks for your repl= y=2E


On April 29, 2019 9:41:28 PM GMT= +02:00, Juri Linkov <juri@linkov=2Enet> wrote:
The closest to this that I'm = aware of is
isearch-forward-symbol-at-point, bound to 'M-s =2E' by defau= lt=2E

I just made a small change in isearch=2Eel to en= able region text auto
insertion in transient-mark-mode=2E (patch attach= ed)

I did it as simple as I could=2E So please if you (or any anyon= e) could
give a look and correct/improve/expose corner cases, or sugges= t a better
implementation will be very nice=2E

I don't have cor= ner cases right now, but I just started testing it=2E

So any correc= tion/suggestion/recommendation is very appreciated=2E

T= hanks, such addition is welcome=2E Currently searching the
active regio= n requires invocation of several commands: M-w C-s M-y
with a bad side-e= ffect of leaving the region in the kill-ring=2E

However, adding a ne= w option is not a satisfactory solution
because often isearch is used to= extend the boundaries of the
active region, e=2Eg=2E by setting the reg= ion's beginning with C-SPC,
then searching the region's end and exiting = isearch there=2E

Fortunately, like Basil mentioned the command isear= ch-forward-symbol-at-point
bound to 'M-s =2E' you could create a similar= command bound to e=2Eg=2E 'M-s r'
that would start isearch with the tex= t from the active region=2E

--
Enviado = desde mi dispositivo Android con K-9 Mail=2E Por favor, disculpa mi breveda= d=2E ------5KRDKB8JPV3JMN36299GZ8LXUC3VTW--