From: Katsumi Yamaoka Date: Thu, 21 Aug 2014 23:02:11 +0000 (+0000) Subject: mm-view.el (mm-display-inline-fontify): Make the working buffer temporarily displayed... X-Git-Url: http://cgit.sxemacs.org/?p=gnus;a=commitdiff_plain;h=ba869402923d2adda4c143301e12659b9d7020f8 mm-view.el (mm-display-inline-fontify): Make the working buffer temporarily displayed when running a mode function (at least org-mode requires it) --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 85be195a9..978b45ca2 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2014-08-21 Katsumi Yamaoka + + * 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 * gnus-sum.el (gnus-summary-expire-articles): Functions registered to diff --git a/lisp/mm-view.el b/lisp/mm-view.el index ecfa2ac95..bf24f3496 100644 --- a/lisp/mm-view.el +++ b/lisp/mm-view.el @@ -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))))