emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] trunk r112973: * lisp/isearch.el (isearch-del-char): Don't


From: Juri Linkov
Subject: [Emacs-diffs] trunk r112973: * lisp/isearch.el (isearch-del-char): Don't exceed the length of `isearch-string'
Date: Thu, 13 Jun 2013 21:11:46 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 112973
revision-id: address@hidden
parent: address@hidden
fixes bug: http://debbugs.gnu.org/14563
committer: Juri Linkov <address@hidden>
branch nick: trunk
timestamp: Fri 2013-06-14 00:11:42 +0300
message:
  * lisp/isearch.el (isearch-del-char): Don't exceed the length of 
`isearch-string'
  by the prefix arg.
modified:
  lisp/ChangeLog                 changelog-20091113204419-o5vbwnq5f7feedwu-1432
  lisp/isearch.el                isearch.el-20091113204419-o5vbwnq5f7feedwu-486
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2013-06-13 20:50:51 +0000
+++ b/lisp/ChangeLog    2013-06-13 21:11:42 +0000
@@ -1,5 +1,10 @@
 2013-06-13  Juri Linkov  <address@hidden>
 
+       * isearch.el (isearch-del-char): Don't exceed the length of
+       `isearch-string' by the prefix arg.  (Bug#14563)
+
+2013-06-13  Juri Linkov  <address@hidden>
+
        * isearch.el (isearch-yank-word, isearch-yank-line)
        (isearch-char-by-name, isearch-quote-char)
        (isearch-printing-char, isearch-process-search-char):

=== modified file 'lisp/isearch.el'
--- a/lisp/isearch.el   2013-06-13 20:50:51 +0000
+++ b/lisp/isearch.el   2013-06-13 21:11:42 +0000
@@ -1815,11 +1815,17 @@
   (interactive "p")
   (if (= 0 (length isearch-string))
       (ding)
-    (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))
   (isearch-search)
   (isearch-push-state)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]