From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.devel Subject: Re: isearch region or thing at point. Date: Tue, 30 Apr 2019 22:58:44 +0300 Organization: LINKOV.NET Message-ID: <87k1fbxpg3.fsf@mail.linkov.net> References: <20190427001453.isjx247kc3lu5fe4@Ergus> <87a7gcp51i.fsf@tcd.ie> <20190429004135.rn5tp2gnmbjovrxj@Ergus> <87h8agy4yf.fsf@mail.linkov.net> <20190430165719.yrcvz6oq5ktkyuug@Ergus> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="64467"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) Cc: "Basil L. Contovounesios" , Drew Adams , emacs-devel@gnu.org To: Ergus Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Apr 30 22:49:56 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 1hLZhL-000GeS-Rr for ged-emacs-devel@m.gmane.org; Tue, 30 Apr 2019 22:49:56 +0200 Original-Received: from localhost ([127.0.0.1]:53172 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hLZhK-0003Vy-PR for ged-emacs-devel@m.gmane.org; Tue, 30 Apr 2019 16:49:54 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:53024) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hLZVZ-0002ST-3I for emacs-devel@gnu.org; Tue, 30 Apr 2019 16:37:46 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hLZHi-0004c1-N9 for emacs-devel@gnu.org; Tue, 30 Apr 2019 16:23:27 -0400 Original-Received: from cichlid.maple.relay.mailchannels.net ([23.83.214.36]:62830) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hLZHi-0004bF-8F for emacs-devel@gnu.org; Tue, 30 Apr 2019 16:23:26 -0400 X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Original-Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id E19935E27EF; Tue, 30 Apr 2019 20:23:21 +0000 (UTC) Original-Received: from pdx1-sub0-mail-a81.g.dreamhost.com (100-96-2-149.trex.outbound.svc.cluster.local [100.96.2.149]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id CFB235E2B35; Tue, 30 Apr 2019 20:23:20 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Original-Received: from pdx1-sub0-mail-a81.g.dreamhost.com ([TEMPUNAVAIL]. [64.90.62.162]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.17.2); Tue, 30 Apr 2019 20:23:21 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jurta@jurta.org X-MailChannels-Auth-Id: dreamhost X-Illustrious-Tank: 2a26479b70dcabbd_1556655801564_3133792152 X-MC-Loop-Signature: 1556655801564:179876456 X-MC-Ingress-Time: 1556655801564 Original-Received: from pdx1-sub0-mail-a81.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a81.g.dreamhost.com (Postfix) with ESMTP id C64CF7F9A8; Tue, 30 Apr 2019 13:23:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=linkov.net; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=linkov.net; bh=u53h1kY+7GEVdoBFRpDpef/nYbI=; b= lHIfAM//Wf3hEQtBd7BzgxHXEkCfa45FRAM1zK0A7W4UDp1M17mF2vdhbKEuf+FZ fc4RV/SiuHnHZXASi7JxM0Oz4PllaiHX7JIA291bf4mD/QCnmJ4sC+sEI5YvXHgp RsgNqfWs7FakMJ//oGCQYIdF4wn4uRoi98+jcEGnq7U= Original-Received: from mail.jurta.org (m91-129-107-198.cust.tele2.ee [91.129.107.198]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by pdx1-sub0-mail-a81.g.dreamhost.com (Postfix) with ESMTPSA id AD9627F9AE; Tue, 30 Apr 2019 13:23:13 -0700 (PDT) X-DH-BACKEND: pdx1-sub0-mail-a81 In-Reply-To: <20190430165719.yrcvz6oq5ktkyuug@Ergus> (Ergus's message of "Tue, 30 Apr 2019 18:57:19 +0200") X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: -100 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgeduuddrieehgdeklecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucggtfgfnhhsuhgsshgtrhhisggvpdfftffgtefojffquffvnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvffuohhfffgjkfgfgggtsehttdertddtredtnecuhfhrohhmpefluhhrihcunfhinhhkohhvuceojhhurhhisehlihhnkhhovhdrnhgvtheqnecukfhppeeluddruddvledruddtjedrudelkeenucfrrghrrghmpehmohguvgepshhmthhppdhhvghlohepmhgrihhlrdhjuhhrthgrrdhorhhgpdhinhgvthepledurdduvdelrddutdejrdduleekpdhrvghtuhhrnhdqphgrthhhpefluhhrihcunfhinhhkohhvuceojhhurhhisehlihhnkhhovhdrnhgvtheqpdhmrghilhhfrhhomhepjhhurhhisehlihhnkhhovhdrnhgvthdpnhhrtghpthhtohepshhprggtihgssggrsegrohhlrdgtohhmnecuvehluhhsthgvrhfuihiivgeptd X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 23.83.214.36 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:236073 Archived-At: >>> But any way, in the previous patch could be easier just add more >>> conditions to filter and keep backward compatibility with the current >>> behaviour. (For example looking if the command just started, or providing >>> the actual region as a hint, look if the command was called interactively, >>> add the extra code in the search-forward function only when the region in >>> not empty and so on. I would prefer such solutions to avoid forcing the >>> user to learn new bindings. I can't come up with a heuristic rule that would guess the user's intention to use the text from the active region as the search string. >>2. It's already simple to search for the region text, as >> Juri points out: `M-w C-s M-y'. And as he says, you >> can easily define a command that does that from the >> outset. > > Of course the user could write anything, but this is a simple basic > functionality available in gedit, geany, vim, qtcreator... but also in > firefox, chromium, and so on... So, there is not any reason why emacs > will provide no "easy" way to enable/access it somehow. > > Specially for the detail that we don't disable the region after the > search was canceled. That's a more intuitive behavior. Firefox and gedit start the search with the selection text, but also they move the selection to the next search hit (I doubt the usefulness of the latter feature). > Actually I am only considering the option of adding a new function and > bind it to M-s r. We already have a similar key 'M-s M-w' to search the text from the active region in the web browser. So maybe a better mnemonic key for your proposed feature would be 'M-s M-y'. > Or add a C-something like isearch-yank-word-or-char. This is another possibility indeed, with a new command e.g. isearch-yank-region.