branch: elpa/annotate commit 936f0815753022e61411bad288d4e6f7838b45f2 Author: Bastian Bechtold <ba...@bastibe.de> Commit: Bastian Bechtold <ba...@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."