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

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

[nongnu] elpa/why-this 71baf80f9a 42/59: Don't use overlays while annona


From: ELPA Syncer
Subject: [nongnu] elpa/why-this 71baf80f9a 42/59: Don't use overlays while annonating
Date: Sun, 27 Nov 2022 16:02:53 -0500 (EST)

branch: elpa/why-this
commit 71baf80f9ae7c1117f3b1bf531e23e43bf567424
Author: Akib Azmain Turja <akib@disroot.org>
Commit: Akib Azmain Turja <akib@disroot.org>

    Don't use overlays while annonating
---
 why-this.el | 41 +++++++++++++++++++----------------------
 1 file changed, 19 insertions(+), 22 deletions(-)

diff --git a/why-this.el b/why-this.el
index b2cdb74789..4837d08ce2 100644
--- a/why-this.el
+++ b/why-this.el
@@ -588,23 +588,22 @@ Actually the supported backend is returned."
              (last-change-begin 0)
              (add-heat
               (lambda ()
-                (let (ov)
-                  (setq ov (make-overlay last-change-begin (point)))
-                  (overlay-put ov 'face
-                               `(:background
-                                 ,(why-this--mix-colors
-                                   why-this-annotate-heat-map-cold
-                                   why-this-annotate-heat-map-warm
-                                   (if (equal newest-change
-                                              oldest-change)
-                                       0.5
-                                     (/ (- (float-time
-                                            (plist-get (nth (1- i) data)
-                                                       :time))
-                                           oldest-change)
-                                        (- newest-change
-                                           oldest-change))))
-                                 :extend t))))))
+                (add-face-text-property
+                 last-change-begin (point)
+                 `(:background ,(why-this--mix-colors
+                                 why-this-annotate-heat-map-cold
+                                 why-this-annotate-heat-map-warm
+                                 (if (equal newest-change
+                                            oldest-change)
+                                     0.5
+                                   (/ (- (float-time
+                                          (plist-get (nth (1- i) data)
+                                                     :time))
+                                         oldest-change)
+                                      (- newest-change
+                                         oldest-change))))
+                               :extend t)
+                 t))))
         (with-current-buffer (get-buffer-create
                               (format "*why-this-annotate %s*"
                                       (buffer-name)))
@@ -625,12 +624,10 @@ Actually the supported backend is returned."
                  (nth i contents)
                  "\n")
               (unless (zerop i)
-                (let (ov)
-                  (setq ov (make-overlay (line-beginning-position 0)
-                                         (point)))
-                  (overlay-put ov 'face `(:underline
+                (add-face-text-property (line-beginning-position 0) (point)
+                                        `(:underline
                                           ,(face-foreground 'default)
-                                          :extend t)))
+                                          :extend t))
                 (when why-this-annotate-enable-heat-map
                   (funcall add-heat)))
               (setq last-change-begin (point))



reply via email to

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