[Top][All Lists]

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

Re: isearch region or thing at point.

From: Ergus
Subject: Re: isearch region or thing at point.
Date: Mon, 29 Apr 2019 22:50:03 +0200
User-agent: K-9 Mail for Android

Hi Juri:

Thanks for replying. I will try a different implementation like the one you suggested.

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.

In fact C-spc + isearch is something I use constantly and I haven't have any issue today.

But I understand that there should be corner cases I don't know. And usually add features that potentially changes any detail in Emacs always finish in strong discussions in this mailing list.

So I prefer to avoid that.

Very thanks for your reply.

On April 29, 2019 9:41:28 PM GMT+02:00, Juri Linkov <address@hidden> wrote:
The closest to this that I'm aware of is
isearch-forward-symbol-at-point, bound to 'M-s .' by default.

I just made a small change in isearch.el to enable region text auto
insertion in transient-mark-mode. (patch attached)

I did it as simple as I could. 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.

I don't have corner cases right now, but I just started testing it.

So any correction/suggestion/recommendation is very appreciated.

Thanks, such addition is welcome. 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.

However, adding a new option is not a satisfactory solution
because often isearch is used to extend the boundaries of the
active region, e.g. by setting the region's beginning with C-SPC,
then searching the region's end and exiting isearch there.

Fortunately, like Basil mentioned the command isearch-forward-symbol-at-point
bound to 'M-s .' you could create a similar command bound to e.g. 'M-s r'
that would start isearch with the text from the active region.

Enviado desde mi dispositivo Android con K-9 Mail. Por favor, disculpa mi brevedad.
reply via email to

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