* mime-pgp.el: Require 'epa.
[elisp/semi.git] / mime-view.el
index 61e37c6..33dc314 100644 (file)
@@ -22,8 +22,8 @@
 
 ;; You should have received a copy of the GNU General Public License
 ;; along with GNU Emacs; see the file COPYING.  If not, write to the
-;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-;; Boston, MA 02111-1307, USA.
+;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+;; Boston, MA 02110-1301, USA.
 
 ;;; Code:
 
@@ -977,20 +977,23 @@ MEDIA-TYPE must be (TYPE . SUBTYPE), TYPE or t.  t means default."
            (buffer-disable-undo)
            (kill-all-local-variables)
            (mime-view-insert-text-content entity situation)
-           (cond (mode
-                  (funcall mode))
-                 ((setq filename (mime-entity-filename entity))
-                  (let ((buffer-file-name
-                         (expand-file-name (file-name-nondirectory filename)
-                                           temporary-file-directory)))
-                    (set-auto-mode))))
            (require 'font-lock)
-           (let ((font-lock-verbose nil))
-             ;; I find font-lock a bit too verbose.
-             (font-lock-fontify-buffer)
-             (when (and (boundp 'jit-lock-mode)
-                        jit-lock-mode)
-               (jit-lock-fontify-now)))
+           (let ((font-lock-maximum-size nil)
+                 ;; Disable support modes, e.g., jit-lock, lazy-lock, etc.
+                 (font-lock-mode-hook nil)
+                 (font-lock-support-mode nil)
+                 ;; I find font-lock a bit too verbose.
+                 (font-lock-verbose nil))
+             (cond (mode
+                    (funcall mode))
+                   ((setq filename (mime-entity-filename entity))
+                    (let ((buffer-file-name
+                           (expand-file-name (file-name-nondirectory filename)
+                                             temporary-file-directory)))
+                      (set-auto-mode))))
+             ;; The mode function might have already turned on font-lock.
+             (unless (symbol-value 'font-lock-mode)
+               (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.