Commit 96fe38a8 authored by Stefan Monnier's avatar Stefan Monnier
Browse files

(doc-view-mode): Don't give up if the file doesn't exist.

parent 6133a1a9
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.
......
......@@ -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))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment