GNU bug report logs - #32474
27.0.50; Gnus doesn't highlight refined changes in diff attachments

Previous Next

Package: emacs;

Reported by: Juri Linkov <juri <at> linkov.net>

Date: Sun, 19 Aug 2018 21:50:02 UTC

Severity: minor

Tags: patch

Found in version 27.0.50

Done: Juri Linkov <juri <at> linkov.net>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 32474 in the body.
You can then email your comments to 32474 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#32474; Package emacs. (Sun, 19 Aug 2018 21:50:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Juri Linkov <juri <at> linkov.net>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sun, 19 Aug 2018 21:50:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> linkov.net>
To: bug-gnu-emacs <at> gnu.org
Subject: 27.0.50; Gnus doesn't highlight refined changes in diff attachments
Date: Mon, 20 Aug 2018 00:20:02 +0300
[Message part 1 (text/plain, inline)]
Since refined changes in diff attachments are highlighted using overlays,
they need special treatment to be copied together with text properties:

[gnus-mm-view.1.patch (text/x-diff, inline)]
diff --git a/lisp/gnus/mm-view.el b/lisp/gnus/mm-view.el
index 50a927bce2..0b15f6b188 100644
--- a/lisp/gnus/mm-view.el
+++ b/lisp/gnus/mm-view.el
@@ -452,7 +452,7 @@ mm-display-inline-fontify
   "Insert HANDLE inline fontifying with MODE.
 If MODE is not set, try to find mode automatically."
   (let ((charset (mail-content-type-get (mm-handle-type handle) 'charset))
-	text coding-system)
+	text coding-system ovs)
     (unless (eq charset 'gnus-decoded)
       (mm-with-unibyte-buffer
 	(mm-insert-part handle)
@@ -498,10 +498,18 @@ mm-display-inline-fontify
 		      (eq major-mode 'fundamental-mode))
 	    (font-lock-ensure))))
       (setq text (buffer-string))
+      (when (eq mode 'diff-mode)
+	(setq ovs (mapcar (lambda (ov) (list ov (overlay-start ov)
+	                                        (overlay-end ov)))
+	                  (overlays-in (point-min) (point-max)))))
       ;; Set buffer unmodified to avoid confirmation when killing the
       ;; buffer.
       (set-buffer-modified-p nil))
-    (mm-insert-inline handle text)))
+    (let ((b (1- (point))))
+      (mm-insert-inline handle text)
+      (dolist (ov ovs)
+	(move-overlay (nth 0 ov) (+ (nth 1 ov) b)
+	                         (+ (nth 2 ov) b) (current-buffer))))))
 
 ;; Shouldn't these functions check whether the user even wants to use
 ;; font-lock?  Also, it would be nice to change for the size of the

Reply sent to Juri Linkov <juri <at> linkov.net>:
You have taken responsibility. (Thu, 30 Aug 2018 22:18:02 GMT) Full text and rfc822 format available.

Notification sent to Juri Linkov <juri <at> linkov.net>:
bug acknowledged by developer. (Thu, 30 Aug 2018 22:18:02 GMT) Full text and rfc822 format available.

Message #10 received at 32474-done <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> linkov.net>
To: 32474-done <at> debbugs.gnu.org
Subject: Re: bug#32474: 27.0.50;
 Gnus doesn't highlight refined changes in diff attachments
Date: Fri, 31 Aug 2018 01:17:14 +0300
> Since refined changes in diff attachments are highlighted using overlays,
> they need special treatment to be copied together with text properties:

Done in eb5588db69.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 28 Sep 2018 11:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 6 years and 348 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.