aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuri Linkov2018-08-31 01:15:56 +0300
committerJuri Linkov2018-08-31 01:15:56 +0300
commiteb5588db69b3134832f79447dfba59333be41e8b (patch)
treed28d8a892fe633d1a4550e4c63f65926242ebb09
parent6d6f45e21830a57b4a12af0f89913752a137a653 (diff)
downloademacs-eb5588db69b3134832f79447dfba59333be41e8b.tar.gz
emacs-eb5588db69b3134832f79447dfba59333be41e8b.zip
* lisp/gnus/mm-view.el (mm-display-inline-fontify): Carry diff-mode overlays
to inline MIME attachments from the temp buffer along with text properties. (Bug#32474)
-rw-r--r--lisp/gnus/mm-view.el12
1 files changed, 10 insertions, 2 deletions
diff --git a/lisp/gnus/mm-view.el b/lisp/gnus/mm-view.el
index 50a927bce23..15eac11fb9e 100644
--- a/lisp/gnus/mm-view.el
+++ b/lisp/gnus/mm-view.el
@@ -452,7 +452,7 @@
452 "Insert HANDLE inline fontifying with MODE. 452 "Insert HANDLE inline fontifying with MODE.
453If MODE is not set, try to find mode automatically." 453If MODE is not set, try to find mode automatically."
454 (let ((charset (mail-content-type-get (mm-handle-type handle) 'charset)) 454 (let ((charset (mail-content-type-get (mm-handle-type handle) 'charset))
455 text coding-system) 455 text coding-system ovs)
456 (unless (eq charset 'gnus-decoded) 456 (unless (eq charset 'gnus-decoded)
457 (mm-with-unibyte-buffer 457 (mm-with-unibyte-buffer
458 (mm-insert-part handle) 458 (mm-insert-part handle)
@@ -498,10 +498,18 @@ If MODE is not set, try to find mode automatically."
498 (eq major-mode 'fundamental-mode)) 498 (eq major-mode 'fundamental-mode))
499 (font-lock-ensure)))) 499 (font-lock-ensure))))
500 (setq text (buffer-string)) 500 (setq text (buffer-string))
501 (when (eq mode 'diff-mode)
502 (setq ovs (mapcar (lambda (ov) (list ov (overlay-start ov)
503 (overlay-end ov)))
504 (overlays-in (point-min) (point-max)))))
501 ;; Set buffer unmodified to avoid confirmation when killing the 505 ;; Set buffer unmodified to avoid confirmation when killing the
502 ;; buffer. 506 ;; buffer.
503 (set-buffer-modified-p nil)) 507 (set-buffer-modified-p nil))
504 (mm-insert-inline handle text))) 508 (let ((b (1- (point))))
509 (mm-insert-inline handle text)
510 (dolist (ov ovs)
511 (move-overlay (nth 0 ov) (+ (nth 1 ov) b)
512 (+ (nth 2 ov) b) (current-buffer))))))
505 513
506;; Shouldn't these functions check whether the user even wants to use 514;; Shouldn't these functions check whether the user even wants to use
507;; font-lock? Also, it would be nice to change for the size of the 515;; font-lock? Also, it would be nice to change for the size of the