Mercurial > emacs
changeset 101623:0974e3e4aca7
(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.
author | Tassilo Horn <tassilo@member.fsf.org> |
---|---|
date | Wed, 28 Jan 2009 20:33:44 +0000 |
parents | 0476d5672e52 |
children | 6033e5211761 |
files | lisp/ChangeLog lisp/doc-view.el |
diffstat | 2 files changed, 11 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/ChangeLog Wed Jan 28 19:02:17 2009 +0000 +++ b/lisp/ChangeLog Wed Jan 28 20:33:44 2009 +0000 @@ -1,3 +1,9 @@ +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
--- a/lisp/doc-view.el Wed Jan 28 19:02:17 2009 +0000 +++ b/lisp/doc-view.el Wed Jan 28 20:33:44 2009 +0000 @@ -1093,11 +1093,11 @@ (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