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

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

[elpa] externals/comint-mime e7c847a 6/8: Fix interaction between HTML r


From: ELPA Syncer
Subject: [elpa] externals/comint-mime e7c847a 6/8: Fix interaction between HTML rendering and process mark
Date: Mon, 18 Oct 2021 12:57:18 -0400 (EDT)

branch: externals/comint-mime
commit e7c847af897d14c560a7eceedc9bad2e51e87e55
Author: Augusto Stoffel <arstoffel@gmail.com>
Commit: Augusto Stoffel <arstoffel@gmail.com>

    Fix interaction between HTML rendering and process mark
---
 comint-mime.el | 27 +++++++++++++++------------
 1 file changed, 15 insertions(+), 12 deletions(-)

diff --git a/comint-mime.el b/comint-mime.el
index 9192bb1..9e3e03c 100644
--- a/comint-mime.el
+++ b/comint-mime.el
@@ -144,18 +144,21 @@ from `comint-mode', or interactively after starting the 
comint."
 (defun comint-mime-render-html (header data)
   "Render HTML from HEADER and DATA provided by `comint-mime-osc-handler'."
   (insert
-   (with-temp-buffer
-     (insert data)
-     (decode-coding-region (point-min) (point-max) 'utf-8)
-     (shr-render-region (point-min) (point-max))
-     ;; Don't let font-lock override those faces
-     (goto-char (point-min))
-     (let (match)
-       (while (setq match (text-property-search-forward 'face))
-         (put-text-property (prop-match-beginning match) (prop-match-end match)
-                            'font-lock-face (prop-match-value match))))
-     (put-text-property (point-min) (point-max) 'comint-mime header)
-     (buffer-string))))
+   ;; FIXME: This `save-excursion' is needed since the patch fixing
+   ;; bug#51009.  Is this reliable or are there better solutions?
+   (save-excursion
+     (with-temp-buffer
+       (insert data)
+       (decode-coding-region (point-min) (point-max) 'utf-8)
+       (shr-render-region (point-min) (point-max))
+       ;; Don't let font-lock override those faces
+       (goto-char (point-min))
+       (let (match)
+         (while (setq match (text-property-search-forward 'face))
+           (put-text-property (prop-match-beginning match) (prop-match-end 
match)
+                              'font-lock-face (prop-match-value match))))
+       (put-text-property (point-min) (point-max) 'comint-mime header)
+       (buffer-string)))))
 
 ;;;; LaTeX
 (autoload 'org-format-latex "org")



reply via email to

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