diff options
| author | Leo Liu | 2011-05-03 11:34:26 +0800 |
|---|---|---|
| committer | Leo Liu | 2011-05-03 11:34:26 +0800 |
| commit | 256661260dfed952d6497aef73607bfe24795614 (patch) | |
| tree | c39756d27e8698b8c5886716dfeee212756cbbec | |
| parent | 1bcace585fbe6d1c6a6c879de861bb2539a29832 (diff) | |
| download | emacs-256661260dfed952d6497aef73607bfe24795614.tar.gz emacs-256661260dfed952d6497aef73607bfe24795614.zip | |
New command isearch-yank-pop and bind it to `M-y' in Isearch
| -rw-r--r-- | etc/ChangeLog | 4 | ||||
| -rw-r--r-- | etc/NEWS | 4 | ||||
| -rw-r--r-- | lisp/ChangeLog | 6 | ||||
| -rw-r--r-- | lisp/isearch.el | 16 |
4 files changed, 29 insertions, 1 deletions
diff --git a/etc/ChangeLog b/etc/ChangeLog index f7e40aa2c67..0eb21406105 100644 --- a/etc/ChangeLog +++ b/etc/ChangeLog | |||
| @@ -1,3 +1,7 @@ | |||
| 1 | 2011-05-03 Leo Liu <sdl.web@gmail.com> | ||
| 2 | |||
| 3 | * NEWS: Mention the new command isearch-yank-pop. | ||
| 4 | |||
| 1 | 2011-05-03 Teodor Zlatanov <tzz@lifelogs.com> | 5 | 2011-05-03 Teodor Zlatanov <tzz@lifelogs.com> |
| 2 | 6 | ||
| 3 | * NEWS: Mention new library gnutls.el and explain GnuTLS | 7 | * NEWS: Mention new library gnutls.el and explain GnuTLS |
| @@ -281,6 +281,10 @@ replaced with Lisp commands `doc-file-to-man' and `doc-file-to-info'. | |||
| 281 | *** C-y in Isearch is now bound to isearch-yank-kill, instead of | 281 | *** C-y in Isearch is now bound to isearch-yank-kill, instead of |
| 282 | isearch-yank-line. | 282 | isearch-yank-line. |
| 283 | 283 | ||
| 284 | --- | ||
| 285 | *** M-y in Isearch is now bound to isearch-yank-pop, instead of | ||
| 286 | isearch-yank-kill. | ||
| 287 | |||
| 284 | +++ | 288 | +++ |
| 285 | *** M-s C-e in Isearch is now bound to isearch-yank-line. | 289 | *** M-s C-e in Isearch is now bound to isearch-yank-line. |
| 286 | 290 | ||
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 63fef4f8069..aa9052adfb4 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2011-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 | |||
| 1 | 2011-05-03 Stefan Monnier <monnier@iro.umontreal.ca> | 7 | 2011-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\ | |||
| 637 | Type \\[isearch-yank-line] to yank rest of line onto end of search string\ | 637 | Type \\[isearch-yank-line] to yank rest of line onto end of search string\ |
| 638 | and search for it. | 638 | and search for it. |
| 639 | Type \\[isearch-yank-kill] to yank the last string of killed text. | 639 | Type \\[isearch-yank-kill] to yank the last string of killed text. |
| 640 | Type \\[isearch-yank-pop] to replace string just yanked into search prompt | ||
| 641 | with string killed before it. | ||
| 640 | Type \\[isearch-quote-char] to quote control character to search for it. | 642 | Type \\[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) |