Subject: 29.0.50; eww: Exclude radio links when suggesting URIs

From: Visuwesh <[email-masked]>
Date: Sun, 03 Jul 2022 13:09:21 +0530

Tags: patch

If the point is over a radio button in *eww*, and you press M-s M-w,
then an error is raised with the following backtrace

    Debugger entered--Lisp error: (wrong-type-argument stringp (input ((type . "radio") (name . "type") (id . "filter-type-show") (value . "show"))))
      intern-soft((input ((type . "radio") (name . "type") (id . "filter-type-show") (value . "show"))) [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0])
      eww-suggested-uris()
      byte-code("\301 \302\303\304\3\205\13\0\3@\"\305\306\4$\10D\207" [current-prefix-arg eww-suggested-uris read-string format-prompt "Enter URL or keywords" nil eww-prompt-history] 6)
      call-interactively(eww)
      eww-search-words()
      funcall-interactively(eww-search-words)
      call-interactively(eww-search-words nil nil)
      command-execute(eww-search-words)

This is easy to reproduce:

    1. M-s M-w yewtu.be/search?q=test RET
    2. Move the point to one of the radio buttons.
    3. Say M-s M-w.

The attached patch fixes the error but maybe the right place to fix it
is in eww-links-at-point?

>From d298c556dbe3b1391a3fa9b93cc276fd3c531c48 Mon Sep 17 00:00:00 2001
From: Visuwesh <[email-masked]>
Date: Sun, 3 Jul 2022 13:05:40 +0530
Subject: [PATCH] Exclude radio buttons when suggesting URI in eww

* lisp/net/eww.el (eww-suggested-uris): Don't bug out on radio
buttons.
---
 lisp/net/eww.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/net/eww.el b/lisp/net/eww.el
index 3c16942e7c..55deb4c1e6 100644
--- a/lisp/net/eww.el
+++ b/lisp/net/eww.el
@@ -329,7 +329,7 @@ eww-suggested-uris
     (dolist (fun eww-suggest-uris)
       (let ((ret (funcall fun)))
 	(dolist (uri (if (stringp ret) (list ret) ret))
-	  (when (and uri (not (intern-soft uri obseen)))
+	  (when (and uri (stringp uri) (not (intern-soft uri obseen)))
 	    (intern uri obseen)
 	    (push   uri uris)))))
     (nreverse uris)))
-- 
2.35.1