Commit cb89acab authored by Juri Linkov's avatar Juri Linkov
Browse files

* lisp/isearch.el (isearch-del-char): Don't exceed the length of `isearch-string'

by the prefix arg.

Fixes: debbugs:14563
parent 6e8cfc81
2013-06-13 Juri Linkov <>
* isearch.el (isearch-del-char): Don't exceed the length of
`isearch-string' by the prefix arg. (Bug#14563)
2013-06-13 Juri Linkov <>
* isearch.el (isearch-yank-word, isearch-yank-line)
......@@ -1815,11 +1815,17 @@ If search string is empty, just beep."
(interactive "p")
(if (= 0 (length isearch-string))
(setq isearch-string (substring isearch-string 0 (- (or arg 1)))
(setq isearch-string (substring isearch-string 0
(- (min (or arg 1)
(length isearch-string))))
isearch-message (mapconcat 'isearch-text-char-description
isearch-string "")))
;; Use the isearch-other-end as new starting point to be able
;; to find the remaining part of the search string again.
;; This is like what `isearch-search-and-update' does,
;; but currently it doesn't support deletion of characters
;; for the case where unsuccessful search may become successful
;; by deletion of characters.
(if isearch-other-end (goto-char isearch-other-end))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment