diff --git a/lisp/shr.el b/lisp/shr.el index 113137a..3a217f8 100644 --- a/lisp/shr.el +++ b/lisp/shr.el @@ -161,6 +161,14 @@ redirects somewhere else." (copy-region-as-kill (point-min) (point-max)) (message "Copied %s" url)))))) +(defun shr-show-title () + "Show the title text of the image under point." + (interactive) + (let ((text (get-text-property (point) 'shr-title))) + (if (not text) + (message "No title under point") + (message "%s" text)))) + (defun shr-show-alt-text () "Show the ALT text of the image under point." (interactive) @@ -896,6 +904,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 + (put-text-property (or start shr-start) (point) 'shr-title title) + (let ((overlay (make-overlay (or start shr-start) (point)))) + (overlay-put overlay 'help-echo title))))) + (defun shr-tag-h1 (cont) (shr-heading cont 'bold 'underline))