]> git.eshelyaron.com Git - emacs.git/commitdiff
Enable undo in eww buffers
authorLars Ingebrigtsen <larsi@gnus.org>
Tue, 13 Sep 2022 12:31:59 +0000 (14:31 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Tue, 13 Sep 2022 12:33:20 +0000 (14:33 +0200)
* 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.

lisp/net/eww.el
lisp/net/shr.el

index 6ed0719eca6a12ec8c319e640d06392c58bf1317..35e5bdd734298151672a099cc5456a67d012bd41 100644 (file)
@@ -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."
index 248faeb223c057630c128607f3cf13e9624e3730..a06978d9ce0223c92a5e1208a85c75b7e3c4d4d6 100644 (file)
@@ -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)