[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/annotate 4bd488a5ca 2/7: - added command 'annotate-toggle-
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/annotate 4bd488a5ca 2/7: - added command 'annotate-toggle-all-annotations-text'; |
Date: |
Fri, 10 Mar 2023 10:00:43 -0500 (EST) |
branch: elpa/annotate
commit 4bd488a5ca0b8a5a862acf3fc41fdfa74d491d82
Author: cage <cage>
Commit: cage <cage@invalid>
- added command 'annotate-toggle-all-annotations-text';
- removed customizable variable 'annotate-hide-annotations-text'.
---
annotate.el | 26 +++++++++++++++-----------
1 file changed, 15 insertions(+), 11 deletions(-)
diff --git a/annotate.el b/annotate.el
index 2b9ccbd465..683ff2efe1 100644
--- a/annotate.el
+++ b/annotate.el
@@ -248,11 +248,6 @@ of lines. The center of the region is the position of the
annotation as defined in the database."
:type 'number)
-(defcustom annotate-hide-annotations-text nil
- "Whether the text shuld not be rendered in the buffer, default
-is nil"
- :type 'boolean)
-
(defconst annotate-prop-chain-position
'position)
@@ -829,13 +824,22 @@ specified by `FROM' and `TO'."
(annotate-annotate)))))))))))))))
(defun annotate-toggle-annotation-text ()
+ "Hide annotation's text at current cursor's point, if such annotation exists"
+ (interactive)
+ (when-let* ((chain (annotate-chain-at (point)))
+ (last-ring (car (last chain))))
+ (if (annotate-tail-overlay-hide-text-p last-ring)
+ (annotate-chain-show-text chain)
+ (annotate-chain-hide-text chain))
+ (font-lock-flush)))
+
+(defun annotate-toggle-all-annotations-text ()
(interactive)
- (setf annotate-hide-annotations-text (not annotate-hide-annotations-text))
(let ((chains (annotate-annotations-chain-in-range 0 (buffer-size))))
(dolist (chain chains)
- (if annotate-hide-annotations-text
- (annotate-chain-hide-text chain)
- (annotate-chain-show-text chain))))
+ (if (annotate-tail-overlay-hide-text-p (car (last chain)))
+ (annotate-chain-show-text chain)
+ (annotate-chain-hide-text chain))))
(font-lock-flush))
(cl-defun annotate-goto-next-annotation (&key (startingp t))
@@ -2033,11 +2037,11 @@ in a chain of annotations as last."
(annotate-find-chain (annotate-annotation-at pos)))
(defun annotate-chain-hide-text (chain)
- (let ((last-ring (annotate-chain-last (cl-first chain))))
+ (let ((last-ring (car (last chain))))
(overlay-put last-ring 'hide-text t)))
(defun annotate-chain-show-text (chain)
- (let ((last-ring (annotate-chain-last (cl-first chain))))
+ (let ((last-ring (car (last chain))))
(overlay-put last-ring 'hide-text nil)))
(defun annotate-chain-hide-text-p (chain)
- [nongnu] elpa/annotate updated (e433ec6803 -> 265ac1a905), ELPA Syncer, 2023/03/10
- [nongnu] elpa/annotate 68ae53c922 1/7: - added a new command 'annotate-toggle-annotation-text' (and related functions/variables)., ELPA Syncer, 2023/03/10
- [nongnu] elpa/annotate 265ac1a905 7/7: Merge pull request #150 from cage2/hide-annotation-text, ELPA Syncer, 2023/03/10
- [nongnu] elpa/annotate e447a2f817 4/7: - added missing docstrings., ELPA Syncer, 2023/03/10
- [nongnu] elpa/annotate ef82c4313b 3/7: - wrapped raw chain manipulation with 'annotate-chain-last-ring' to get the last segment of a chain., ELPA Syncer, 2023/03/10
- [nongnu] elpa/annotate 44349cef8b 6/7: - increased version number;, ELPA Syncer, 2023/03/10
- [nongnu] elpa/annotate 4bd488a5ca 2/7: - added command 'annotate-toggle-all-annotations-text';,
ELPA Syncer <=
- [nongnu] elpa/annotate 3f3444cd18 5/7: - removed repeated code., ELPA Syncer, 2023/03/10