From 09dc864b0b86e6db292b51983db7086d7a5cc53c Mon Sep 17 00:00:00 2001 From: Aidan Coyle Date: Wed, 29 Apr 2026 11:17:44 -0500 Subject: [PATCH] Fix eww-submit for forms with no action (bug#80918) * lisp/net/eww.el (eww-submit): If a form does not specify an action the assumed action is the current URL. If the current URL has an existing query part, that part must be replaced by the form values, rather than appended to. Copyright-paperwork-exempt: yes --- lisp/net/eww.el | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lisp/net/eww.el b/lisp/net/eww.el index 70d70185688..9acbaa52fa9 100644 --- a/lisp/net/eww.el +++ b/lisp/net/eww.el @@ -2246,11 +2246,12 @@ Interactively, EVENT is the value of `last-nonmenu-event'." (plist-get eww-data :url))))))) (eww-browse-url (concat - (if (cdr (assq :action form)) - (shr-expand-url (cdr (assq :action form)) (plist-get eww-data :url)) - (plist-get eww-data :url)) - "?" - (mm-url-encode-www-form-urlencoded values)))))) + (shr-expand-url + (or (cdr (assq :action form)) + (car (url-path-and-query (url-generic-parse-url (plist-get eww-data :url))))) + (plist-get eww-data :url)) + "?" + (mm-url-encode-www-form-urlencoded values)))))) (defun eww-browse-with-external-browser (&optional url) "Browse the current URL with an external browser.