]> code.delx.au - gnu-emacs/blobdiff - lisp/gnus/mm-view.el
Merge from emacs-24; up to 2014-07-17T10:18:19Z!dmantipov@yandex.ru
[gnu-emacs] / lisp / gnus / mm-view.el
index 2bee260d8f275966fb1076237372a08354aa1428..bf24f3496220c263abfee9b681caeaaae096dd02 100644 (file)
      `(lambda ()
        (let ((inhibit-read-only t))
          (delete-region ,(copy-marker b t)
-                        ,(copy-marker (point))))))))
+                        ,(point-marker)))))))
 
 (defun mm-inline-audio (handle)
   (message "Not implemented"))
@@ -513,16 +513,20 @@ 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))))
              (set-auto-mode)))
          ;; The mode function might have already turned on font-lock.
          ;; Do not fontify if the guess mode is fundamental.
-         (unless (or (symbol-value 'font-lock-mode)
+         (unless (or font-lock-mode
                      (eq major-mode 'fundamental-mode))
-           (font-lock-fontify-buffer))))
+            (if (fboundp 'font-lock-ensure)
+                (font-lock-ensure)
+              (font-lock-fontify-buffer)))))
       ;; By default, XEmacs font-lock uses non-duplicable text
       ;; properties.  This code forces all the text properties
       ;; to be copied along with the text.