Show title attribute of span elements as mouse over text.
authorAdam Sjøgren <asjo@koldfront.dk>
Sun, 27 Mar 2011 08:29:08 +0000 (10:29 +0200)
committerAdam Sjøgren <asjo@koldfront.dk>
Sun, 19 May 2013 13:15:39 +0000 (15:15 +0200)
* shr.el (shr-tag-span): New function.

lisp/ChangeLog
lisp/shr.el

index 92bc307..9506db7 100644 (file)
@@ -1,3 +1,7 @@
+2013-05-19  Adam Sjøgren  <asjo@koldfront.dk>
+
+       * shr.el (shr-tag-span): New function.
+
 2013-05-18  Glenn Morris  <rgm@gnu.org>
 
        * message.el (message-mode): Use message-mode-abbrev-table,
index 5c1b99e..2d2272d 100644 (file)
@@ -1088,6 +1088,14 @@ ones, in case fg and bg are nil."
     (shr-indent))
   (shr-generic cont))
 
+(defun shr-tag-span (cont)
+  (let ((title (cdr (assq :title cont))))
+    (shr-generic cont)
+    (when title
+      (when shr-start
+        (let ((overlay (shr-make-overlay shr-start (point))))
+          (overlay-put overlay 'help-echo title))))))
+
 (defun shr-tag-h1 (cont)
   (shr-heading cont 'bold 'underline))