From: Lars Ingebrigtsen Date: Fri, 25 Dec 2015 05:47:28 +0000 (+0100) Subject: Make toggling checkboxes work again X-Git-Tag: emacs-26.0.90~2873 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=5e56f606952e5e81b4d3a93ea70e791b74b33041;p=emacs.git Make toggling checkboxes work again * eww.el (eww-update-field): Make toggling checkboxes work again (bug#21881). --- diff --git a/lisp/net/eww.el b/lisp/net/eww.el index 8ea17e01018..65ff733726d 100644 --- a/lisp/net/eww.el +++ b/lisp/net/eww.el @@ -1181,16 +1181,19 @@ See URL `https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Input'.") (eww-update-field display)))) (defun eww-update-field (string &optional offset) - (if (not offset) (setq offset 0)) + (unless offset + (setq offset 0)) (let ((properties (text-properties-at (point))) (start (+ (eww-beginning-of-field) offset)) (current-end (1+ (eww-end-of-field))) - (new-end (1+ (+ (eww-beginning-of-field) (length string))))) + (new-end (+ (eww-beginning-of-field) (length string))) + (inhibit-read-only t)) (delete-region start current-end) (forward-char offset) (insert string (make-string (- (- (+ new-end offset) start) (length string)) ? )) - (if (= 0 offset) (set-text-properties start new-end properties)) + (when (= 0 offset) + (set-text-properties start new-end properties)) start)) (defun eww-toggle-checkbox ()