summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Ingebrigtsen <larsi@gnus.org>2022-09-26 15:16:16 +0200
committerLars Ingebrigtsen <larsi@gnus.org>2022-09-26 15:16:16 +0200
commitfde23c6e7426b96de0989e25d5a565652c995ca4 (patch)
tree0710a5702dbb4c73a9ec5e43282ed3af27a5f05f
parent4feeb7570df33ac335049296d62dba5e05031747 (diff)
downloademacs-fde23c6e7426b96de0989e25d5a565652c995ca4.tar.gz
Fix (thing-at-point 'url) in eww forms
* lisp/net/eww.el (eww-tag-input): Don't claim to have an URL here (bug#58091). * lisp/net/shr.el (shr-next-link, shr-previous-link): Search for shr-tab-stop instead of shr-url so that we can be more general. (shr-urlify): Mark all links as tabbable-to.
-rw-r--r--lisp/net/eww.el2
-rw-r--r--lisp/net/shr.el5
2 files changed, 4 insertions, 3 deletions
diff --git a/lisp/net/eww.el b/lisp/net/eww.el
index 2a511333de1..61b1b750683 100644
--- a/lisp/net/eww.el
+++ b/lisp/net/eww.el
@@ -1629,7 +1629,7 @@ See URL `https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Input'.")
(unless (= start (point))
(put-text-property start (1+ start) 'help-echo "Input field")
;; Mark this as an element we can TAB to.
- (put-text-property start (1+ start) 'shr-url dom))))
+ (put-text-property start (1+ start) 'shr-tab-stop t))))
(defun eww-tag-select (dom)
(shr-ensure-paragraph)
diff --git a/lisp/net/shr.el b/lisp/net/shr.el
index d56420eb02e..75992bc62a4 100644
--- a/lisp/net/shr.el
+++ b/lisp/net/shr.el
@@ -503,7 +503,7 @@ Value is a pair of positions (START . END) if there is a non-nil
(defun shr-next-link ()
"Skip to the next link."
(interactive)
- (let ((match (text-property-search-forward 'shr-url nil nil t)))
+ (let ((match (text-property-search-forward 'shr-tab-stop nil nil t)))
(if (not match)
(message "No next link")
(goto-char (prop-match-beginning match))
@@ -512,7 +512,7 @@ Value is a pair of positions (START . END) if there is a non-nil
(defun shr-previous-link ()
"Skip to the previous link."
(interactive)
- (if (not (text-property-search-backward 'shr-url nil nil t))
+ (if (not (text-property-search-backward 'shr-tab-stop nil nil t))
(message "No previous link")
(message "%s" (get-text-property (point) 'help-echo))))
@@ -1215,6 +1215,7 @@ START, and END. Note that START and END should be markers."
(add-text-properties
start (point)
(list 'shr-url url
+ 'shr-tab-stop t
'button t
'category 'shr ; For button.el button buffers.
'help-echo (let ((parsed (url-generic-parse-url