* bug#56366: 29.0.50; eww: Exclude radio links when suggesting URIs
@ 2022-07-03 7:39 Visuwesh
2022-07-03 12:33 ` Lars Ingebrigtsen
0 siblings, 1 reply; 5+ messages in thread
From: Visuwesh @ 2022-07-03 7:39 UTC (permalink / raw)
To: 56366
[-- 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
^ permalink raw reply related [flat|nested] 5+ messages in thread
* bug#56366: 29.0.50; eww: Exclude radio links when suggesting URIs
2022-07-03 7:39 bug#56366: 29.0.50; eww: Exclude radio links when suggesting URIs Visuwesh
@ 2022-07-03 12:33 ` Lars Ingebrigtsen
2022-07-03 13:23 ` Visuwesh
0 siblings, 1 reply; 5+ messages in thread
From: Lars Ingebrigtsen @ 2022-07-03 12:33 UTC (permalink / raw)
To: Visuwesh; +Cc: 56366
Visuwesh <visuweshm@gmail.com> writes:
> The attached patch fixes the error but maybe the right place to fix it
> is in eww-links-at-point?
Yes, I think that would be better.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
^ permalink raw reply [flat|nested] 5+ messages in thread
* bug#56366: 29.0.50; eww: Exclude radio links when suggesting URIs
2022-07-03 12:33 ` Lars Ingebrigtsen
@ 2022-07-03 13:23 ` Visuwesh
2022-07-03 13:29 ` Lars Ingebrigtsen
0 siblings, 1 reply; 5+ messages in thread
From: Visuwesh @ 2022-07-03 13:23 UTC (permalink / raw)
To: Lars Ingebrigtsen; +Cc: 56366
[-- Attachment #1: Type: text/plain, Size: 297 bytes --]
[ஞாயிறு ஜூலை 03, 2022] Lars Ingebrigtsen wrote:
> Visuwesh <visuweshm@gmail.com> writes:
>
>> The attached patch fixes the error but maybe the right place to fix it
>> is in eww-links-at-point?
>
> Yes, I think that would be better.
How about the attached patch?
[-- 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: 754 bytes --]
From a3e3755efc251b10a3f95985e6021022845f71eb Mon Sep 17 00:00:00 2001
From: Visuwesh <visuweshm@gmail.com>
Date: Sun, 3 Jul 2022 18:47:44 +0530
Subject: [PATCH] Exclude radio buttons when suggesting URI in eww
* lisp/net/eww.el (eww-links-at-point): Exclude radio links.
(bug#56366)
---
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..b4606d0221 100644
--- a/lisp/net/eww.el
+++ b/lisp/net/eww.el
@@ -932,7 +932,7 @@ eww-current-url
(defun eww-links-at-point ()
"Return list of URIs, if any, linked at point."
- (remq nil
+ (seq-filter #'stringp
(list (get-text-property (point) 'shr-url)
(get-text-property (point) 'image-url))))
--
2.35.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* bug#56366: 29.0.50; eww: Exclude radio links when suggesting URIs
2022-07-03 13:23 ` Visuwesh
@ 2022-07-03 13:29 ` Lars Ingebrigtsen
2022-07-03 13:39 ` Visuwesh
0 siblings, 1 reply; 5+ messages in thread
From: Lars Ingebrigtsen @ 2022-07-03 13:29 UTC (permalink / raw)
To: Visuwesh; +Cc: 56366
Visuwesh <visuweshm@gmail.com> writes:
> How about the attached patch?
Thanks; pushed to Emacs 29.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
^ permalink raw reply [flat|nested] 5+ messages in thread
* bug#56366: 29.0.50; eww: Exclude radio links when suggesting URIs
2022-07-03 13:29 ` Lars Ingebrigtsen
@ 2022-07-03 13:39 ` Visuwesh
0 siblings, 0 replies; 5+ messages in thread
From: Visuwesh @ 2022-07-03 13:39 UTC (permalink / raw)
To: Lars Ingebrigtsen; +Cc: 56366
[ஞாயிறு ஜூலை 03, 2022] Lars Ingebrigtsen wrote:
> Visuwesh <visuweshm@gmail.com> writes:
>
>> How about the attached patch?
>
> Thanks; pushed to Emacs 29.
Thanks!
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2022-07-03 13:39 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-07-03 7:39 bug#56366: 29.0.50; eww: Exclude radio links when suggesting URIs Visuwesh
2022-07-03 12:33 ` Lars Ingebrigtsen
2022-07-03 13:23 ` Visuwesh
2022-07-03 13:29 ` Lars Ingebrigtsen
2022-07-03 13:39 ` Visuwesh
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).