changeset 106329:1328c6aa3dec

(multi-isearch-read-buffers): Move canonicalization of buffers with `get-buffer' to `multi-isearch-buffers'. (multi-isearch-buffers, multi-isearch-buffers-regexp): Canonicalize BUFFERS with `get-buffer'. Doc fix. (multi-isearch-files, multi-isearch-files-regexp): Canonicalize FILES with `expand-file-name' converting relative file names to absolute. Doc fix. (Bug#4727)
author Juri Linkov <juri@jurta.org>
date Mon, 30 Nov 2009 20:27:44 +0000
parents 5475f1c5e4ed
children e72085f5ccf5
files lisp/ChangeLog lisp/misearch.el
diffstat 2 files changed, 25 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Mon Nov 30 19:42:16 2009 +0000
+++ b/lisp/ChangeLog	Mon Nov 30 20:27:44 2009 +0000
@@ -1,3 +1,13 @@
+2009-11-30  Juri Linkov  <juri@jurta.org>
+
+	* misearch.el (multi-isearch-read-buffers): Move canonicalization
+	of buffers with `get-buffer' to `multi-isearch-buffers'.
+	(multi-isearch-buffers, multi-isearch-buffers-regexp):
+	Canonicalize BUFFERS with `get-buffer'.  Doc fix.
+	(multi-isearch-files, multi-isearch-files-regexp): Canonicalize
+	FILES with `expand-file-name' converting relative file names
+	to absolute.  Doc fix.  (Bug#4727)
+
 2009-11-30  Juri Linkov  <juri@jurta.org>
 
 	* misearch.el (multi-isearch-read-buffers)
--- a/lisp/misearch.el	Mon Nov 30 19:42:16 2009 +0000
+++ b/lisp/misearch.el	Mon Nov 30 20:27:44 2009 +0000
@@ -240,7 +240,7 @@
 		 ""))
       (add-to-list 'bufs buf)
       (setq ido-ignore-item-temp-list bufs))
-    (nreverse (mapcar #'get-buffer bufs))))
+    (nreverse bufs)))
 
 (defun multi-isearch-read-matching-buffers ()
   "Return a list of buffers whose names match specified regexp."
@@ -257,6 +257,7 @@
 ;;;###autoload
 (defun multi-isearch-buffers (buffers)
   "Start multi-buffer Isearch on a list of BUFFERS.
+This list can contain live buffers or their names.
 Interactively read buffer names to search, one by one, ended with RET.
 With a prefix argument, ask for a regexp, and search in buffers
 whose names match the specified regexp."
@@ -266,14 +267,15 @@
 	   (multi-isearch-read-buffers))))
   (let ((multi-isearch-next-buffer-function
 	 'multi-isearch-next-buffer-from-list)
-	(multi-isearch-buffer-list buffers))
-    (switch-to-buffer (car buffers))
+	(multi-isearch-buffer-list (mapcar #'get-buffer buffers)))
+    (switch-to-buffer (car multi-isearch-buffer-list))
     (goto-char (if isearch-forward (point-min) (point-max)))
     (isearch-forward)))
 
 ;;;###autoload
 (defun multi-isearch-buffers-regexp (buffers)
   "Start multi-buffer regexp Isearch on a list of BUFFERS.
+This list can contain live buffers or their names.
 Interactively read buffer names to search, one by one, ended with RET.
 With a prefix argument, ask for a regexp, and search in buffers
 whose names match the specified regexp."
@@ -283,8 +285,8 @@
 	   (multi-isearch-read-buffers))))
   (let ((multi-isearch-next-buffer-function
 	 'multi-isearch-next-buffer-from-list)
-	(multi-isearch-buffer-list buffers))
-    (switch-to-buffer (car buffers))
+	(multi-isearch-buffer-list (mapcar #'get-buffer buffers)))
+    (switch-to-buffer (car multi-isearch-buffer-list))
     (goto-char (if isearch-forward (point-min) (point-max)))
     (isearch-forward-regexp)))
 
@@ -338,6 +340,8 @@
 ;;;###autoload
 (defun multi-isearch-files (files)
   "Start multi-buffer Isearch on a list of FILES.
+Relative file names in this list are expanded to absolute
+file names using the current buffer's value of `default-directory'.
 Interactively read file names to search, one by one, ended with RET.
 With a prefix argument, ask for a wildcard, and search in file buffers
 whose file names match the specified wildcard."
@@ -347,14 +351,16 @@
 	   (multi-isearch-read-files))))
   (let ((multi-isearch-next-buffer-function
 	 'multi-isearch-next-file-buffer-from-list)
-	(multi-isearch-file-list files))
-    (find-file (car files))
+	(multi-isearch-file-list (mapcar #'expand-file-name files)))
+    (find-file (car multi-isearch-file-list))
     (goto-char (if isearch-forward (point-min) (point-max)))
     (isearch-forward)))
 
 ;;;###autoload
 (defun multi-isearch-files-regexp (files)
   "Start multi-buffer regexp Isearch on a list of FILES.
+Relative file names in this list are expanded to absolute
+file names using the current buffer's value of `default-directory'.
 Interactively read file names to search, one by one, ended with RET.
 With a prefix argument, ask for a wildcard, and search in file buffers
 whose file names match the specified wildcard."
@@ -364,8 +370,8 @@
 	   (multi-isearch-read-files))))
   (let ((multi-isearch-next-buffer-function
 	 'multi-isearch-next-file-buffer-from-list)
-	(multi-isearch-file-list files))
-    (find-file (car files))
+	(multi-isearch-file-list (mapcar #'expand-file-name files)))
+    (find-file (car multi-isearch-file-list))
     (goto-char (if isearch-forward (point-min) (point-max)))
     (isearch-forward-regexp)))