extension to choose fallback mode on empty/non-existing files but
let-bind auto-mode-alist and call normal-mode.
+2009-01-28 Tassilo Horn <tassilo@member.fsf.org>
+
+ * doc-view.el (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.
+
2009-01-28 Eli Zaretskii <eliz@gnu.org>
* ls-lisp.el (ls-lisp-classify): Propertize file name before
(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