[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/annotate cb8212830d 317/372: - added feature when the cust
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/annotate cb8212830d 317/372: - added feature when the customizable variable |
Date: |
Fri, 4 Feb 2022 16:59:15 -0500 (EST) |
branch: elpa/annotate
commit cb8212830da5b723f4ad03809588ad25715c024a
Author: cage <cage@invalid>
Commit: cage <cage@invalid>
- added feature when the customizable variable
`annotate-endline-annotate-whole-line' is not nil (default t), and
the user try to annotate a newline the whole line is annotated
instead (or the next if the line is empty).
If `annotate-endline-annotate-whole-line' is nil annotating a
newline will signal an error.
---
annotate.el | 32 +++++++++++++++++++++++++++++---
1 file changed, 29 insertions(+), 3 deletions(-)
diff --git a/annotate.el b/annotate.el
index a94379bee0..af88620e76 100644
--- a/annotate.el
+++ b/annotate.el
@@ -198,6 +198,13 @@ has been modified outside Emacs."
:type 'boolean
:group 'annotate)
+(defcustom annotate-endline-annotate-whole-line t
+ "Whether trying to annotate the end of line character will
+annotate the whole line before (or after if the line is composed
+by the newline character only) instead."
+ :type 'boolean
+ :group 'annotate)
+
(defconst annotate-prop-chain-position
'position)
@@ -586,7 +593,13 @@ specified by `from' and `to'."
(when (annotate-annotation-at (1- chain-end))
(annotate--cut-left-annotation last-of-chain-to-cut)))
(when delete-enclosed
- (annotate-delete-chains-in-region chain-end
region-stop)))))
+ (annotate-delete-chains-in-region chain-end region-stop))))
+ (annotate-line (eol)
+ (let* ((bol (annotate-beginning-of-line-pos)))
+ (goto-char bol)
+ (set-mark (point))
+ (goto-char eol)
+ (annotate-annotate))))
(let ((annotation (annotate-annotation-at (point))))
(cond
((use-region-p)
@@ -631,8 +644,21 @@ specified by `from' and `to'."
(if (annotate--position-on-annotated-text-p (point))
(signal 'annotate-annotate-region-overlaps nil)
(let ((char-maybe-newline (char-after)))
- (when (not (char-equal char-maybe-newline ?\n))
- (create-new-annotation))))))
+ (when char-maybe-newline
+ (cond
+ ((not (char-equal char-maybe-newline ?\n))
+ (create-new-annotation))
+ ((null annotate-endline-annotate-whole-line)
+ (user-error "The end of line can not be annotated"))
+ (t ;; annotate the whole line before or after
+ (save-excursion
+ (let* ((bol (annotate-beginning-of-line-pos))
+ (eol (point)))
+ (if (/= eol bol)
+ (annotate-line eol)
+ (progn
+ (goto-char (1+ eol))
+ (annotate-annotate))))))))))))
(set-buffer-modified-p t))))
(cl-defun annotate-goto-next-annotation (&key (startingp t))
- [nongnu] elpa/annotate 2ccdad1504 193/372: - starting with a new method to render multiline annotations, (continued)
- [nongnu] elpa/annotate 2ccdad1504 193/372: - starting with a new method to render multiline annotations, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 71f316be2f 236/372: - added dependency on 'info'., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 7a96192be2 248/372: - according to documentation the secon argument of 'signal' must be a list., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate f2b085d279 288/372: - fixed typos., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 26ea8e3631 266/372: - prevented getting shared value for 'annotate-file' in '%load-annotation-data'., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate b505af0f27 300/372: - updated NEWS, Changelog and version number., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 17958167da 298/372: Merge pull request #96 from cage2/master, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 784df37cba 313/372: - updated version number., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 9cdc2a90fb 350/372: - added prompt to confirm deletion also when deleting annotation's text;, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 3e0d5f39b2 302/372: Merge pull request #98 from cage2/master, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate cb8212830d 317/372: - added feature when the customizable variable,
ELPA Syncer <=
- [nongnu] elpa/annotate ff3a0089e0 330/372: Merge pull request #102 from cage2/prevent-prompt-annotating-newline, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 1a09f78be9 322/372: - added comments to local functions of 'annotate-annotate'., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 1e7bc9c886 364/372: - updated Changelog., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 5bc3415d56 353/372: - used 'yes-or-no-p' (customizable via a variable) to ask for deletion confirm., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate eaf96d584f 349/372: - added confirmation prompt before delete an annotation., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate e37820134f 332/372: - updated NEWS, Changelog and version number., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 2f4cbcdb3d 324/372: - fixed indentation., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate c737b516b8 361/372: Merge pull request #114 from cage2/master, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate f65d10ac99 008/372: improve faces, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate f31eddb523 044/372: fixed bug with annotation on bol, ELPA Syncer, 2022/02/04