mm-view.el (mm-display-inline-fontify): Make the working buffer temporarily displayed...
authorKatsumi Yamaoka <yamaoka@jpl.org>
Thu, 21 Aug 2014 23:02:11 +0000 (23:02 +0000)
committerKatsumi Yamaoka <yamaoka@jpl.org>
Thu, 21 Aug 2014 23:02:11 +0000 (23:02 +0000)
lisp/ChangeLog
lisp/mm-view.el

index 85be195..978b45c 100644 (file)
@@ -1,3 +1,9 @@
+2014-08-21  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+       * mm-view.el (mm-display-inline-fontify): Make the working buffer
+       temporarily displayed when running a mode function (at least org-mode
+       requires it).
+
 2014-08-14  Alan Schmitt  <alan.schmitt@polytechnique.org>
 
        * gnus-sum.el (gnus-summary-expire-articles): Functions registered to
 2014-08-14  Alan Schmitt  <alan.schmitt@polytechnique.org>
 
        * gnus-sum.el (gnus-summary-expire-articles): Functions registered to
index ecfa2ac..bf24f34 100644 (file)
@@ -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
         (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))))
            (let ((auto-mode-alist
                   (delq (rassq 'doc-view-mode-maybe auto-mode-alist)
                         (copy-sequence auto-mode-alist))))