Tell me more ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

In emacs 24.1, when you do Ctrl-Y in an interactive search, it yanks the kill buffer into the search string ("it pastes the clipboard contents" in any-other-app's language) and tries to match it.

In the last 20 versions or so, pressing Ctrl-Y matches the rest of the current line. I have two very common use cases:

  1. Match this line, revert the buffer, and search for the line

  2. (less often:) Where else is this text in the buffer?

I tried modifying /lisp/isearch.el, switching the bindings for isearch-yank-line (which I want) and isearch-yank-kill (which I'm fine binding to the ridiculous \M-s\C-e key sequence). But I don't think this file even gets picked up. But I don't think this file even gets loaded. If I explicitly load it, I still get the 24.1 behavior.

Here's my change:

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

No change in the behavior. I even tried hacking isearch.el, still no change.

This is on Windows btw, but I suspect it doesn't matter.

Could someone tell me how I can restore the old binding?

share|improve this question

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.