Subject: bug#7700: 24.0.50; C-y binding withing Isearch mode

From: "Drew Adams" <[email-masked]>
Date: Thu, 23 Dec 2010 14:28:47 -0800

> Yes, but you've got to suggest one!  Maybe C-M-y for "grab to 
> next line end".  That's an unused binding, similar to the
> existing C-y, and lends itself to easy repetition.

It's unused by vanilla Emacs, but I use it. ;-)

No, that's not a great argument to convince the Vanillafold.  But here it is:

I bind `C-M-y' globally to a command that yanks the secondary selection.  (I
also use `C-M-' as the prefix for selecting the secondary.)

And in Isearch I bind `C-M-y' to a command that does the same thing for Isearch.
IOW, it does for the secondary selection just what `M-y' (soon to be `C-y'?)
does for the last kill: it yanks the secondary selection into the search string.

(I cannot understand that others don't bind any keyboard key to yank the
secondary selection, except in so far as they never use the secondary selection.
I use it all the time, including in Isearch.  And the logical binding for it
(for me) is `C-M-y'.)

So in vanilla Emacs too I'd rather see `C-M-y' yank the secondary than yank the
rest of the line.

---

Wrt suggesting some other binding for yanking the rest of the line:

Alan's `C-u C-l' thingy exempts `C-u' from its normal role of exiting Isearch,
_if_ the user customizes `isearch-allow-scroll' to allow it.

The dispensation of `C-u' from exiting is here amalgamated with the choice to
allow scrolling via `C-l'.  The two choices could instead be separated.

IOW, we could have a separate option, `isearch-C-u-exits' (default t), that if
nil exempts `C-u' from exiting in _all_ cases, allowing it to be used in other
ways than just for scrolling.

That's presumably what Alan had in mind when he said:

  C-u is potentially useable by an isearch command
  (including a "scrolling" command)

In that case (`isearch-C-u-exits' = nil, so `C-u' does not exit), we could come
back to my suggestion of letting `C-u C-y' do what `C-y' does now: insert the
rest of the current line.

Yes, that would mean that only users who chose to give up exiting Isearch via
`C-u' could use `C-u C-y' to yank the rest of the line.  Just as, today, only
users who choose to give up exiting via `C-u' can use `C-u C-l' for scrolling
during Isearch.

The other alternative about `C-u' would be, as I mentioned earlier, to just
sacrifice its exiting behavior altogether (no user option).

---

As I mentioned earlier, we are now doing design, and this discussion really
belongs in emacs-devel, IMO.