emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/consult-recoll 204a936c5b 35/50: fix: a better regexp f


From: ELPA Syncer
Subject: [elpa] externals/consult-recoll 204a936c5b 35/50: fix: a better regexp for decomposing recollq results
Date: Sat, 6 Aug 2022 18:57:42 -0400 (EDT)

branch: externals/consult-recoll
commit 204a936c5b29334a3b40042ff5047f5790a7c136
Author: jao <jao@gnu.org>
Commit: jao <jao@gnu.org>

    fix: a better regexp for decomposing recollq results
    
    cf. discussion in issue #3
---
 consult-recoll.el | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/consult-recoll.el b/consult-recoll.el
index aba5b1ac49..93b3eadc72 100644
--- a/consult-recoll.el
+++ b/consult-recoll.el
@@ -86,9 +86,12 @@ Set to nil to use the default 'title (path)' format."
   (setq consult-recoll--current text)
   `("recollq" ,@consult-recoll-search-flags ,text))
 
+(defconst consult-recoll--line-rx "^\\(.*?\\)\t\\[\\(.*?\\)\\]\t\\[\\(.*\\)\\]"
+  "Regular expression decomposing result lines returned by recollq")
+
 (defun consult-recoll--transformer (str)
   "Decode STR, as returned by recollq."
-  (when (string-match "^\\([^[]+\\)\t\\[\\([^]]+\\)\\]\t\\[\\([^[]+\\)\\]" str)
+  (when (string-match consult-recoll--line-rx str)
     (let* ((mime (match-string 1 str))
            (url (match-string 2 str))
            (title (match-string 3 str))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]