[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/annotate 5b69043454 152/372: - added variable 'annotate-an
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/annotate 5b69043454 152/372: - added variable 'annotate-annotation-position-policy' |
Date: |
Fri, 4 Feb 2022 16:58:42 -0500 (EST) |
branch: elpa/annotate
commit 5b690434546fdc54a1f814cd8a43aae3a53d2534
Author: cage <cage-invalid@invalid>
Commit: cage <cage-invalid@invalid>
- added variable 'annotate-annotation-position-policy'
this customizable variable is used to decide where to place the
annotations: on a new line, on the right margin or based on
annotation length;
- added new line (\n) in the last annotation where needed).
---
annotate.el | 40 ++++++++++++++++++++++++++++++++--------
1 file changed, 32 insertions(+), 8 deletions(-)
diff --git a/annotate.el b/annotate.el
index 20d249d0cb..4e18e548b5 100644
--- a/annotate.el
+++ b/annotate.el
@@ -144,7 +144,19 @@ database is not filtered at all."
"The maximum `string-width` allowed for an annotation to be
placed on the right margin of the window instead of its own line
after the annotated text."
- :type 'number
+ :type 'number
+ :group 'annotate)
+
+(defcustom annotate-annotation-position-policy :by-length
+ "policy for annotation's position:
+ - :newline
+ always in a new-line
+ - :margin
+ always on right margin
+ - :by-length
+ decide by text's length
+"
+ :type 'symbol
:group 'annotate)
(defconst annotate-warn-file-changed-control-string
@@ -802,19 +814,31 @@ to 'maximum-width'."
'annotate-highlight
'annotate-highlight-secondary))
(annotation-long-p (> (string-width (overlay-get ov
'annotation))
-
annotate-annotation-max-size-not-place-new-line))
- (splitted-annotation (if annotation-long-p
+
annotate-annotation-max-size-not-place-new-line))
+ (position annotate-annotation-position-policy)
+ (position-new-line-p (cl-case position
+ (:new-line
+ t)
+ (:by-length
+ annotation-long-p)
+ (otherwise
+ nil)))
+ (splitted-annotation (if position-new-line-p
(list (overlay-get ov 'annotation))
(save-match-data
- (split-string (annotate-lineate
(overlay-get ov 'annotation)
+ (split-string (annotate-lineate
(overlay-get ov
+
'annotation)
(-
eol bol))
"\n"))))
- (annotation-stopper (if annotation-long-p
- ""
+ (annotation-stopper (if position-new-line-p
+ (if (= annotation-counter
+ (length overlays))
+ "\n"
+ "")
"\n")))
(cl-incf annotation-counter)
(overlay-put ov 'face face-highlight)
- (when annotation-long-p
+ (when position-new-line-p
(setf prefix-first " \n"))
(dolist (l splitted-annotation)
(setq text
@@ -823,7 +847,7 @@ to 'maximum-width'."
(propertize l 'face face)
annotation-stopper))
;; white space before for all but the first annotation line
- (if annotation-long-p
+ (if position-new-line-p
(setq prefix-first (concat prefix-first prefix-rest))
(setq prefix-first prefix-rest)))))
;; build facespec with the annotation text as display property
- [nongnu] elpa/annotate 1a43bfbb1e 061/372: fixes bug with annotations ending on beginning-of-line, (continued)
- [nongnu] elpa/annotate 1a43bfbb1e 061/372: fixes bug with annotations ending on beginning-of-line, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 9ffdc1f762 060/372: fix for annotations with wide characters, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 19acc501d8 086/372: - added/fixed more docstrings., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 774e643af4 081/372: - fixed retrocompatibility with old annotation file format., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 4d78e3f6d6 073/372: - restored spaces to comply with markdown syntax;, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 95da172588 056/372: readme improvement, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 54aefdec8d 114/372: Merge pull request #46 from cage2/master, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 201b4587dc 136/372: - made recongnizable code that refers to info file annotation (1/3), ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate fd2cd2d94d 139/372: - made text snippet in summary window, for info files, less messy., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 75d291a69f 141/372: - using 'annotate-with-inhibit-modification-hooks'., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 5b69043454 152/372: - added variable 'annotate-annotation-position-policy',
ELPA Syncer <=
- [nongnu] elpa/annotate 5b0bb094c9 166/372: - added known bug;, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 4972c555c6 171/372: - fixed version number., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 004aea92ea 179/372: - updated documentation;, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 490a935b18 186/372: Merge branch 'master' into org-mode-fix, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 947e93a067 204/372: Merge branch 'master' into org-mode-fix, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate df704cc033 205/372: Merge branch 'master' into rethink-multiline-annotations, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 9a9227f154 208/372: - changed function names:, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 6cc6ac8872 210/372: Merge pull request #61 from cage2/org-mode-fix, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 754db391fd 230/372: - updated section 'known bugs' of README., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 553116dc61 239/372: - added missing unquote in macro 'annotate-with-restore-modified-bit'., ELPA Syncer, 2022/02/04