changeset 25641:952461b8fdaf

(find-file-noselect): Catch errors in file-expand-wildcards, and use the initial argument as file name directly. Likewise if nothing matches.
author Richard M. Stallman <rms@gnu.org>
date Sat, 11 Sep 1999 21:29:11 +0000
parents 69c2d34eb25c
children 556711217681
files lisp/files.el
diffstat 1 files changed, 6 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/files.el	Sat Sep 11 20:42:47 1999 +0000
+++ b/lisp/files.el	Sat Sep 11 21:29:11 1999 +0000
@@ -940,12 +940,14 @@
 	     find-file-wildcards
 	     (not (string-match "\\`/:" filename))
 	     (string-match "[[*?]" filename))
-	(let ((files (file-expand-wildcards filename t))
+	(let ((files (condition-case nil
+			 (file-expand-wildcards filename t)
+		       (error (list filename))))
 	      (find-file-wildcards nil))
 	  (if (null files)
-	      (error "No files match `%s'" filename))
-	  (mapcar #'(lambda (fn) (find-file-noselect fn))
-		  files))
+	      (find-file-noselect filename)
+	    (car (mapcar #'(lambda (fn) (find-file-noselect fn))
+			 files))))
       (let* ((buf (get-file-buffer filename))
 	     (truename (abbreviate-file-name (file-truename filename)))
 	     (number (nthcdr 10 (file-attributes truename)))