1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-01 18:00:40 -08:00

mm-view.el (mm-display-inline-fontify): Make the font-lock variables buffer-local instead of binding them to avoid warnings. Also demote errors (bug#10063).

This commit is contained in:
Lars Magne Ingebrigtsen 2011-11-21 22:08:36 +00:00 committed by Katsumi Yamaoka
parent 9c34a34446
commit 252f26e9c2
2 changed files with 26 additions and 17 deletions

View file

@ -1,3 +1,10 @@
2011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
* mm-view.el (mm-display-inline-fontify): Make the font-lock variables
buffer-local instead of binding them to avoid warnings. Also demote
errors (bug#10063).
(font-lock-mode-hook): Shut up byte compiler.
2011-11-20 Juanma Barranquero <lekktu@gmail.com>
* mm-util.el (mm-charset-after): Fix typo.

View file

@ -566,6 +566,8 @@
(face-property 'default prop) (current-buffer))))
(delete-region ,(point-min-marker) ,(point-max-marker)))))))))
;; Shut up byte-compiler.
(defvar font-lock-mode-hook)
(defun mm-display-inline-fontify (handle &optional mode)
"Insert HANDLE inline fontifying with MODE.
If MODE is not set, try to find mode automatically."
@ -597,14 +599,14 @@ If MODE is not set, try to find mode automatically."
(t
text)))
(require 'font-lock)
(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))
(let ((font-lock-verbose nil))
;; Disable support modes, e.g., jit-lock, lazy-lock, etc.
(set (make-local-variable 'font-lock-mode-hook) nil)
(set (make-local-variable 'font-lock-support-mode) nil)
(setq buffer-file-name (mm-handle-filename handle))
(set (make-local-variable 'enable-local-variables) nil)
(with-demoted-errors
(if mode
(funcall mode)
(let ((auto-mode-alist
@ -615,7 +617,7 @@ If MODE is not set, try to find mode automatically."
;; Do not fontify if the guess mode is fundamental.
(unless (or (symbol-value 'font-lock-mode)
(eq major-mode 'fundamental-mode))
(font-lock-fontify-buffer)))
(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.