summaryrefslogtreecommitdiff
path: root/lisp/net/shr.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/net/shr.el')
-rw-r--r--lisp/net/shr.el14
1 files changed, 11 insertions, 3 deletions
diff --git a/lisp/net/shr.el b/lisp/net/shr.el
index 4506ede8722..6ddf8d2af90 100644
--- a/lisp/net/shr.el
+++ b/lisp/net/shr.el
@@ -143,6 +143,7 @@ cid: URL as the argument.")
(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)
@@ -657,6 +658,12 @@ size, and full-buffer size."
(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'."
@@ -1476,9 +1483,6 @@ ones, in case fg and bg are nil."
(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))
@@ -1491,6 +1495,9 @@ ones, in case fg and bg are nil."
(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)
@@ -1499,6 +1506,7 @@ ones, in case fg and bg are nil."
(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)))