[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/annotate ffd6bbcc11 340/372: - allowed paths with spaces i
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/annotate ffd6bbcc11 340/372: - allowed paths with spaces in a search query. |
Date: |
Fri, 4 Feb 2022 16:59:18 -0500 (EST) |
branch: elpa/annotate
commit ffd6bbcc1130fb7cb229cac9917db6686194564c
Author: cage <cage@invalid>
Commit: cage <cage@invalid>
- allowed paths with spaces in a search query.
---
annotate.el | 44 +++++++++++++++++++++++++++++++++++---------
1 file changed, 35 insertions(+), 9 deletions(-)
diff --git a/annotate.el b/annotate.el
index d70ace2dc5..431032dc3a 100644
--- a/annotate.el
+++ b/annotate.el
@@ -2389,6 +2389,24 @@ pressed."
(annotate-update-visited-buffer-maybe filename)
(annotate-show-annotation-summary query nil nil)))))
+(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-show-annotation-summary (&optional arg-query
cut-above-point (save-annotations t))
"Show a summary of all the annotations in a temp buffer, the
results can be filtered with a simple query language: see
@@ -2408,7 +2426,7 @@ results can be filtered with a simple query language: see
annotate-ellipse-text-marker)
text)))
(wrap (text)
- (concat "\"" text "\""))
+ (annotate-wrap-text text "\""))
(insert-item-summary (filename
snippet-text
button-text
@@ -2690,6 +2708,10 @@ example:
`annotate-summary-query'"
(eq token :no-more-tokens))
+(defun annotate-summary-token-symbol-match (looking-symbol token)
+ (eq looking-symbol
+ (annotate-summary-query-lexer-symbol token)))
+
(cl-defun annotate-summary-query-parse-note (filter-fn annotation &optional
(res nil))
"Parser rule for note:
@@ -2730,8 +2752,7 @@ Arguments:
"
(cl-labels ((token-symbol-match-p (looking-symbol token)
- (eq looking-symbol
- (annotate-summary-query-lexer-symbol
token)))
+ (annotate-summary-token-symbol-match looking-symbol token))
;; this function will parse the rule operator
;; OPERATOR := AND | OR
;; where
@@ -2886,16 +2907,20 @@ Note: this function returns the annotation part of the
record, see
(lambda (annotation query file-filter-fn note-filter-fn)
(let ((annotate-summary-query query) ; save the query
(query-notes-only nil)) ; the query for just the notes
- (let ((next-token (annotate-summary-lexer))) ; get file-mask
- ;; if there are no more tokes just return all the records
+ (let ((next-token (annotate-summary-lexer))) ; get potential file-mask
+ ;; if there are no more tokens just return all the records
;; these match the empty string as in rule
;; EXPRESSION := epsilon
(if (annotate-summary-query-parse-end-input-p next-token)
(annotate-annotations-from-dump annotation)
;; otherwise test the record with the file-mask
- (let* ((filtered-annotation (funcall file-filter-fn
-
(annotate-summary-query-lexer-string next-token)
- annotation))
+ (let* ((quoted-file-mask-p (annotate-summary-token-symbol-match
'escaped-re
+
next-token))
+ (file-mask-raw (annotate-summary-query-lexer-string
next-token))
+ (file-mask (if quoted-file-mask-p
+ (annotate-unwrap-text file-mask-raw
"\"")
+ file-mask-raw))
+ (filtered-annotation (funcall file-filter-fn file-mask
annotation))
;; get the operator as in rule
(operator-token (annotate-summary-lexer)))
;; if there are no operator just return the filtered (by file-mask)
@@ -3056,7 +3081,8 @@ position."
(interactive)
(with-current-buffer (current-buffer)
(when buffer-file-name
- (annotate-show-annotation-summary buffer-file-name (point)))))
+ (annotate-show-annotation-summary (annotate-wrap-text buffer-file-name
"\"")
+ (point)))))
;;; switching database
- [nongnu] elpa/annotate 2050c59af3 227/372: - marked buffer as unmodified when switching database and the only, (continued)
- [nongnu] elpa/annotate 2050c59af3 227/372: - marked buffer as unmodified when switching database and the only, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 99d99e5bcb 234/372: Merge pull request #72 from cage2/master, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 4b2fa8f61e 252/372: - removed function 'annotate-load-annotation-data-ignore-errors'., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate c972641056 258/372: - Using "help-echo" to print annotations instead of render it on the buffer., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 9320918b91 270/372: Merge pull request #84 from cage2/fix-regression-multiline-annotations, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 3e70e187b3 262/372: - updated NEWS and Changelog., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 4af196ce04 312/372: - updated Changelog and NEWS.org., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 3a4dc507c2 305/372: - removed unused functions., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 3458b548f4 303/372: - removed warning related to misplaced '(interactive)', ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate ed5f00d51c 351/372: - increased version number., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate ffd6bbcc11 340/372: - allowed paths with spaces in a search query.,
ELPA Syncer <=
- [nongnu] elpa/annotate b9c908f24c 365/372: Merge pull request #115 from cage2/fix-delete-ghost-db, ELPA Syncer, 2022/02/04