]> git.eshelyaron.com Git - emacs.git/commitdiff
(find-file-noselect): Catch errors in file-expand-wildcards,
authorRichard M. Stallman <rms@gnu.org>
Sat, 11 Sep 1999 21:29:11 +0000 (21:29 +0000)
committerRichard M. Stallman <rms@gnu.org>
Sat, 11 Sep 1999 21:29:11 +0000 (21:29 +0000)
and use the initial argument as file name directly.
Likewise if nothing matches.

lisp/files.el

index 272c901432f012d6fc926df6e0a1ab7a0e14142e..ee56e4d3bf2314e93153ba75add404c3dceac038 100644 (file)
@@ -940,12 +940,14 @@ that are visiting the various files."
             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)))