diff options
author | Lars Ingebrigtsen <larsi@gnus.org> | 2022-09-13 14:31:59 +0200 |
---|---|---|
committer | Lars Ingebrigtsen <larsi@gnus.org> | 2022-09-13 14:33:20 +0200 |
commit | 280b40cd8a46b325768f757ae9b50064524a46e1 (patch) | |
tree | 4a197e8adc6437368b6c54da7254236784adeb79 /lisp | |
parent | b2329fbbe4e694e32c391dd5009f17f72b45e0f2 (diff) | |
download | emacs-280b40cd8a46b325768f757ae9b50064524a46e1.tar.gz emacs-280b40cd8a46b325768f757ae9b50064524a46e1.tar.bz2 emacs-280b40cd8a46b325768f757ae9b50064524a46e1.zip |
Enable undo in eww buffers
* lisp/net/eww.el (eww-render): Enable undo after rendering. This
allows using `undo' in text input boxes.
(eww-setup-buffer): Disable undo before rendering (bug#57750).
* lisp/net/shr.el (shr-image-fetched): Inhibit undo tracking.
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/net/eww.el | 8 | ||||
-rw-r--r-- | lisp/net/shr.el | 2 |
2 files changed, 8 insertions, 2 deletions
diff --git a/lisp/net/eww.el b/lisp/net/eww.el index 6ed0719eca6..35e5bdd7342 100644 --- a/lisp/net/eww.el +++ b/lisp/net/eww.el @@ -626,7 +626,10 @@ The renaming scheme is performed in accordance with (setq eww-history-position 0) (and last-coding-system-used (set-buffer-file-coding-system last-coding-system-used)) - (run-hooks 'eww-after-render-hook))) + (run-hooks 'eww-after-render-hook) + ;; Enable undo again so that undo works in text input + ;; boxes. + (setq buffer-undo-list nil))) (kill-buffer data-buffer)))) (defun eww-parse-headers () @@ -928,7 +931,8 @@ The renaming scheme is performed in accordance with ;; May be set later if there's a next/prev link. (setq-local multi-isearch-next-buffer-function nil) (unless (eq major-mode 'eww-mode) - (eww-mode))) + (eww-mode)) + (buffer-disable-undo)) (defun eww-current-url nil "Return URI of the Web page the current EWW buffer is visiting." diff --git a/lisp/net/shr.el b/lisp/net/shr.el index 248faeb223c..a06978d9ce0 100644 --- a/lisp/net/shr.el +++ b/lisp/net/shr.el @@ -1019,6 +1019,8 @@ the mouse click event." (widen) (let ((alt (buffer-substring start end)) (properties (text-properties-at start)) + ;; We don't want to record these changes. + (buffer-undo-list t) (inhibit-read-only t)) (delete-region start end) (goto-char start) |