diff options
| author | Juri Linkov | 2013-06-14 00:11:42 +0300 |
|---|---|---|
| committer | Juri Linkov | 2013-06-14 00:11:42 +0300 |
| commit | cb89acab6cdfa418d1d14ad3200712e1dd406673 (patch) | |
| tree | a592f3b158e038a6a2149964ebfd9790810cd017 | |
| parent | 6e8cfc81e747bef8edd1f5df2c25b6a00c766a03 (diff) | |
| download | emacs-cb89acab6cdfa418d1d14ad3200712e1dd406673.tar.gz emacs-cb89acab6cdfa418d1d14ad3200712e1dd406673.zip | |
* lisp/isearch.el (isearch-del-char): Don't exceed the length of `isearch-string'
by the prefix arg.
Fixes: debbugs:14563
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/isearch.el | 8 |
2 files changed, 12 insertions, 1 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 974fad3e306..f21f6e4b068 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,5 +1,10 @@ | |||
| 1 | 2013-06-13 Juri Linkov <juri@jurta.org> | 1 | 2013-06-13 Juri Linkov <juri@jurta.org> |
| 2 | 2 | ||
| 3 | * isearch.el (isearch-del-char): Don't exceed the length of | ||
| 4 | `isearch-string' by the prefix arg. (Bug#14563) | ||
| 5 | |||
| 6 | 2013-06-13 Juri Linkov <juri@jurta.org> | ||
| 7 | |||
| 3 | * isearch.el (isearch-yank-word, isearch-yank-line) | 8 | * isearch.el (isearch-yank-word, isearch-yank-line) |
| 4 | (isearch-char-by-name, isearch-quote-char) | 9 | (isearch-char-by-name, isearch-quote-char) |
| 5 | (isearch-printing-char, isearch-process-search-char): | 10 | (isearch-printing-char, isearch-process-search-char): |
diff --git a/lisp/isearch.el b/lisp/isearch.el index 4754f86d5d7..ddb5ba9331c 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el | |||
| @@ -1815,11 +1815,17 @@ If search string is empty, just beep." | |||
| 1815 | (interactive "p") | 1815 | (interactive "p") |
| 1816 | (if (= 0 (length isearch-string)) | 1816 | (if (= 0 (length isearch-string)) |
| 1817 | (ding) | 1817 | (ding) |
| 1818 | (setq isearch-string (substring isearch-string 0 (- (or arg 1))) | 1818 | (setq isearch-string (substring isearch-string 0 |
| 1819 | (- (min (or arg 1) | ||
| 1820 | (length isearch-string)))) | ||
| 1819 | isearch-message (mapconcat 'isearch-text-char-description | 1821 | isearch-message (mapconcat 'isearch-text-char-description |
| 1820 | isearch-string ""))) | 1822 | isearch-string ""))) |
| 1821 | ;; Use the isearch-other-end as new starting point to be able | 1823 | ;; Use the isearch-other-end as new starting point to be able |
| 1822 | ;; to find the remaining part of the search string again. | 1824 | ;; to find the remaining part of the search string again. |
| 1825 | ;; This is like what `isearch-search-and-update' does, | ||
| 1826 | ;; but currently it doesn't support deletion of characters | ||
| 1827 | ;; for the case where unsuccessful search may become successful | ||
| 1828 | ;; by deletion of characters. | ||
| 1823 | (if isearch-other-end (goto-char isearch-other-end)) | 1829 | (if isearch-other-end (goto-char isearch-other-end)) |
| 1824 | (isearch-search) | 1830 | (isearch-search) |
| 1825 | (isearch-push-state) | 1831 | (isearch-push-state) |