[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/annotate c103381862 280/372: - moved 'save-match-data' fro
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/annotate c103381862 280/372: - moved 'save-match-data' from the function that calls |
Date: |
Fri, 4 Feb 2022 16:59:07 -0500 (EST) |
branch: elpa/annotate
commit c103381862f5124e5871c37282e67f3d2e0c588a
Author: cage <cage-invalid@invalid>
Commit: cage <cage-invalid@invalid>
- moved 'save-match-data' from the function that calls
'annotate--split-lines' inside the body of the latter; to remove
any side-effect.
---
annotate.el | 50 +++++++++++++++++++++++++-------------------------
1 file changed, 25 insertions(+), 25 deletions(-)
diff --git a/annotate.el b/annotate.el
index c7a2e98554..93486a1d8f 100644
--- a/annotate.el
+++ b/annotate.el
@@ -1031,7 +1031,8 @@ to 'maximum-width'."
(cl-defun annotate--split-lines (text &optional (separator "\n"))
"Returns text splitted by `separator' (default: \"\n\")"
- (split-string text "\n"))
+ (save-match-data
+ (split-string text "\n")))
(defun annotate-wrap-annotation-in-box (annotation-overlay
begin-of-line
@@ -1051,30 +1052,29 @@ aaa aaa
aa -> aa*
a a**
"
- (save-match-data
- (let ((annotation-text (overlay-get annotation-overlay 'annotation)))
- (cl-labels ((boxify-multiline ()
- (let* ((lines (annotate--split-lines
annotation-text))
- (lines-widths (mapcar 'string-width lines))
- (max-width (cl-reduce (lambda (a b) (if (> a b)
- a
- b))
- lines-widths
- :initial-value -1))
- (padding-sizes (mapcar (lambda (a) (- max-width
- (string-width
a)))
- lines))
- (paddings (mapcar (lambda (a) (make-string a ?
))
- padding-sizes))
- (box-lines (cl-mapcar (lambda (a b) (concat a
b))
- lines paddings))
- (almost-boxed (cl-reduce (lambda (a b) (concat a
"\n" b))
- box-lines)))
- (concat almost-boxed " "))))
- (if annotation-on-is-own-line-p
- (list (boxify-multiline))
- (annotate--split-lines (annotate-lineate annotation-text
- (- end-of-line
begin-of-line))))))))
+ (let ((annotation-text (overlay-get annotation-overlay 'annotation)))
+ (cl-labels ((boxify-multiline ()
+ (let* ((lines (annotate--split-lines
annotation-text))
+ (lines-widths (mapcar 'string-width lines))
+ (max-width (cl-reduce (lambda (a b) (if (> a b)
+ a
+ b))
+ lines-widths
+ :initial-value -1))
+ (padding-sizes (mapcar (lambda (a) (- max-width
+ (string-width
a)))
+ lines))
+ (paddings (mapcar (lambda (a) (make-string a ? ))
+ padding-sizes))
+ (box-lines (cl-mapcar (lambda (a b) (concat a b))
+ lines paddings))
+ (almost-boxed (cl-reduce (lambda (a b) (concat a
"\n" b))
+ box-lines)))
+ (concat almost-boxed " "))))
+ (if annotation-on-is-own-line-p
+ (list (boxify-multiline))
+ (annotate--split-lines (annotate-lineate annotation-text
+ (- end-of-line
begin-of-line)))))))
(defun annotate--annotation-builder ()
"Searches the line before point for annotations, and returns a
- [nongnu] elpa/annotate 004aea92ea 179/372: - updated documentation;, (continued)
- [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
- [nongnu] elpa/annotate 5fd0923df1 232/372: Merge pull request #71 from cage2/master, ELPA Syncer, 2022/02/04
- [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 <=
- [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, 2022/02/04
- [nongnu] elpa/annotate 39fc4bbda2 090/372: - added an annotation summary window, ELPA Syncer, 2022/02/04