lisp/ChangeLog (2014-10-24): Add bug#
[gnus] / lisp / mm-view.el
index 84030fc..bf24f34 100644 (file)
         `(lambda ()
            (let ((inhibit-read-only t))
              (delete-region ,(copy-marker (point-min) t)
-                            ,(copy-marker (point-max) t)))))))))
+                            ,(point-max-marker)))))))))
 
 (defvar mm-w3m-standalone-supports-m17n-p (if (featurep 'mule) 'undecided)
   "*T means the w3m command supports the m17n feature.")
        `(lambda ()
           (let ((inhibit-read-only t))
            (delete-region ,(copy-marker (point-min) t)
-                          ,(copy-marker (point-max) t))))))))
+                          ,(point-max-marker))))))))
 
 (defun mm-insert-inline (handle text)
   "Insert TEXT inline from HANDLE."
      `(lambda ()
        (let ((inhibit-read-only t))
          (delete-region ,(copy-marker b t)
-                        ,(copy-marker (point) t)))))))
+                        ,(point-marker)))))))
 
 (defun mm-inline-audio (handle)
   (message "Not implemented"))
@@ -513,7 +513,9 @@ If MODE is not set, try to find mode automatically."
         (set (make-local-variable 'enable-local-variables) nil)
        (with-demoted-errors
          (if mode
-             (funcall mode)
+             (save-window-excursion
+               (switch-to-buffer (current-buffer))
+               (funcall mode))
            (let ((auto-mode-alist
                   (delq (rassq 'doc-view-mode-maybe auto-mode-alist)
                         (copy-sequence auto-mode-alist))))