* shr.el (shr-urlify): Display the title in <a> tags.
authorAdam Sjøgren <asjo@koldfront.dk>
Sat, 4 Dec 2010 22:23:35 +0000 (23:23 +0100)
committerLars Magne Ingebrigtsen <larsi@quimbies.gnus.org>
Sat, 4 Dec 2010 22:23:35 +0000 (23:23 +0100)
lisp/ChangeLog
lisp/shr.el

index 6282908..30f757f 100644 (file)
@@ -1,3 +1,7 @@
+2010-12-04  Adam Sjøgren  <asjo@koldfront.dk>
+
+       * shr.el (shr-urlify): Display the title in <a> tags.
+
 2010-12-04  Andrew Cohen  <cohen@andy.bu.edu>
 
        * nnir.el (nnir-categorize): Replace mapcar with mapc.
 2010-12-04  Andrew Cohen  <cohen@andy.bu.edu>
 
        * nnir.el (nnir-categorize): Replace mapcar with mapc.
index c07bb34..31af4b2 100644 (file)
@@ -544,10 +544,10 @@ START, and END."
 
 (autoload 'widget-convert-button "wid-edit")
 
 
 (autoload 'widget-convert-button "wid-edit")
 
-(defun shr-urlify (start url)
+(defun shr-urlify (start url &optional title)
   (widget-convert-button
    'url-link start (point)
   (widget-convert-button
    'url-link start (point)
-   :help-echo url
+   :help-echo (if title (format "%s (%s)" title url) url)
    :keymap shr-map
    url)
   (put-text-property start (point) 'shr-url url))
    :keymap shr-map
    url)
   (put-text-property start (point) 'shr-url url))
@@ -669,10 +669,11 @@ text will be inserted at start."
 
 (defun shr-tag-a (cont)
   (let ((url (cdr (assq :href cont)))
 
 (defun shr-tag-a (cont)
   (let ((url (cdr (assq :href cont)))
+        (title (cdr (assq :title cont)))
        (start (point))
        shr-start)
     (shr-generic cont)
        (start (point))
        shr-start)
     (shr-generic cont)
-    (shr-urlify (or shr-start start) url)))
+    (shr-urlify (or shr-start start) url title)))
 
 (defun shr-tag-object (cont)
   (let ((start (point))
 
 (defun shr-tag-object (cont)
   (let ((start (point))