emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r106467: mm-view.el (mm-display-inlin


From: Katsumi Yamaoka
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r106467: 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).
Date: Mon, 21 Nov 2011 22:08:36 +0000
User-agent: Bazaar (2.3.1)

------------------------------------------------------------
revno: 106467
author: Lars Magne Ingebrigtsen <address@hidden>
committer: Katsumi Yamaoka <address@hidden>
branch nick: trunk
timestamp: Mon 2011-11-21 22:08:36 +0000
message:
  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).
modified:
  lisp/gnus/ChangeLog
  lisp/gnus/mm-view.el
=== modified file 'lisp/gnus/ChangeLog'
--- a/lisp/gnus/ChangeLog       2011-11-20 03:48:53 +0000
+++ b/lisp/gnus/ChangeLog       2011-11-21 22:08:36 +0000
@@ -1,3 +1,10 @@
+2011-11-21  Lars Magne Ingebrigtsen  <address@hidden>
+
+       * 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  <address@hidden>
 
        * mm-util.el (mm-charset-after): Fix typo.

=== modified file 'lisp/gnus/mm-view.el'
--- a/lisp/gnus/mm-view.el      2011-09-21 02:13:03 +0000
+++ b/lisp/gnus/mm-view.el      2011-11-21 22:08:36 +0000
@@ -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,25 +599,25 @@
                    (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))
+      ;; I find font-lock a bit too verbose.
+      (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)
-        (if mode
-            (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)
-                    (eq major-mode 'fundamental-mode))
-         (font-lock-fontify-buffer)))
+       (with-demoted-errors
+         (if mode
+             (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)
+                     (eq major-mode 'fundamental-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.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]