[Top][All Lists]

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

bug#39512: 28.0.50; Add command isearch-yank-region

From: Juri Linkov
Subject: bug#39512: 28.0.50; Add command isearch-yank-region
Date: Mon, 10 Feb 2020 02:45:17 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu)

> I have added global keybinding `M-s M-.' for my `isearch-yank-region'.


> `isearch-yank-kill' and `isearch-yank-region' are good names for the
> use case of calling them once we are in an interactive search.
> The names are not any good for the use case of calling them directly
> (from a global keybinding).  We might want:
> 1. aliases `isearch-forward-kill', `isearch-forward-region'

Aliases might add more confusion and make impression that
these are separate commands when displayed in a list of isearch commands,
e.g. in completion list, in documentation.

> 2. restrict the use of them for just inside the interactive search, and
>    define the new commands (`isearch-forward-kill',`isearch-forward-region')
>    as those calling `isearch-mode' at the beginning.

Restricting would be worse.

So maybe `isearch-yank-kill' and `isearch-yank-region' still are
not too bad names to use as entry points to enable isearch mode.

> +    (define-key map    "\M-." 'isearch-yank-region)

Some doubts are about `M-.' - what if some users might want to use `M-.'
to exit isearch and run its global binding `xref-find-definitions'
on the found symbol?  Maybe better to bind `isearch-yank-region'
to `M-s M-.' in isearch-mode too?

> I have some advice in that function that lets me call it with no arguments.

Maybe a new function could be added as a wrapper around
`(funcall region-extract-function)' and with its argument optional.

reply via email to

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