(define-key map [tab] 'shr-next-link)
(define-key map [backtab] 'shr-previous-link)
(define-key map [follow-link] 'mouse-face)
+ (define-key map [mouse-2] 'shr-mouse-browse-url)
(define-key map "I" 'shr-insert-image)
(define-key map "w" 'shr-copy-url)
+ (define-key map "u" 'shr-copy-url)
(define-key map "v" 'shr-browse-url)
(define-key map "o" 'shr-save-contents)
(define-key map "\r" 'shr-browse-url)
(forward-line 1)
(goto-char end))))))
+(defun shr-mouse-browse-url (ev)
+ "Browse the URL under the mouse cursor."
+ (interactive "e")
+ (mouse-set-point ev)
+ (shr-browse-url))
+
(defun shr-browse-url (&optional external)
"Browse the URL under point.
If EXTERNAL, browse the URL using `shr-external-browser'."
start (point)
(list 'shr-url url
'help-echo (if title (format "%s (%s)" url title) url)
+ 'follow-link t
+ 'mouse-face 'highlight
'keymap shr-map)))
(defun shr-encode-url (url)
(if column
(aref widths width-column)
10))
- ;; Sanity check for degenerate tables.
- (when (zerop width)
- (setq width 10))
(when (and fill
(setq colspan (cdr (assq :colspan (cdr column)))))
(setq colspan (string-to-number colspan))
(setq width-column (+ width-column (1- colspan))))
(when (or column
(not fill))
+ ;; Sanity check for degenerate tables.
+ (when (zerop width)
+ (setq width 10))
(push (shr-render-td (cdr column) width fill)
tds))
(setq i (1+ i)
(nreverse trs)))
(defun shr-render-td (cont width fill)
+ (when (= width 0) (debug))
(with-temp-buffer
(let ((bgcolor (cdr (assq :bgcolor cont)))
(fgcolor (cdr (assq :fgcolor cont)))