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

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

[nongnu] elpa/popon 22e76f812c 14/15: Fix Eshell popon error


From: ELPA Syncer
Subject: [nongnu] elpa/popon 22e76f812c 14/15: Fix Eshell popon error
Date: Sun, 22 May 2022 12:59:19 -0400 (EDT)

branch: elpa/popon
commit 22e76f812c9baa919ceaaeb618b918967f7117d7
Author: Akib Azmain Turja <akib@disroot.org>
Commit: Akib Azmain Turja <akib@disroot.org>

    Fix Eshell popon error
---
 popon.el | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/popon.el b/popon.el
index c203fb2a4e..7348a09b41 100644
--- a/popon.el
+++ b/popon.el
@@ -88,7 +88,8 @@ shouldn't contain newlines.  Example:
     (\"found in the GNU General Public License\"               nil nil)
     (\"that comes with Emacs and also appears\"                nil nil)
     (\"in this manual(1).  See Copying.\"                      t nil))"
-  (let ((tab-size tab-width))
+  (let ((tab-size tab-width)
+        (inhibit-read-only t)) ; The text might have `read-only' property.
     (with-temp-buffer
       (setq-local tab-width tab-size) ; Preseve tab width.
       (dotimes (i (length lines))
@@ -331,6 +332,18 @@ when LINE-BEGINNINGS was calculated.")
                                 (cdr line)))
              (setq current-offset (car line)))
            (add-face-text-property 0 (length text) 'default 'append text)
+
+           ;; Pay attention to the `font-lock-face' property.
+           (when font-lock-mode
+             (let ((pos 0))
+               (while (< pos (length text))
+                 (let ((next-pos (or (next-single-property-change
+                                      pos 'font-lock-face text)
+                                     (length text))))
+                   (when-let ((face (get-pos-property pos 'font-lock-face
+                                                      text)))
+                     (add-face-text-property pos next-pos face nil text))
+                   (setq pos next-pos)))))
            text)))
       (when (and (cadr block)
                  (< (cdar block) (point-max))



reply via email to

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