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

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

[nongnu] elpa/annotate aa075cfe04 002/372: change annotation display fro


From: ELPA Syncer
Subject: [nongnu] elpa/annotate aa075cfe04 002/372: change annotation display from overlay to property
Date: Fri, 4 Feb 2022 16:58:14 -0500 (EST)

branch: elpa/annotate
commit aa075cfe04253cc0c7c7d494819dc31fd03c4630
Author: Bastian Bechtold <basti@bastibe.de>
Commit: Bastian Bechtold <basti@bastibe.de>

    change annotation display from overlay to property
---
 annotate.el | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/annotate.el b/annotate.el
index 454ec84b99..2270512319 100644
--- a/annotate.el
+++ b/annotate.el
@@ -26,15 +26,14 @@
 (defun annotate-create-annotation (start end &optional arg)
   "Create a new annotation for selected region."
   (interactive "r")
-  (let* ((overlay-highlight (make-overlay start end))
-         (eol (save-excursion (move-end-of-line nil) (point)))
-         (overlay-eol (make-overlay eol eol))
-         (prefix (make-string (- annotate-annotation-column 
(annotate-line-length)) ? )))
+  (let ((overlay-highlight (make-overlay start end))
+        (annotation (read-from-minibuffer "Annotation: "))
+        (prefix (make-string (- annotate-annotation-column 
(annotate-line-length)) ? )))
     (overlay-put overlay-highlight 'face annotate-highlight-face)
-    (overlay-put overlay-eol 'after-string
-                 (concat prefix (propertize
-                                 (read-from-minibuffer "Annotation: ")
-                                 'face annotate-annotation-face)))))
+    (setq annotation (propertize annotation 'face annotate-annotation-face))
+    (save-excursion
+      (move-end-of-line nil)
+      (put-text-property (point) (1+ (point)) 'display (concat prefix 
annotation "\n")))))
 
 (defun annotate-line-length ()
   "The length of the line from beginning to end."



reply via email to

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