summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorLars Ingebrigtsen <larsi@gnus.org>2020-08-02 19:44:30 +0200
committerLars Ingebrigtsen <larsi@gnus.org>2020-08-02 19:44:30 +0200
commit2ad38b4745bf0203ca9ca0fe2eeb376943d384c6 (patch)
treee0e3fe0de250802e5ed5d6d267b4d97a396a9f25 /lisp
parent94b6eb807c8991897796fd18ccd414c7d9b9ad3b (diff)
downloademacs-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')
-rw-r--r--lisp/gnus/gnus-art.el1
-rw-r--r--lisp/gnus/mm-view.el10
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)