files.el:
authorlg <lg@lg-XPS-L521X.(none)>
Fri, 28 Dec 2012 07:01:26 +0000 (11:01 +0400)
committerlg <lg@lg-XPS-L521X.(none)>
Fri, 28 Dec 2012 07:01:26 +0000 (11:01 +0400)
   - Check file existance when openning file with
     `find-file-magic-files-alist'

lisp/files.el

index c200929..c36b101 100644 (file)
@@ -932,7 +932,8 @@ conversion, find-file-hooks, automatic uncompression, etc.
   "Find entry in `find-file-magic-files-alist' that matches FILENAME."
   (find filename find-file-magic-files-alist :key #'car
        :test #'(lambda (fn predicate)
-                 (funcall predicate fn))))
+                  (and (file-exists-p fn)
+                       (funcall predicate fn)))))
 
 (defun find-file-noselect (filename &optional nowarn rawfile)
   "Read file FILENAME into a buffer and return the buffer.