From 4adcd90506e21f051c7160296f686031aa5c8188 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sat, 11 Sep 1999 21:29:11 +0000 Subject: [PATCH] (find-file-noselect): Catch errors in file-expand-wildcards, and use the initial argument as file name directly. Likewise if nothing matches. --- lisp/files.el | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lisp/files.el b/lisp/files.el index 272c901432f..ee56e4d3bf2 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -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))) -- 2.39.5