diff options
author | Lars Ingebrigtsen <larsi@gnus.org> | 2020-08-02 19:44:30 +0200 |
---|---|---|
committer | Lars Ingebrigtsen <larsi@gnus.org> | 2020-08-02 19:44:30 +0200 |
commit | 2ad38b4745bf0203ca9ca0fe2eeb376943d384c6 (patch) | |
tree | e0e3fe0de250802e5ed5d6d267b4d97a396a9f25 /lisp/gnus | |
parent | 94b6eb807c8991897796fd18ccd414c7d9b9ad3b (diff) | |
download | emacs-2ad38b4745bf0203ca9ca0fe2eeb376943d384c6.tar.gz emacs-2ad38b4745bf0203ca9ca0fe2eeb376943d384c6.tar.bz2 emacs-2ad38b4745bf0203ca9ca0fe2eeb376943d384c6.zip |
If gnus-visual is nil, don't fontify patches and the like
* doc/misc/emacs-mime.texi (Display Customization): Document it.
* lisp/gnus/gnus-art.el (gnus-mime-display-single): Bind it.
* lisp/gnus/mm-view.el (mm-inline-font-lock): New variable (bug#38421).
(mm-display-inline-fontify): Use it.
Diffstat (limited to 'lisp/gnus')
-rw-r--r-- | lisp/gnus/gnus-art.el | 1 | ||||
-rw-r--r-- | lisp/gnus/mm-view.el | 10 |
2 files changed, 9 insertions, 2 deletions
diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el index cb20d7102bd..d33539bc7f7 100644 --- a/lisp/gnus/gnus-art.el +++ b/lisp/gnus/gnus-art.el @@ -6018,6 +6018,7 @@ If nil, don't show those extra buttons." (defun gnus-mime-display-single (handle) (let ((type (mm-handle-media-type handle)) (ignored gnus-ignored-mime-types) + (mm-inline-font-lock (gnus-visual-p 'article-highlight 'highlight)) (not-attachment t) display text) (catch 'ignored diff --git a/lisp/gnus/mm-view.el b/lisp/gnus/mm-view.el index 828ac633dc5..bd5960c18b2 100644 --- a/lisp/gnus/mm-view.el +++ b/lisp/gnus/mm-view.el @@ -59,11 +59,16 @@ "The attributes of renderer types for text/html.") (defcustom mm-fill-flowed t - "If non-nil a format=flowed article will be displayed flowed." + "If non-nil, format=flowed articles will be displayed flowed." :type 'boolean :version "22.1" :group 'mime-display) +;; Not a defcustom, since it's usually overridden by the callers of +;; the mm functions. +(defvar mm-inline-font-lock t + "If non-nil, do font locking of inline media types that support it.") + (defcustom mm-inline-large-images-proportion 0.9 "Maximum proportion large images can occupy in the buffer. This is only used if `mm-inline-large-images' is set to @@ -502,7 +507,8 @@ If MODE is not set, try to find mode automatically." (delay-mode-hooks (set-auto-mode)) (setq mode major-mode))) ;; Do not fontify if the guess mode is fundamental. - (unless (eq major-mode 'fundamental-mode) + (when (and (not (eq major-mode 'fundamental-mode)) + mm-inline-font-lock) (font-lock-ensure)))) (setq text (buffer-string)) (when (eq mode 'diff-mode) |