]> code.delx.au - gnu-emacs/blobdiff - lisp/misearch.el
defun fix for cl declarations + interactive forms
[gnu-emacs] / lisp / misearch.el
index c533562f0730a6e7021200bb67157d2077ccdac1..2584f8df77b72e75ed33ea87c43d0ab25ec117c5 100644 (file)
@@ -1,6 +1,6 @@
 ;;; misearch.el --- isearch extensions for multi-buffer search
 
-;; Copyright (C) 2007-201 Free Software Foundation, Inc.
+;; Copyright (C) 2007-2013 Free Software Foundation, Inc.
 
 ;; Author: Juri Linkov <juri@jurta.org>
 ;; Keywords: matching
@@ -130,19 +130,13 @@ Intended to be added to `isearch-mode-hook'."
   (lambda (string bound noerror)
     (let ((search-fun
           ;; Use standard functions to search within one buffer
-          (cond
-           (isearch-word
-            (if isearch-forward 'word-search-forward 'word-search-backward))
-           (isearch-regexp
-            (if isearch-forward 're-search-forward 're-search-backward))
-           (t
-            (if isearch-forward 'search-forward 'search-backward))))
+          (isearch-search-fun-default))
          found buffer)
       (or
        ;; 1. First try searching in the initial buffer
        (let ((res (funcall search-fun string bound noerror)))
         ;; Reset wrapping for all-buffers pause after successful search
-        (if (and res (eq multi-isearch-pause t))
+        (if (and res (not bound) (eq multi-isearch-pause t))
             (setq multi-isearch-current-buffer nil))
         res)
        ;; 2. If the above search fails, start visiting next/prev buffers
@@ -173,8 +167,8 @@ Intended to be added to `isearch-mode-hook'."
                   found)
               ;; Return nil when multi-isearch-next-buffer-current-function fails
               ;; (`with-current-buffer' raises an error for nil returned from it).
-              (error nil))
-          (signal 'search-failed (list string "Repeat for next buffer"))))))))
+              (error (signal 'search-failed (list string "end of multi"))))
+          (signal 'search-failed (list string "repeat for next buffer"))))))))
 
 (defun multi-isearch-wrap ()
   "Wrap the multiple buffers search when search is failed.
@@ -379,5 +373,5 @@ whose file names match the specified wildcard."
 
 \f
 (provide 'multi-isearch)
-
+(provide 'misearch)
 ;;; misearch.el ends here