diff options
| author | Tassilo Horn | 2009-01-28 20:33:44 +0000 |
|---|---|---|
| committer | Tassilo Horn | 2009-01-28 20:33:44 +0000 |
| commit | 856997723b8fb75e10aafebfb2c170b291bfe881 (patch) | |
| tree | a186b63f20b56b1be02ee208df2876ce4a470ccc | |
| parent | 40077a525feeed248f54e99d42b57272fed6dc5e (diff) | |
| download | emacs-856997723b8fb75e10aafebfb2c170b291bfe881.tar.gz emacs-856997723b8fb75e10aafebfb2c170b291bfe881.zip | |
(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.
| -rw-r--r-- | lisp/ChangeLog | 6 | ||||
| -rw-r--r-- | lisp/doc-view.el | 10 |
2 files changed, 11 insertions, 5 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 47aaa51deb6..049e10dbe7e 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2009-01-28 Tassilo Horn <tassilo@member.fsf.org> | ||
| 2 | |||
| 3 | * doc-view.el (doc-view-mode): Don't use string-match and file | ||
| 4 | extension to choose fallback mode on empty/non-existing files but | ||
| 5 | let-bind auto-mode-alist and call normal-mode. | ||
| 6 | |||
| 1 | 2009-01-28 Eli Zaretskii <eliz@gnu.org> | 7 | 2009-01-28 Eli Zaretskii <eliz@gnu.org> |
| 2 | 8 | ||
| 3 | * ls-lisp.el (ls-lisp-classify): Propertize file name before | 9 | * ls-lisp.el (ls-lisp-classify): Propertize file name before |
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. | |||
| 1093 | 1093 | ||
| 1094 | (if (or (not (file-exists-p buffer-file-name)) | 1094 | (if (or (not (file-exists-p buffer-file-name)) |
| 1095 | (= (point-min) (point-max))) | 1095 | (= (point-min) (point-max))) |
| 1096 | ;; The doc is empty or doesn't exist at all, so fallback to an | 1096 | ;; The doc is empty or doesn't exist at all, so fallback to |
| 1097 | ;; editing mode. | 1097 | ;; another mode. |
| 1098 | (if (string-match "[eE]?[pP][sS]" (file-name-extension buffer-file-name)) | 1098 | (let ((auto-mode-alist (remq (rassq 'doc-view-mode auto-mode-alist) |
| 1099 | (ps-mode) | 1099 | auto-mode-alist))) |
| 1100 | (fundamental-mode)) ;;Should we activate d-v-minor-mode here? | 1100 | (normal-mode)) |
| 1101 | 1101 | ||
| 1102 | (let* ((prev-major-mode (if (eq major-mode 'doc-view-mode) | 1102 | (let* ((prev-major-mode (if (eq major-mode 'doc-view-mode) |
| 1103 | doc-view-previous-major-mode | 1103 | doc-view-previous-major-mode |