diff options
| author | Lars Magne Ingebrigtsen | 2011-11-21 22:08:36 +0000 |
|---|---|---|
| committer | Katsumi Yamaoka | 2011-11-21 22:08:36 +0000 |
| commit | 252f26e9c26990ef9da51513b45b5eb806dd3ed7 (patch) | |
| tree | 2159aade9d8da282b065b99aa519bcd06781faa8 | |
| parent | 9c34a34446474b0f4bd864d96d95f1faee2e3686 (diff) | |
| download | emacs-252f26e9c26990ef9da51513b45b5eb806dd3ed7.tar.gz emacs-252f26e9c26990ef9da51513b45b5eb806dd3ed7.zip | |
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).
| -rw-r--r-- | lisp/gnus/ChangeLog | 7 | ||||
| -rw-r--r-- | lisp/gnus/mm-view.el | 36 |
2 files changed, 26 insertions, 17 deletions
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index 27693ab771b..718983717ae 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog | |||
| @@ -1,3 +1,10 @@ | |||
| 1 | 2011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org> | ||
| 2 | |||
| 3 | * mm-view.el (mm-display-inline-fontify): Make the font-lock variables | ||
| 4 | buffer-local instead of binding them to avoid warnings. Also demote | ||
| 5 | errors (bug#10063). | ||
| 6 | (font-lock-mode-hook): Shut up byte compiler. | ||
| 7 | |||
| 1 | 2011-11-20 Juanma Barranquero <lekktu@gmail.com> | 8 | 2011-11-20 Juanma Barranquero <lekktu@gmail.com> |
| 2 | 9 | ||
| 3 | * mm-util.el (mm-charset-after): Fix typo. | 10 | * mm-util.el (mm-charset-after): Fix typo. |
diff --git a/lisp/gnus/mm-view.el b/lisp/gnus/mm-view.el index 6358e34176f..854ca3497da 100644 --- a/lisp/gnus/mm-view.el +++ b/lisp/gnus/mm-view.el | |||
| @@ -566,6 +566,8 @@ | |||
| 566 | (face-property 'default prop) (current-buffer)))) | 566 | (face-property 'default prop) (current-buffer)))) |
| 567 | (delete-region ,(point-min-marker) ,(point-max-marker))))))))) | 567 | (delete-region ,(point-min-marker) ,(point-max-marker))))))))) |
| 568 | 568 | ||
| 569 | ;; Shut up byte-compiler. | ||
| 570 | (defvar font-lock-mode-hook) | ||
| 569 | (defun mm-display-inline-fontify (handle &optional mode) | 571 | (defun mm-display-inline-fontify (handle &optional mode) |
| 570 | "Insert HANDLE inline fontifying with MODE. | 572 | "Insert HANDLE inline fontifying with MODE. |
| 571 | If MODE is not set, try to find mode automatically." | 573 | If MODE is not set, try to find mode automatically." |
| @@ -597,25 +599,25 @@ If MODE is not set, try to find mode automatically." | |||
| 597 | (t | 599 | (t |
| 598 | text))) | 600 | text))) |
| 599 | (require 'font-lock) | 601 | (require 'font-lock) |
| 600 | (let ((font-lock-maximum-size nil) | 602 | ;; I find font-lock a bit too verbose. |
| 601 | ;; Disable support modes, e.g., jit-lock, lazy-lock, etc. | 603 | (let ((font-lock-verbose nil)) |
| 602 | (font-lock-mode-hook nil) | 604 | ;; Disable support modes, e.g., jit-lock, lazy-lock, etc. |
| 603 | (font-lock-support-mode nil) | 605 | (set (make-local-variable 'font-lock-mode-hook) nil) |
| 604 | ;; I find font-lock a bit too verbose. | 606 | (set (make-local-variable 'font-lock-support-mode) nil) |
| 605 | (font-lock-verbose nil)) | ||
| 606 | (setq buffer-file-name (mm-handle-filename handle)) | 607 | (setq buffer-file-name (mm-handle-filename handle)) |
| 607 | (set (make-local-variable 'enable-local-variables) nil) | 608 | (set (make-local-variable 'enable-local-variables) nil) |
| 608 | (if mode | 609 | (with-demoted-errors |
| 609 | (funcall mode) | 610 | (if mode |
| 610 | (let ((auto-mode-alist | 611 | (funcall mode) |
| 611 | (delq (rassq 'doc-view-mode-maybe auto-mode-alist) | 612 | (let ((auto-mode-alist |
| 612 | (copy-sequence auto-mode-alist)))) | 613 | (delq (rassq 'doc-view-mode-maybe auto-mode-alist) |
| 613 | (set-auto-mode))) | 614 | (copy-sequence auto-mode-alist)))) |
| 614 | ;; The mode function might have already turned on font-lock. | 615 | (set-auto-mode))) |
| 615 | ;; Do not fontify if the guess mode is fundamental. | 616 | ;; The mode function might have already turned on font-lock. |
| 616 | (unless (or (symbol-value 'font-lock-mode) | 617 | ;; Do not fontify if the guess mode is fundamental. |
| 617 | (eq major-mode 'fundamental-mode)) | 618 | (unless (or (symbol-value 'font-lock-mode) |
| 618 | (font-lock-fontify-buffer))) | 619 | (eq major-mode 'fundamental-mode)) |
| 620 | (font-lock-fontify-buffer)))) | ||
| 619 | ;; By default, XEmacs font-lock uses non-duplicable text | 621 | ;; By default, XEmacs font-lock uses non-duplicable text |
| 620 | ;; properties. This code forces all the text properties | 622 | ;; properties. This code forces all the text properties |
| 621 | ;; to be copied along with the text. | 623 | ;; to be copied along with the text. |