diff options
| author | Tassilo Horn | 2010-12-30 15:47:53 +0100 |
|---|---|---|
| committer | Tassilo Horn | 2010-12-30 15:47:53 +0100 |
| commit | ad727c819a625c4f9cf482dda17cf339fa88610c (patch) | |
| tree | d77eb778434e53077600d8bbdaf25781ca3337c1 | |
| parent | b71b7803226e0214d235e6ab4d8fab1e873571ae (diff) | |
| download | emacs-ad727c819a625c4f9cf482dda17cf339fa88610c.tar.gz emacs-ad727c819a625c4f9cf482dda17cf339fa88610c.zip | |
* doc-view.el (doc-view-mode, doc-view-toggle-display): Use
normal-mode without doc-view-mode bindings in auto-mode-alist as
fallback instead of hard coding fundamental mode.
| -rw-r--r-- | lisp/ChangeLog | 6 | ||||
| -rw-r--r-- | lisp/doc-view.el | 11 |
2 files changed, 12 insertions, 5 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 8717bb441b7..3b28681fec5 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,5 +1,11 @@ | |||
| 1 | 2010-12-30 Tassilo Horn <tassilo@member.fsf.org> | 1 | 2010-12-30 Tassilo Horn <tassilo@member.fsf.org> |
| 2 | 2 | ||
| 3 | * doc-view.el (doc-view-mode, doc-view-toggle-display): Use | ||
| 4 | normal-mode without doc-view-mode bindings in auto-mode-alist as | ||
| 5 | fallback instead of hard coding fundamental mode. | ||
| 6 | |||
| 7 | 2010-12-30 Tassilo Horn <tassilo@member.fsf.org> | ||
| 8 | |||
| 3 | * doc-view.el (doc-view-doc->txt): Handle OpenDocument (or MS | 9 | * doc-view.el (doc-view-doc->txt): Handle OpenDocument (or MS |
| 4 | Office) files also for searching. | 10 | Office) files also for searching. |
| 5 | 11 | ||
diff --git a/lisp/doc-view.el b/lisp/doc-view.el index 9f5826484e5..526bf7694fb 100644 --- a/lisp/doc-view.el +++ b/lisp/doc-view.el | |||
| @@ -1047,7 +1047,6 @@ For now these keys are useful: | |||
| 1047 | 1047 | ||
| 1048 | ;;;;; Toggle between editing and viewing | 1048 | ;;;;; Toggle between editing and viewing |
| 1049 | 1049 | ||
| 1050 | |||
| 1051 | (defun doc-view-toggle-display () | 1050 | (defun doc-view-toggle-display () |
| 1052 | "Toggle between editing a document as text or viewing it." | 1051 | "Toggle between editing a document as text or viewing it." |
| 1053 | (interactive) | 1052 | (interactive) |
| @@ -1058,11 +1057,12 @@ For now these keys are useful: | |||
| 1058 | (setq buffer-read-only nil) | 1057 | (setq buffer-read-only nil) |
| 1059 | (remove-overlays (point-min) (point-max) 'doc-view t) | 1058 | (remove-overlays (point-min) (point-max) 'doc-view t) |
| 1060 | (set (make-local-variable 'image-mode-winprops-alist) t) | 1059 | (set (make-local-variable 'image-mode-winprops-alist) t) |
| 1061 | ;; Switch to the previously used major mode or fall back to fundamental | 1060 | ;; Switch to the previously used major mode or fall back to |
| 1062 | ;; mode. | 1061 | ;; normal mode. |
| 1063 | (if doc-view-previous-major-mode | 1062 | (if doc-view-previous-major-mode |
| 1064 | (funcall doc-view-previous-major-mode) | 1063 | (funcall doc-view-previous-major-mode) |
| 1065 | (fundamental-mode)) | 1064 | (let ((auto-mode-alist (rassq-delete-all 'doc-view-mode auto-mode-alist))) |
| 1065 | (normal-mode))) | ||
| 1066 | (doc-view-minor-mode 1)) | 1066 | (doc-view-minor-mode 1)) |
| 1067 | ;; Switch to doc-view-mode | 1067 | ;; Switch to doc-view-mode |
| 1068 | (when (and (buffer-modified-p) | 1068 | (when (and (buffer-modified-p) |
| @@ -1271,7 +1271,8 @@ toggle between displaying the document or editing it as text. | |||
| 1271 | 1271 | ||
| 1272 | (let* ((prev-major-mode (if (eq major-mode 'doc-view-mode) | 1272 | (let* ((prev-major-mode (if (eq major-mode 'doc-view-mode) |
| 1273 | doc-view-previous-major-mode | 1273 | doc-view-previous-major-mode |
| 1274 | major-mode))) | 1274 | (when (not (eq major-mode 'fundamental-mode)) |
| 1275 | major-mode)))) | ||
| 1275 | (kill-all-local-variables) | 1276 | (kill-all-local-variables) |
| 1276 | (set (make-local-variable 'doc-view-previous-major-mode) prev-major-mode)) | 1277 | (set (make-local-variable 'doc-view-previous-major-mode) prev-major-mode)) |
| 1277 | 1278 | ||