emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/ement 64972dcccd 2/3: Change: Disable undo in formattin


From: ELPA Syncer
Subject: [elpa] externals/ement 64972dcccd 2/3: Change: Disable undo in formatting buffers
Date: Sun, 24 Sep 2023 03:58:14 -0400 (EDT)

branch: externals/ement
commit 64972dcccddda6b5f15cc4d6a79adb3b99f3853e
Author: Adam Porter <adam@alphapapa.net>
Commit: Adam Porter <adam@alphapapa.net>

    Change: Disable undo in formatting buffers
---
 ement-room.el | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/ement-room.el b/ement-room.el
index 56da26672a..ae9a4f9b8e 100644
--- a/ement-room.el
+++ b/ement-room.el
@@ -3375,14 +3375,18 @@ Format defaults to `ement-room-message-format-spec', 
which see."
         (left-margin-width ement-room-left-margin-width)
         (right-margin-width ement-room-right-margin-width))
     ;; Copied from `format-spec'.
-    (with-current-buffer (get-buffer-create " *ement-room--format-message*")
+    (with-current-buffer
+        (or (get-buffer " *ement-room--format-message*")
+            (with-current-buffer (get-buffer-create " 
*ement-room--format-message*")
+              (setq buffer-undo-list t)
+              (current-buffer)))
+      (erase-buffer)
       ;; Pretend this is a room buffer.
       (setf ement-session session
             ement-room room)
       ;; HACK: Setting these buffer-locally in a temp buffer is ugly.
       (setq-local ement-room-left-margin-width left-margin-width)
       (setq-local ement-room-right-margin-width right-margin-width)
-      (erase-buffer)
       (insert format)
       (goto-char (point-min))
       (while (search-forward "%" nil t)
@@ -3513,7 +3517,11 @@ If FORMATTED-P, return the formatted body content, when 
available."
 (defun ement-room--render-html (string)
   "Return rendered version of HTML STRING.
 HTML is rendered to Emacs text using `shr-insert-document'."
-  (with-current-buffer (get-buffer-create " *ement-room--render-html*")
+  (with-current-buffer
+      (or (get-buffer " *ement-room--render-html*")
+          (with-current-buffer (get-buffer-create " *ement-room--render-html*")
+            (setq buffer-undo-list t)
+            (current-buffer)))
     (erase-buffer)
     (insert string)
     (save-excursion



reply via email to

[Prev in Thread] Current Thread [Next in Thread]