From 96fe38a86776bba63590abf82602252ec473853e Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Thu, 2 Apr 2009 21:12:54 +0000 Subject: [PATCH] (doc-view-mode): Don't give up if the file doesn't exist. --- lisp/ChangeLog | 4 ++++ lisp/doc-view.el | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 26064bc4e33..874de7777fc 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2009-04-02 Stefan Monnier + + * doc-view.el (doc-view-mode): Don't give up if the file doesn't exist. + 2009-04-02 Glenn Morris * calendar/diary-lib.el (diary-cyclic): Check for +ve N. diff --git a/lisp/doc-view.el b/lisp/doc-view.el index aca2f65d0f6..ce6a7fd0ba9 100644 --- a/lisp/doc-view.el +++ b/lisp/doc-view.el @@ -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)) -- 2.39.5