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

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

[nongnu] elpa/annotate 936f081575 005/372: doesn't create empty annotati


From: ELPA Syncer
Subject: [nongnu] elpa/annotate 936f081575 005/372: doesn't create empty annotations any more
Date: Fri, 4 Feb 2022 16:58:14 -0500 (EST)

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

    doesn't create empty annotations any more
---
 annotate.el | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/annotate.el b/annotate.el
index 9fcca73634..34b269a3dc 100644
--- a/annotate.el
+++ b/annotate.el
@@ -40,12 +40,13 @@
   (let ((highlight (make-overlay start end))
         (annotation (read-from-minibuffer "Annotation: "))
         (prefix (make-string (- annotate-annotation-column 
(annotate-line-length)) ? )))
-    (overlay-put highlight 'face annotate-highlight-face)
-    (overlay-put highlight 'annotation annotation)
-    (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")))))
+    (when (not (string= "" annotation))
+      (overlay-put highlight 'face annotate-highlight-face)
+      (overlay-put highlight 'annotation annotation)
+      (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-change-annotation (pos)
   "Change annotation at point. If empty, delete annotation."



reply via email to

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