unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@linkov.net>
To: Ergus <spacibba@aol.com>
Cc: "Basil L. Contovounesios" <contovob@tcd.ie>,
	Drew Adams <drew.adams@oracle.com>,
	emacs-devel@gnu.org
Subject: Re: isearch region or thing at point.
Date: Tue, 30 Apr 2019 22:58:44 +0300	[thread overview]
Message-ID: <87k1fbxpg3.fsf@mail.linkov.net> (raw)
In-Reply-To: <20190430165719.yrcvz6oq5ktkyuug@Ergus> (Ergus's message of "Tue,  30 Apr 2019 18:57:19 +0200")

>>> 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.



  reply	other threads:[~2019-04-30 19:58 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-27  0:14 isearch region or thing at point Ergus
2019-04-27  2:15 ` Basil L. Contovounesios
2019-04-29  0:41   ` Ergus
2019-04-29  1:30     ` Ergus
2019-04-29  1:31     ` Ergus
2019-04-29 19:41     ` Juri Linkov
2019-04-29 20:50       ` Ergus
2019-04-30 15:39       ` Drew Adams
2019-04-30 16:57         ` Ergus
2019-04-30 19:58           ` Juri Linkov [this message]
2019-04-30 16:25       ` Ergus
2019-04-30 18:49         ` Noam Postavsky
2019-04-30 19:03           ` Ergus
2019-04-30 19:24             ` Noam Postavsky
2019-04-30 20:05               ` Ergus
2019-04-30 20:38                 ` Noam Postavsky
2019-04-30 22:39         ` Basil L. Contovounesios
2019-04-30 23:16           ` Ergus
2019-04-30 23:33             ` Basil L. Contovounesios
2019-05-01  0:13               ` Ergus
2019-05-01 20:57                 ` Juri Linkov
2019-05-03 16:27                 ` Basil L. Contovounesios
2019-05-01 11:20               ` Ergus
2019-05-01 14:33                 ` Drew Adams
2019-05-01 16:03                   ` Ergus
2019-05-01 16:25                     ` Drew Adams
2019-05-03 16:28                     ` Basil L. Contovounesios
2019-05-04  9:29                     ` Eli Zaretskii
2019-05-03 16:28                 ` Basil L. Contovounesios
2019-05-04  9:26                 ` Eli Zaretskii
2019-05-04 12:15                   ` Ergus
2019-05-04 14:17                     ` Drew Adams
2019-05-04 14:56                       ` Ergus
2019-05-04 15:24                         ` Drew Adams
2019-05-04 21:06                           ` Juri Linkov
2019-05-04 22:40                             ` Drew Adams
2019-05-06 19:41                               ` Juri Linkov
2019-05-07  2:56                                 ` Drew Adams
2019-05-07 19:56                                   ` Ergus

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87k1fbxpg3.fsf@mail.linkov.net \
    --to=juri@linkov.net \
    --cc=contovob@tcd.ie \
    --cc=drew.adams@oracle.com \
    --cc=emacs-devel@gnu.org \
    --cc=spacibba@aol.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).