diff options
| author | Le Wang | 2013-12-18 11:02:39 +0800 |
|---|---|---|
| committer | Chong Yidong | 2013-12-18 11:02:39 +0800 |
| commit | e82134b1e4efb363e21b1f9103af7ee5ec885ce4 (patch) | |
| tree | 1b59f01232e7f4c223172f162b85757471dd6341 | |
| parent | 33f5d4c15aa65576ff7f2ee62553280f9f92343c (diff) | |
| download | emacs-e82134b1e4efb363e21b1f9103af7ee5ec885ce4.tar.gz emacs-e82134b1e4efb363e21b1f9103af7ee5ec885ce4.zip | |
* comint.el (comint-previous-matching-input-from-input): Retain point.
Fixes: debbugs:13404
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/comint.el | 12 |
2 files changed, 12 insertions, 5 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 3a86fff5e50..126f10ae79b 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2013-12-18 Le Wang <l26wang@gmail.com> | ||
| 2 | |||
| 3 | * comint.el (comint-previous-matching-input-from-input): Retain | ||
| 4 | point (Bug#13404). | ||
| 5 | |||
| 1 | 2013-12-18 Chong Yidong <cyd@gnu.org> | 6 | 2013-12-18 Chong Yidong <cyd@gnu.org> |
| 2 | 7 | ||
| 3 | * simple.el (append-next-kill): Doc fix (Bug#15995, Bug#16016). | 8 | * simple.el (append-next-kill): Doc fix (Bug#15995, Bug#16016). |
diff --git a/lisp/comint.el b/lisp/comint.el index e7dff585b68..5cdec45650d 100644 --- a/lisp/comint.el +++ b/lisp/comint.el | |||
| @@ -1210,8 +1210,9 @@ If N is negative, find the previous or Nth previous match." | |||
| 1210 | With prefix argument N, search for Nth previous match. | 1210 | With prefix argument N, search for Nth previous match. |
| 1211 | If N is negative, search forwards for the -Nth following match." | 1211 | If N is negative, search forwards for the -Nth following match." |
| 1212 | (interactive "p") | 1212 | (interactive "p") |
| 1213 | (if (not (memq last-command '(comint-previous-matching-input-from-input | 1213 | (let ((opoint (point))) |
| 1214 | comint-next-matching-input-from-input))) | 1214 | (unless (memq last-command '(comint-previous-matching-input-from-input |
| 1215 | comint-next-matching-input-from-input)) | ||
| 1215 | ;; Starting a new search | 1216 | ;; Starting a new search |
| 1216 | (setq comint-matching-input-from-input-string | 1217 | (setq comint-matching-input-from-input-string |
| 1217 | (buffer-substring | 1218 | (buffer-substring |
| @@ -1219,9 +1220,10 @@ If N is negative, search forwards for the -Nth following match." | |||
| 1219 | (process-mark (get-buffer-process (current-buffer)))) | 1220 | (process-mark (get-buffer-process (current-buffer)))) |
| 1220 | (point)) | 1221 | (point)) |
| 1221 | comint-input-ring-index nil)) | 1222 | comint-input-ring-index nil)) |
| 1222 | (comint-previous-matching-input | 1223 | (comint-previous-matching-input |
| 1223 | (concat "^" (regexp-quote comint-matching-input-from-input-string)) | 1224 | (concat "^" (regexp-quote comint-matching-input-from-input-string)) |
| 1224 | n)) | 1225 | n) |
| 1226 | (goto-char opoint))) | ||
| 1225 | 1227 | ||
| 1226 | (defun comint-next-matching-input-from-input (n) | 1228 | (defun comint-next-matching-input-from-input (n) |
| 1227 | "Search forwards through input history for match for current input. | 1229 | "Search forwards through input history for match for current input. |