Subject: bug#21663: 25.0.50; isearch-edit-string dont resume multi isearches

From: Tino Calancha <[email-masked]>
Date: Tue, 13 Oct 2015 14:18:25 +0900 (JST)

In previous patch (isearch_3.patch) the variables are not
restored because they were bind to the same symbol name, and
multi-isearch-end will set them to nil.

In addition, multi-isearch-end need to be added again to 
isearch-mode-end-hook, otherwise, even after exiting with C-g, C-s will 
start a multisearch instead of a normal isearch in the current buffer.

See attached patch: isearch_4.patch
diff --git a/lisp/isearch.el b/lisp/isearch.el
index 4fc9b38..617f3e7 100644
--- a/lisp/isearch.el
+++ b/lisp/isearch.el
@@ -1242,6 +1242,15 @@ with-isearch-suspended
 	      (isearch-adjusted isearch-adjusted)
 	      (isearch-yank-flag isearch-yank-flag)
 	      (isearch-error isearch-error)
+              ;; multi isearch variables
+              (is-multi-isearch (or multi-isearch-buffer-list multi-isearch-file-list))
+	      (multi-isearch-file-list-new multi-isearch-file-list)
+	      (multi-isearch-buffer-list-new multi-isearch-buffer-list)
+ 	      (multi-isearch-next-buffer-current-function-new multi-isearch-next-buffer-current-function)
+	      (multi-isearch-current-buffer-new multi-isearch-current-buffer)
+	      (isearch-push-state-function isearch-push-state-function)
+	      (isearch-wrap-function isearch-wrap-function)
+	      (isearch-search-fun-function isearch-search-fun-function)
   ;;; Don't bind this.  We want isearch-search, below, to set it.
   ;;; And the old value won't matter after that.
   ;;;	    (isearch-other-end isearch-other-end)
@@ -1298,12 +1307,17 @@ with-isearch-suspended
 			  nil
 			  isearch-word)
 
+            (when is-multi-isearch (add-hook 'isearch-mode-end-hook  'multi-isearch-end))
 	    ;; Copy new local values to isearch globals
 	    (setq isearch-string isearch-new-string
 		  isearch-message isearch-new-message
 		  isearch-forward isearch-new-forward
 		  isearch-word isearch-new-word
-		  isearch-case-fold-search isearch-new-case-fold))
+		  isearch-case-fold-search isearch-new-case-fold
+                  multi-isearch-file-list multi-isearch-file-list-new
+                  multi-isearch-buffer-list multi-isearch-buffer-list-new
+                  multi-isearch-current-buffer multi-isearch-current-buffer-new
+                  multi-isearch-next-buffer-current-function multi-isearch-next-buffer-current-function-new))
 
 	  ;; Empty isearch-string means use default.
 	  (when (= 0 (length isearch-string))