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