[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/annotate 6b4b2b69d7 023/372: can now annotate long lines
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/annotate 6b4b2b69d7 023/372: can now annotate long lines |
Date: |
Fri, 4 Feb 2022 16:58:16 -0500 (EST) |
branch: elpa/annotate
commit 6b4b2b69d78accf7f82d61a196b2c00977f8a2a9
Author: Bastian Bechtold <bb@mo30211.hs-woe.de>
Commit: Bastian Bechtold <bb@mo30211.hs-woe.de>
can now annotate long lines
---
annotate.el | 24 +++++++++++++-----------
1 file changed, 13 insertions(+), 11 deletions(-)
diff --git a/annotate.el b/annotate.el
index 0c2ad57500..01dbd4c90b 100644
--- a/annotate.el
+++ b/annotate.el
@@ -5,7 +5,7 @@
;; Maintainer: Bastian Bechtold
;; URL: https://github.com/bastibe/annotate.el
;; Created: 2015-06-10
-;; Version: 0.1.4
+;; Version: 0.1.5
;; This file is NOT part of GNU Emacs.
@@ -46,7 +46,7 @@
;;;###autoload
(defgroup annotate nil
"Annotate files without changing them."
- :version "0.1.4"
+ :version "0.1.5"
:group 'text)
;;;###autoload
@@ -145,8 +145,7 @@
(setq text (propertize text 'face 'annotate-annotation))
(goto-char end)
(move-end-of-line nil)
- (let ((prefix (make-string (- annotate-annotation-column
- (annotate-line-length)) ? )))
+ (let ((prefix (annotate-make-prefix)))
(put-text-property (point)
(1+ (point))
'display
@@ -169,8 +168,7 @@
(defun annotate-create-annotation (start end)
"Create a new annotation for selected region."
(let ((annotation (read-from-minibuffer "Annotation: "))
- (prefix (make-string (- annotate-annotation-column
- (annotate-line-length)) ? )))
+ (prefix (annotate-make-prefix)))
(when (not (or (eq nil annotation) (string= "" annotation)))
(let ((highlight (make-overlay start end)))
(overlay-put highlight 'face 'annotate-highlight)
@@ -186,7 +184,7 @@
"Change annotation at point. If empty, delete annotation."
(let* ((highlight (car (overlays-at pos)))
(annotation (read-from-minibuffer "Annotation: " (overlay-get
highlight 'annotation)))
- (prefix (make-string (- annotate-annotation-column
(annotate-line-length)) ? )))
+ (prefix (annotate-make-prefix)))
(save-excursion
(goto-char (overlay-end highlight))
(move-end-of-line nil)
@@ -203,13 +201,17 @@
(setq annotation (propertize annotation 'face 'annotate-annotation))
(put-text-property (point) (1+ (point)) 'display (concat prefix
annotation "\n")))))))
-(defun annotate-line-length ()
- "The length of the line from beginning to end."
+(defun annotate-make-prefix ()
+ "An empty string from the end of the line upto the annotation."
(save-excursion
(move-end-of-line nil)
- (let ((eol (point)))
+ (let ((eol (point))
+ (prefix-length nil))
(move-beginning-of-line nil)
- (- eol (point)))))
+ (setq prefix-length (- annotate-annotation-column (- eol (point))))
+ (if (< prefix-length 2)
+ (make-string 2 ? )
+ (make-string prefix-length ? )))))
(defun annotate-bounds ()
"The bounds of the region or whatever is at point."
- [nongnu] elpa/annotate 7893fb3060 261/372: - updated README., (continued)
- [nongnu] elpa/annotate 7893fb3060 261/372: - updated README., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate c103381862 280/372: - moved 'save-match-data' from the function that calls, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 3b871f10f9 290/372: - prevented side effects of 'split-string', ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate f3ace011a2 286/372: - changed customizable variable related to exporting., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate d4eff870d9 292/372: Merge pull request #93 from cage2/master, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 58525eb73a 307/372: - changed function calls from 'cl' package to the 'cl-lib' equivalents., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 4abf492f05 297/372: - updated NEWS and CHANGELOG;, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate faa9245414 329/372: - increased version number and updated documentations., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 7eee85f7f9 070/372: - made the character under the annotated text (when exporting or integrating), ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 6d74f53074 015/372: improve documentation and add license, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 6b4b2b69d7 023/372: can now annotate long lines,
ELPA Syncer <=
- [nongnu] elpa/annotate 39fc4bbda2 090/372: - added an annotation summary window, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate d84bfd56b8 103/372: Merge pull request #44 from cage2/master, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 253b5e2d7b 118/372: - try to elaborate a bit more the function goal., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate f806eff4cc 142/372: Merge pull request #49 from cage2/annotate-info-files, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 40bd336a96 037/372: fix cl-related errors, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate e199c77598 027/372: export format is now a valid unified diff, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate e8c9b33b4d 051/372: fix unicode annotations, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 676d9863f9 048/372: fix undo bug, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 4dc3e70920 059/372: fixes bug for too-wide characters, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate cb8de5081a 078/372: Merge pull request #42 from cage2/master, ELPA Syncer, 2022/02/04