[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: isearch region or thing at point.

From: Juri Linkov
Subject: Re: isearch region or thing at point.
Date: Tue, 30 Apr 2019 22:58:44 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu)

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

reply via email to

[Prev in Thread] Current Thread [Next in Thread]