summaryrefslogtreecommitdiff
path: root/lisp/doc-view.el
diff options
context:
space:
mode:
authorTassilo Horn <tassilo@member.fsf.org>2009-01-28 20:33:44 +0000
committerTassilo Horn <tassilo@member.fsf.org>2009-01-28 20:33:44 +0000
commit856997723b8fb75e10aafebfb2c170b291bfe881 (patch)
treea186b63f20b56b1be02ee208df2876ce4a470ccc /lisp/doc-view.el
parent40077a525feeed248f54e99d42b57272fed6dc5e (diff)
downloademacs-856997723b8fb75e10aafebfb2c170b291bfe881.tar.gz
(doc-view-mode): Don't use string-match and file
extension to choose fallback mode on empty/non-existing files but let-bind auto-mode-alist and call normal-mode.
Diffstat (limited to 'lisp/doc-view.el')
-rw-r--r--lisp/doc-view.el10
1 files changed, 5 insertions, 5 deletions
diff --git a/lisp/doc-view.el b/lisp/doc-view.el
index 8817db739e1..6d8ad649b94 100644
--- a/lisp/doc-view.el
+++ b/lisp/doc-view.el
@@ -1093,11 +1093,11 @@ toggle between displaying the document or editing it as text.
(if (or (not (file-exists-p buffer-file-name))
(= (point-min) (point-max)))
- ;; The doc is empty or doesn't exist at all, so fallback to an
- ;; editing mode.
- (if (string-match "[eE]?[pP][sS]" (file-name-extension buffer-file-name))
- (ps-mode)
- (fundamental-mode)) ;;Should we activate d-v-minor-mode here?
+ ;; The doc is empty or doesn't exist at all, so fallback to
+ ;; another mode.
+ (let ((auto-mode-alist (remq (rassq 'doc-view-mode auto-mode-alist)
+ auto-mode-alist)))
+ (normal-mode))
(let* ((prev-major-mode (if (eq major-mode 'doc-view-mode)
doc-view-previous-major-mode