aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorLeo Liu2011-05-03 11:34:26 +0800
committerLeo Liu2011-05-03 11:34:26 +0800
commit256661260dfed952d6497aef73607bfe24795614 (patch)
treec39756d27e8698b8c5886716dfeee212756cbbec /lisp
parent1bcace585fbe6d1c6a6c879de861bb2539a29832 (diff)
downloademacs-256661260dfed952d6497aef73607bfe24795614.tar.gz
emacs-256661260dfed952d6497aef73607bfe24795614.zip
New command isearch-yank-pop and bind it to `M-y' in Isearch
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog6
-rw-r--r--lisp/isearch.el16
2 files changed, 21 insertions, 1 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 63fef4f8069..aa9052adfb4 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,9 @@
12011-05-03 Leo Liu <sdl.web@gmail.com>
2
3 * isearch.el (isearch-yank-pop): New command.
4 (isearch-mode-map): bind it to `M-y'.
5 (isearch-forward): Mention it.
6
12011-05-03 Stefan Monnier <monnier@iro.umontreal.ca> 72011-05-03 Stefan Monnier <monnier@iro.umontreal.ca>
2 8
3 * simple.el (minibuffer-complete-shell-command): Remove. 9 * simple.el (minibuffer-complete-shell-command): Remove.
diff --git a/lisp/isearch.el b/lisp/isearch.el
index 1e6ac9c024e..7db7f30dd89 100644
--- a/lisp/isearch.el
+++ b/lisp/isearch.el
@@ -473,7 +473,7 @@ This is like `describe-bindings', but displays only Isearch keys."
473 473
474 (define-key map "\M-n" 'isearch-ring-advance) 474 (define-key map "\M-n" 'isearch-ring-advance)
475 (define-key map "\M-p" 'isearch-ring-retreat) 475 (define-key map "\M-p" 'isearch-ring-retreat)
476 (define-key map "\M-y" 'isearch-yank-kill) 476 (define-key map "\M-y" 'isearch-yank-pop)
477 477
478 (define-key map "\M-\t" 'isearch-complete) 478 (define-key map "\M-\t" 'isearch-complete)
479 479
@@ -637,6 +637,8 @@ Type \\[isearch-yank-char] to yank char from buffer onto end of search\
637Type \\[isearch-yank-line] to yank rest of line onto end of search string\ 637Type \\[isearch-yank-line] to yank rest of line onto end of search string\
638 and search for it. 638 and search for it.
639Type \\[isearch-yank-kill] to yank the last string of killed text. 639Type \\[isearch-yank-kill] to yank the last string of killed text.
640Type \\[isearch-yank-pop] to replace string just yanked into search prompt
641 with string killed before it.
640Type \\[isearch-quote-char] to quote control character to search for it. 642Type \\[isearch-quote-char] to quote control character to search for it.
641\\[isearch-abort] while searching or when search has failed cancels input\ 643\\[isearch-abort] while searching or when search has failed cancels input\
642 back to what has 644 back to what has
@@ -1497,6 +1499,18 @@ If search string is empty, just beep."
1497 (interactive) 1499 (interactive)
1498 (isearch-yank-string (current-kill 0))) 1500 (isearch-yank-string (current-kill 0)))
1499 1501
1502(defun isearch-yank-pop ()
1503 "Replace just-yanked search string with previously killed string."
1504 (interactive)
1505 (if (not (memq last-command '(isearch-yank-kill isearch-yank-pop)))
1506 ;; Fall back on `isearch-yank-kill' for the benefits of people
1507 ;; who are used to the old behavior of `M-y' in isearch mode. In
1508 ;; future, this fallback may be changed if we ever change
1509 ;; `yank-pop' to do something like the kill-ring-browser.
1510 (isearch-yank-kill)
1511 (isearch-pop-state)
1512 (isearch-yank-string (current-kill 1))))
1513
1500(defun isearch-yank-x-selection () 1514(defun isearch-yank-x-selection ()
1501 "Pull current X selection into search string." 1515 "Pull current X selection into search string."
1502 (interactive) 1516 (interactive)