]> git.eshelyaron.com Git - emacs.git/commitdiff
(isearch-edit-string): Remove one call to
authorJuri Linkov <juri@jurta.org>
Fri, 14 Mar 2008 01:02:45 +0000 (01:02 +0000)
committerJuri Linkov <juri@jurta.org>
Fri, 14 Mar 2008 01:02:45 +0000 (01:02 +0000)
`isearch-push-state' not to push an inconsistent state,
but keep another correct call to `isearch-push-state'.
(isearch-ring-adjust): Call `isearch-push-state' only when
`search-ring-update' is non-nil since `isearch-edit-string'
already pushes its state.
(isearch-message): Improve matching the failed part by checking
if the original message starts with the last successful message.

lisp/ChangeLog
lisp/isearch.el

index 93edc4addcd65ad1f368890bd604b0844ad57ac9..75913bef6c4f63b3846b1cca8cab2d9808aaf417 100644 (file)
@@ -1,3 +1,23 @@
+2008-03-14  Juri Linkov  <juri@jurta.org>
+
+       * isearch.el (isearch-edit-string): Remove one call to
+       `isearch-push-state' not to push an inconsistent state,
+       but keep another correct call to `isearch-push-state'.
+       (isearch-ring-adjust): Call `isearch-push-state' only when
+       `search-ring-update' is non-nil since `isearch-edit-string'
+       already pushes its state.
+       (isearch-message): Improve matching the failed part by checking
+       if the original message starts with the last successful message.
+
+       * dired.el (dired-warn-writable): Rename to `dired-perm-write'.
+       (dired-perm-write): Renamed from `dired-warn-writable'.
+       Change parent face from `font-lock-warning-face' to
+       `font-lock-comment-delimiter-face'.
+       (dired-warn-writable-face): Rename to `dired-perm-write-face'.
+       (dired-perm-write-face): Renamed from `dired-warn-writable-face'.
+       (dired-font-lock-keywords): Replace `dired-warn-writable-face'
+       with `dired-perm-write-face'.
+
 2008-03-13  Tassilo Horn  <tassilo@member.fsf.org>
 
        * doc-view.el (doc-view-doc->txt, doc-view-convert-current-doc):
index 750ed129b7e02dfcdf00006c7f6b2e4571db0d17..c115193d394d18c6392fb9c0782e9e149fc5b068 100644 (file)
@@ -1096,12 +1096,15 @@ If first char entered is \\[isearch-yank-word-or-char], then do word search inst
            ;; Only the string actually used should be saved.
            ))
 
-       ;; Push the state as of before this C-s.
-       (isearch-push-state)
+       ;; This used to push the state as of before this C-s, but it adds
+       ;; an inconsistent state where part of variables are from the
+       ;; previous search (e.g. `isearch-success'), and part of variables
+       ;; are just entered from the minibuffer (e.g. `isearch-string').
+       ;; (isearch-push-state)
 
        ;; Reinvoke the pending search.
        (isearch-search)
-       (isearch-push-state)
+       (isearch-push-state)            ; this pushes the correct state
        (isearch-update)
        (if isearch-nonincremental
            (progn
@@ -1895,10 +1898,12 @@ Isearch mode."
   (if search-ring-update
       (progn
        (isearch-search)
+       (isearch-push-state)
        (isearch-update))
-    (isearch-edit-string)
-    )
-  (isearch-push-state))
+    ;; Otherwise, edit the search string instead.  Note that there is
+    ;; no need to push the search state after isearch-edit-string here
+    ;; since isearch-edit-string already pushes its state
+    (isearch-edit-string)))
 
 (defun isearch-ring-advance ()
   "Advance to the next search string in the ring."
@@ -1975,9 +1980,13 @@ If there is no completion possible, say so and continue searching."
        (pop cmds))
       (setq succ-msg (and cmds (isearch-message-state (car cmds)))
            m (copy-sequence m))
-      (when (and (stringp succ-msg) (< (length succ-msg) (length m)))
-       (add-text-properties (length succ-msg) (length m)
-                            '(face isearch-fail) m))
+      (add-text-properties
+       (if (and (stringp succ-msg)
+               (< (length succ-msg) (length m))
+               (equal succ-msg (substring m 0 (length succ-msg))))
+          (length succ-msg)
+        0)
+       (length m) '(face isearch-fail) m)
       ;; Highlight failed trailing whitespace
       (when (string-match " +$" m)
        (add-text-properties (match-beginning 0) (match-end 0)