diff options
author | Lars Ingebrigtsen <larsi@gnus.org> | 2020-09-06 02:02:42 +0200 |
---|---|---|
committer | Lars Ingebrigtsen <larsi@gnus.org> | 2020-09-06 02:02:42 +0200 |
commit | ccd5f0d0a99f93c5507c888b5a0c1a5af2d89106 (patch) | |
tree | 2eb1b9f9db89fa98ab9af90fb504c6d523592d94 /lisp | |
parent | 585fe00557489e49188b6a301f001ef01ff15dcb (diff) | |
download | emacs-ccd5f0d0a99f93c5507c888b5a0c1a5af2d89106.tar.gz emacs-ccd5f0d0a99f93c5507c888b5a0c1a5af2d89106.tar.bz2 emacs-ccd5f0d0a99f93c5507c888b5a0c1a5af2d89106.zip |
Fix eww-change-select defaults in a different way
* lisp/net/eww.el (eww-change-select): Fix bug#43218 in a more
safe way than the previous version.
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/net/eww.el | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/lisp/net/eww.el b/lisp/net/eww.el index b800d1890fe..4b897fa34e6 100644 --- a/lisp/net/eww.el +++ b/lisp/net/eww.el @@ -1450,14 +1450,13 @@ See URL `https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Input'.") (cons (plist-get (cdr elem) :display) (plist-get (cdr elem) :value)))) input))) - (display - (completing-read "Change value: " options nil 'require-match - nil nil (car (rassoc (plist-get input :value) - options)))) + (display (completing-read "Change value: " options nil 'require-match)) (inhibit-read-only t)) - (plist-put input :value (cdr (assoc-string display options t))) - (goto-char - (eww-update-field display)))) + ;; If the user doesn't enter anything, don't change anything. + (when (> (length display) 0) + (plist-put input :value (cdr (assoc-string display options t))) + (goto-char + (eww-update-field display))))) (defun eww-update-field (string &optional offset) (unless offset |