unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Visuwesh <visuweshm@gmail.com>
To: 56366@debbugs.gnu.org
Subject: bug#56366: 29.0.50; eww: Exclude radio links when suggesting URIs
Date: Sun, 03 Jul 2022 13:09:21 +0530	[thread overview]
Message-ID: <87mtdqlk5y.fsf@gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1124 bytes --]

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?


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Exclude-radio-buttons-when-suggesting-URI-in-eww.patch --]
[-- Type: text/x-diff, Size: 851 bytes --]

From d298c556dbe3b1391a3fa9b93cc276fd3c531c48 Mon Sep 17 00:00:00 2001
From: Visuwesh <visuweshm@gmail.com>
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


             reply	other threads:[~2022-07-03  7:39 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-03  7:39 Visuwesh [this message]
2022-07-03 12:33 ` bug#56366: 29.0.50; eww: Exclude radio links when suggesting URIs Lars Ingebrigtsen
2022-07-03 13:23   ` Visuwesh
2022-07-03 13:29     ` Lars Ingebrigtsen
2022-07-03 13:39       ` Visuwesh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87mtdqlk5y.fsf@gmail.com \
    --to=visuweshm@gmail.com \
    --cc=56366@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).