[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] /srv/bzr/emacs/trunk r102727: * doc-view.el (doc-view-mode
From: |
Tassilo Horn |
Subject: |
[Emacs-diffs] /srv/bzr/emacs/trunk r102727: * doc-view.el (doc-view-mode, doc-view-toggle-display): Use |
Date: |
Thu, 30 Dec 2010 15:47:53 +0100 |
User-agent: |
Bazaar (2.0.3) |
------------------------------------------------------------
revno: 102727
committer: Tassilo Horn <address@hidden>
branch nick: trunk
timestamp: Thu 2010-12-30 15:47:53 +0100
message:
* 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.
modified:
lisp/ChangeLog
lisp/doc-view.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog 2010-12-30 13:53:22 +0000
+++ b/lisp/ChangeLog 2010-12-30 14:47:53 +0000
@@ -1,5 +1,11 @@
2010-12-30 Tassilo Horn <address@hidden>
+ * 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.
+
+2010-12-30 Tassilo Horn <address@hidden>
+
* doc-view.el (doc-view-doc->txt): Handle OpenDocument (or MS
Office) files also for searching.
=== modified file 'lisp/doc-view.el'
--- a/lisp/doc-view.el 2010-12-30 13:53:22 +0000
+++ b/lisp/doc-view.el 2010-12-30 14:47:53 +0000
@@ -1047,7 +1047,6 @@
;;;;; Toggle between editing and viewing
-
(defun doc-view-toggle-display ()
"Toggle between editing a document as text or viewing it."
(interactive)
@@ -1058,11 +1057,12 @@
(setq buffer-read-only nil)
(remove-overlays (point-min) (point-max) 'doc-view t)
(set (make-local-variable 'image-mode-winprops-alist) t)
- ;; Switch to the previously used major mode or fall back to fundamental
- ;; mode.
+ ;; Switch to the previously used major mode or fall back to
+ ;; normal mode.
(if doc-view-previous-major-mode
(funcall doc-view-previous-major-mode)
- (fundamental-mode))
+ (let ((auto-mode-alist (rassq-delete-all 'doc-view-mode
auto-mode-alist)))
+ (normal-mode)))
(doc-view-minor-mode 1))
;; Switch to doc-view-mode
(when (and (buffer-modified-p)
@@ -1271,7 +1271,8 @@
(let* ((prev-major-mode (if (eq major-mode 'doc-view-mode)
doc-view-previous-major-mode
- major-mode)))
+ (when (not (eq major-mode 'fundamental-mode))
+ major-mode))))
(kill-all-local-variables)
(set (make-local-variable 'doc-view-previous-major-mode)
prev-major-mode))
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] /srv/bzr/emacs/trunk r102727: * doc-view.el (doc-view-mode, doc-view-toggle-display): Use,
Tassilo Horn <=