GNU bug report logs - #10654
24.0.93; isearch-yank-line moved from C-y

Previous Next

Package: emacs;

Reported by: "Aaron S. Hawley" <aaron.s.hawley <at> gmail.com>

Date: Mon, 30 Jan 2012 15:17:01 UTC

Severity: wishlist

Found in version 24.0.93

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 10654 in the body.
You can then email your comments to 10654 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#10654; Package emacs. (Mon, 30 Jan 2012 15:17:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to "Aaron S. Hawley" <aaron.s.hawley <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 30 Jan 2012 15:17:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: "Aaron S. Hawley" <aaron.s.hawley <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.0.93; isearch-yank-line moved from C-y
Date: Mon, 30 Jan 2012 10:16:06 -0500
I appreciate the new behavior of M-y in Isearch Mode.  I find it more
satisfying, and less frustrating, to be able to access the full kill
ring.

I was surprised that the previously unsatisfying command M-y overwrote
the behavior of C-y in Isearch Mode.  C-y had held the very useful
command of yanking the rest of the line into Isearch.  I eat and
breathe Diff output and line-oriented source code, so I would use the
C-y command often to search similar text or compare text in the buffer
or across buffers.  I use M-x diff or M-x compare-windows but Isearch
Mode can get the job done quicker in some cases.

I don't have any data to support that C-y is popular.  I won't suggest
that the bindings for Isearch Mode are anywhere near sane.  I recall I
was flummoxed by them at first.  The bindings are diabolical for
beginners in most ways, but how did I learn them if they weren't
coherent?  However, the new change is disruptive for existing users of
Emacs and after trying it for two weeks, I can confirm that putting
`isearch-yank-line' to the `M-s C-e' binding is unsatisfying (M-s C-k
makes more sense).  Though, without any data maybe I'm the only person
who uses it and needs a short key binding?

The proposed bindings for 24.1 are:

(define-key isearch-mode-map "\C-y" 'isearch-yank-kill)
(define-key isearch-mode-map "\M-y" 'isearch-yank-pop)
(define-key isearch-mode-map "\M-s\C-e" 'isearch-yank-line)

I'd prefer to revert partially to:

(define-key isearch-mode-map "\C-y" 'isearch-yank-line)
(define-key isearch-mode-map "\M-y" 'isearch-yank-pop)

Or keep the proposed new bindings, but at least give a better binding
than M-s C-e  for the old C-y.  How about the shorter (and obvious)
key binding of C-k?

(define-key isearch-mode-map "\C-y" 'isearch-yank-kill)
(define-key isearch-mode-map "\M-y" 'isearch-yank-pop)
(define-key isearch-mode-map "\C-k" 'isearch-yank-line)

Thanks for Emacs,
aaron

-- 
In general, we reserve the right to have a poor
memory--the computer, however, is supposed to
remember!  Poor computer.  -- Guy Lewis Steele Jr.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#10654; Package emacs. (Mon, 30 Jan 2012 18:55:02 GMT) Full text and rfc822 format available.

Message #8 received at 10654 <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: "Aaron S. Hawley" <aaron.s.hawley <at> gmail.com>
Cc: 10654 <at> debbugs.gnu.org
Subject: Re: bug#10654: 24.0.93; isearch-yank-line moved from C-y
Date: Mon, 30 Jan 2012 13:54:16 -0500
"Aaron S. Hawley" wrote:

> I don't have any data to support that C-y is popular.

The weight of opinion seems to be against you.

http://debbugs.gnu.org/cgi/bugreport.cgi?bug=7700#11
  I've always found the C-y binding in isearch "useless" and
  counter-intuitive. I'd much rather make C-y and M-y behave like they
  do in the minibuffer.

http://debbugs.gnu.org/cgi/bugreport.cgi?bug=8183#5
  While I'm sure there's someone in the world who has a use for
  searching for the entire next line, there are many, many more people
  who find it useful to search for items from the kill ring.

http://lists.gnu.org/archive/html/emacs-devel/2008-11/msg00687.html
  I was reluctant about it in the first place.

> I can confirm that putting `isearch-yank-line' to the `M-s C-e'
> binding is unsatisfying (M-s C-k makes more sense). 

Here is the motivation:
http://lists.gnu.org/archive/html/emacs-devel/2008-11/msg00606.html
   bind `isearch-yank-line' to `M-s C-e' because `move-end-of-line' is
   on `C-e'.

> Though, without any data maybe I'm the only person who uses it and
> needs a short key binding?
[...]
> How about the shorter (and obvious) key binding of C-k?
[...]
> (define-key isearch-mode-map "\C-k" 'isearch-yank-line)

Personally I have no opinion.




Severity set to 'wishlist' from 'normal' Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Mon, 30 Jan 2012 18:56:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#10654; Package emacs. (Mon, 30 Jan 2012 20:20:01 GMT) Full text and rfc822 format available.

Message #13 received at 10654 <at> debbugs.gnu.org (full text, mbox):

From: "Aaron S. Hawley" <aaron.s.hawley <at> gmail.com>
To: Glenn Morris <rgm <at> gnu.org>
Cc: 10654 <at> debbugs.gnu.org
Subject: Re: bug#10654: 24.0.93; isearch-yank-line moved from C-y
Date: Mon, 30 Jan 2012 15:19:29 -0500
On 1/30/12, Glenn Morris <rgm <at> gnu.org> wrote:
> "Aaron S. Hawley" wrote:
>
>> I don't have any data to support that C-y is popular.
>
> The weight of opinion seems to be against you.

This is what I expected.

Thanks for tracking down the threads, Glenn.

It would seem the binding for hitting C-y in Isearch to yank the rest
of the line existed ever since Daniel LaLiberte wrote Isearch 20 years
ago.  I guess its time has come.  This means hitting C-k C-/ C-s C-y
rather than C-s C-y.  I can relinquish that C-y in Isearch wasn't
consistent with global C-y in Emacs, but if word and character yanking
are on C-w and C-M-y, respectively, it seems like line-yanking should
be on a better binding than M-s C-e.

Thanks again,
aaron

> http://debbugs.gnu.org/cgi/bugreport.cgi?bug=7700#11
>   I've always found the C-y binding in isearch "useless" and
>   counter-intuitive. I'd much rather make C-y and M-y behave like they
>   do in the minibuffer.
>
> http://debbugs.gnu.org/cgi/bugreport.cgi?bug=8183#5
>   While I'm sure there's someone in the world who has a use for
>   searching for the entire next line, there are many, many more people
>   who find it useful to search for items from the kill ring.
>
> http://lists.gnu.org/archive/html/emacs-devel/2008-11/msg00687.html
>   I was reluctant about it in the first place.
>
>> I can confirm that putting `isearch-yank-line' to the `M-s C-e'
>> binding is unsatisfying (M-s C-k makes more sense).
>
> Here is the motivation:
> http://lists.gnu.org/archive/html/emacs-devel/2008-11/msg00606.html
>    bind `isearch-yank-line' to `M-s C-e' because `move-end-of-line' is
>    on `C-e'.

-- 
In general, we reserve the right to have a poor
memory--the computer, however, is supposed to
remember!  Poor computer.  -- Guy Lewis Steele Jr.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#10654; Package emacs. (Mon, 30 Jan 2012 23:11:02 GMT) Full text and rfc822 format available.

Message #16 received at 10654 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> jurta.org>
To: "Aaron S. Hawley" <aaron.s.hawley <at> gmail.com>
Cc: 10654 <at> debbugs.gnu.org
Subject: Re: bug#10654: 24.0.93; isearch-yank-line moved from C-y
Date: Tue, 31 Jan 2012 00:59:53 +0200
> (define-key isearch-mode-map "\C-k" 'isearch-yank-line)

To tell the truth, this is exactly what I currently use in .emacs.

`C-k' is a very convenient binding for `isearch-yank-line',
but I hesitated to propose it for adding to isearch.el
because I expect the opposition to that.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#10654; Package emacs. (Fri, 03 Feb 2012 17:49:02 GMT) Full text and rfc822 format available.

Message #19 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Kevin Rodgers <kevin.d.rodgers <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: Re: bug#10654: 24.0.93; isearch-yank-line moved from C-y
Date: Fri, 03 Feb 2012 10:48:29 -0700
On 1/30/12 1:19 PM, Aaron S. Hawley wrote:

> It would seem the binding for hitting C-y in Isearch to yank the rest
> of the line existed ever since Daniel LaLiberte wrote Isearch 20 years
> ago.  I guess its time has come.  This means hitting C-k C-/ C-s C-y
> rather than C-s C-y.  I can relinquish that C-y in Isearch wasn't
> consistent with global C-y in Emacs, but if word and character yanking
> are on C-w and C-M-y, respectively, it seems like line-yanking should
> be on a better binding than M-s C-e.

Or word and character yanking could be bound consistently: M-s M-f and M-s C-f

That approach would be a little less onerous if additional words or characters
could be added to the search string by additional M-f and C-f without prefixing
each with M-s.

-- 
Kevin Rodgers
Denver, Colorado, USA





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#10654; Package emacs. (Sat, 04 Feb 2012 01:07:02 GMT) Full text and rfc822 format available.

Message #22 received at 10654 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> jurta.org>
To: Kevin Rodgers <kevin.d.rodgers <at> gmail.com>
Cc: 10654 <at> debbugs.gnu.org
Subject: Re: bug#10654: 24.0.93; isearch-yank-line moved from C-y
Date: Sat, 04 Feb 2012 02:17:55 +0200
> That approach would be a little less onerous if additional words or characters
> could be added to the search string by additional M-f and C-f without prefixing
> each with M-s.

If `C-k' for `isearch-yank-line' is not under consideration,
then I recommend to allow `M-s C-e C-e C-e ...' in 24.1
because `M-s C-e M-s C-e M-s C-e ...' is unusable.

This can be achieved with the patch below.

Other repeating key sequences `M-s M-f M-f M-f ...' and `M-s C-f C-f C-f ...'
could be implemented as well, but there is no urgent need for them now.

=== modified file 'lisp/isearch.el'
--- lisp/isearch.el	2012-02-01 00:21:17 +0000
+++ lisp/isearch.el	2012-02-04 00:17:07 +0000
@@ -533,6 +533,9 @@ (defvar minibuffer-local-isearch-map
     map)
   "Keymap for editing Isearch strings in the minibuffer.")
 
+(defvar isearch-repeat-key nil)
+(defvar isearch-repeat-command nil)
+
 ;; Internal variables declared globally for byte-compiler.
 ;; These are all set with setq while isearching
 ;; and bound locally while editing the search string.
@@ -1662,6 +1665,8 @@
 (defun isearch-yank-line ()
   "Pull rest of line from buffer into search string."
   (interactive)
+  (setq isearch-repeat-key last-input-event
+	isearch-repeat-command 'isearch-yank-line)
   (isearch-yank-internal
    (lambda () (let ((inhibit-field-text-motion t))
 		(line-end-position (if (eolp) 2 1))))))
@@ -1962,8 +1967,13 @@ (defun isearch-other-meta-char (&optiona
                 (this-command-keys)))
 	 (main-event (aref key 0))
 	 (keylist (listify-key-sequence key))
+	 (repeat-key isearch-repeat-key)
          scroll-command isearch-point)
-    (cond ((and (= (length key) 1)
+    (setq isearch-repeat-key nil)
+    (cond ((and (eq main-event repeat-key) isearch-repeat-command)
+	   (setq isearch-repeat-key main-event)
+	   (command-execute isearch-repeat-command))
+	  ((and (= (length key) 1)
 		(let ((lookup (lookup-key local-function-key-map key)))
 		  (not (or (null lookup) (integerp lookup)
 			   (keymapp lookup)))))





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#10654; Package emacs. (Thu, 27 Jan 2022 16:43:02 GMT) Full text and rfc822 format available.

Message #25 received at 10654 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Glenn Morris <rgm <at> gnu.org>
Cc: 10654 <at> debbugs.gnu.org, "Aaron S. Hawley" <aaron.s.hawley <at> gmail.com>
Subject: Re: bug#10654: 24.0.93; isearch-yank-line moved from C-y
Date: Thu, 27 Jan 2022 17:42:37 +0100
Glenn Morris <rgm <at> gnu.org> writes:

>> I don't have any data to support that C-y is popular.
>
> The weight of opinion seems to be against you.

(I'm going through old bug reports that unfortunately weren't resolved
at the time.)

I think the conclusion here is that we didn't want to change these key
bindings, so I'm closing this bug report.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




bug closed, send any further explanations to 10654 <at> debbugs.gnu.org and "Aaron S. Hawley" <aaron.s.hawley <at> gmail.com> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Thu, 27 Jan 2022 16:43:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 25 Feb 2022 12:24:09 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 53 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.