(doc-view-mode): Don't give up if the file doesn't exist.
authorStefan Monnier <monnier@iro.umontreal.ca>
Thu, 2 Apr 2009 21:12:54 +0000 (21:12 +0000)
committerStefan Monnier <monnier@iro.umontreal.ca>
Thu, 2 Apr 2009 21:12:54 +0000 (21:12 +0000)
lisp/ChangeLog
lisp/doc-view.el

index 26064bc..874de77 100644 (file)
@@ -1,3 +1,7 @@
+2009-04-02  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * doc-view.el (doc-view-mode): Don't give up if the file doesn't exist.
+
 2009-04-02  Glenn Morris  <rgm@gnu.org>
 
        * calendar/diary-lib.el (diary-cyclic): Check for +ve N.
index aca2f65..ce6a7fd 100644 (file)
@@ -1121,10 +1121,10 @@ toggle between displaying the document or editing it as text.
 \\{doc-view-mode-map}"
   (interactive)
 
-  (if (or (not (file-exists-p buffer-file-name))
-         (= (point-min) (point-max)))
+  (if (= (point-min) (point-max))
       ;; The doc is empty or doesn't exist at all, so fallback to
-      ;; another mode.
+      ;; another mode.  We used to also check file-exists-p, but this
+      ;; returns nil for tar members.
       (let ((auto-mode-alist (remq (rassq 'doc-view-mode auto-mode-alist)
                                   auto-mode-alist)))
        (normal-mode))