[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] scratch/with-url 2e0a3a6 5/6: Make form submission work wi
From: |
Lars Ingebrigtsen |
Subject: |
[Emacs-diffs] scratch/with-url 2e0a3a6 5/6: Make form submission work with with-url |
Date: |
Mon, 23 Jan 2017 20:42:28 +0000 (UTC) |
branch: scratch/with-url
commit 2e0a3a64ae981fbe30323a45db8bcb0b2e9b6f74
Author: Lars Ingebrigtsen <address@hidden>
Commit: Lars Ingebrigtsen <address@hidden>
Make form submission work with with-url
---
lisp/net/eww.el | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/lisp/net/eww.el b/lisp/net/eww.el
index 062d740..05e581b 100644
--- a/lisp/net/eww.el
+++ b/lisp/net/eww.el
@@ -283,7 +283,8 @@ word(s) will be searched for via `eww-search-prefix'."
(eww-setup-buffer)
(eww--fetch-url url))
-(cl-defun eww--fetch-url (url &key (method 'get) data point buffer encode)
+(cl-defun eww--fetch-url (url &key (method 'get) data point buffer encode
+ data-encoding)
;; Check whether the domain only uses "Highly Restricted" Unicode
;; IDNA characters. If not, transform to punycode to indicate that
;; there may be funny business going on.
@@ -299,7 +300,8 @@ word(s) will be searched for via `eww-search-prefix'."
(goto-char (point-min)))
(let ((buffer (or buffer (current-buffer))))
(with-url (url :method method
- :data data)
+ :data data
+ :data-encoding data-encoding)
(eww-render point buffer encode)))))
;;;###autoload (defalias 'browse-web 'eww)
@@ -1397,6 +1399,7 @@ See URL
`https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Input'.")
(push (cons (plist-get (cdr elem) :name)
(or (plist-get (cdr elem) :value) ""))
values)))
+ (eww-save-history)
(let ((inhibit-read-only t))
(erase-buffer))
(eww--fetch-url
@@ -1404,6 +1407,7 @@ See URL
`https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Input'.")
:method (if (cl-equalp (cdr (assq :method form)) "post")
'post
'get)
+ :data-encoding 'url-encode
:data values)))
(defun eww-browse-with-external-browser (&optional url)
- [Emacs-diffs] scratch/with-url updated (0013b14 -> 24f6e46), Lars Ingebrigtsen, 2017/01/23
- [Emacs-diffs] scratch/with-url 2e0a3a6 5/6: Make form submission work with with-url,
Lars Ingebrigtsen <=
- [Emacs-diffs] scratch/with-url 6ed787f 4/6: with-url now uses 'get, not "GET", Lars Ingebrigtsen, 2017/01/23
- [Emacs-diffs] scratch/with-url 386c924 1/6: Switch headers to symbols instead of strings, Lars Ingebrigtsen, 2017/01/23
- [Emacs-diffs] scratch/with-url 5745c3f 2/6: Use symbols for the get/post method instead of strings, Lars Ingebrigtsen, 2017/01/23
- [Emacs-diffs] scratch/with-url 20c089e 3/6: Default to no encoding in headers, Lars Ingebrigtsen, 2017/01/23
- [Emacs-diffs] scratch/with-url 24f6e46 6/6: Refactor the user-agent function for reuse, Lars Ingebrigtsen, 2017/01/23