]> code.delx.au - gnu-emacs/commitdiff
lisp/net/shr.el (shr-tag-del, shr-tag-ins): New functions.
authorAdam Sjøgren <asjo@koldfront.dk>
Sun, 7 Feb 2016 02:11:57 +0000 (13:11 +1100)
committerLars Ingebrigtsen <larsi@gnus.org>
Sun, 7 Feb 2016 02:11:57 +0000 (13:11 +1100)
* lisp/net/shr.el (shr-tag-del, shr-tag-ins): New functions.

lisp/net/shr.el

index a8ba2845aa29068a48f9eb7e47704b4150d85d01..567c8b807ff5a5b1857f36688bff715cfeba3ee4 100644 (file)
@@ -1230,9 +1230,6 @@ ones, in case fg and bg are nil."
 (defun shr-tag-s (dom)
   (shr-fontize-dom dom 'shr-strike-through))
 
-(defun shr-tag-del (dom)
-  (shr-fontize-dom dom 'shr-strike-through))
-
 (defun shr-tag-b (dom)
   (shr-fontize-dom dom 'bold))
 
@@ -1252,6 +1249,24 @@ ones, in case fg and bg are nil."
   (let ((shr-current-font 'default))
     (shr-generic dom)))
 
+(defun shr-tag-ins (cont)
+  (let* ((start (point))
+         (color "green")
+         (shr-stylesheet (nconc (list (cons 'color color))
+                               shr-stylesheet)))
+    (shr-generic cont)
+    (shr-colorize-region start (point) color
+                         (cdr (assq 'background-color shr-stylesheet)))))
+
+(defun shr-tag-del (cont)
+  (let* ((start (point))
+         (color "red")
+         (shr-stylesheet (nconc (list (cons 'color color))
+                               shr-stylesheet)))
+    (shr-fontize-dom cont 'shr-strike-through)
+    (shr-colorize-region start (point) color
+                         (cdr (assq 'background-color shr-stylesheet)))))
+
 (defun shr-parse-style (style)
   (when style
     (save-match-data