[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/annotate de86b9b22e 341/372: - removed uses of regular exp
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/annotate de86b9b22e 341/372: - removed uses of regular expressions from 'annotate-unwrap-text'. |
Date: |
Fri, 4 Feb 2022 16:59:19 -0500 (EST) |
branch: elpa/annotate
commit de86b9b22e73145a625950d6459f29ab0f773208
Author: cage <cage@invalid>
Commit: cage <cage@invalid>
- removed uses of regular expressions from 'annotate-unwrap-text'.
---
annotate.el | 31 +++++++++++++++++--------------
1 file changed, 17 insertions(+), 14 deletions(-)
diff --git a/annotate.el b/annotate.el
index 431032dc3a..3c70169f14 100644
--- a/annotate.el
+++ b/annotate.el
@@ -2392,20 +2392,23 @@ pressed."
(cl-defun annotate-wrap-text (text &optional (wrapper "\""))
(concat wrapper text wrapper))
-(cl-defun annotate-unwrap-text (text &optional (wrapper "\""))
- (let ((left-re (concat "^" wrapper))
- (right-re (concat wrapper "$")))
- (save-match-data
- (let* ((matchedp (string-match left-re text))
- (trimmed-left (if matchedp
- (replace-match "" t t text)
- text)))
- (save-match-data
- (let ((matchedp (string-match right-re trimmed-left)))
- (if matchedp
- (replace-match "" t t trimmed-left)
- trimmed-left)))))))
-
+(cl-defun annotate-unwrap-text (text &optional (wrapper "\"") (left-side t))
+ (let ((results text)
+ (wrapper-length (length wrapper)))
+ (when (>= (length text)
+ wrapper-length)
+ (if left-side
+ (let ((maybe-wrapper (substring results 0 wrapper-length)))
+ (when (string= maybe-wrapper wrapper)
+ (setf results (substring results wrapper-length))
+ (setf results (annotate-unwrap-text results wrapper nil))))
+ (let ((maybe-wrapper (substring results
+ (- (length results)
+ wrapper-length))))
+ (when (string= maybe-wrapper wrapper)
+ (setf results (substring results 0 (- (length results)
+ wrapper-length)))))))
+ results))
(cl-defun annotate-show-annotation-summary (&optional arg-query
cut-above-point (save-annotations t))
"Show a summary of all the annotations in a temp buffer, the
- [nongnu] elpa/annotate a9f061cecd 268/372: - added more docstrings., (continued)
- [nongnu] elpa/annotate a9f061cecd 268/372: - added more docstrings., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 88ed6f22cb 285/372: - rewritten export and integrate of annotations, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 463e215bec 284/372: - fixed export for annotated text made from a single line., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate e53c0f5adf 296/372: - added checking encrypted (GPG) file format, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate be48989c98 299/372: - fixed 'annotate-previous-annotation-ends', ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 59ca58c06b 308/372: changed function from 'font-lock-ensure' to 'font-lock-flush'., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate f823c3cf09 354/372: - changed default for asking confirm before deleting an annotation: the value is now 'nil' (do not prompt for confirmation)., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 3bb813cd62 360/372: - updated NEWS.org and Changelog., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 140eb6b6cb 363/372: - updated NEWS.org;, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate b22f594f3b 336/372: Merge pull request #107 from cage2/prevent-saving-empty-db, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate de86b9b22e 341/372: - removed uses of regular expressions from 'annotate-unwrap-text'.,
ELPA Syncer <=
- [nongnu] elpa/annotate e083073ead 371/372: - updated Changelog;, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 0901aa52bc 367/372: - added the others procedures to import an annotation database., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate f08923762f 063/372: fix typo in documentation, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 16f7202d7c 091/372: - fixed docstring., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 7c759ba9eb 082/372: - fixed english language error., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 47dba946e8 075/372: - removed spurious newline character at the end of annotation text;, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 91f1d49368 087/372: - squeezed contiguous spaces in docstring., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate f85f8e00a1 088/372: - remove file size limit for hash calculation., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate bf80059e7a 071/372: - use comment ends string in modes that allow it (e.g. html-mode);, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate f01b98de03 096/372: - restored the kill buffer key command., ELPA Syncer, 2022/02/04