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

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

[elpa] externals/consult-recoll 6d71139e42: candidate size in metadata


From: ELPA Syncer
Subject: [elpa] externals/consult-recoll 6d71139e42: candidate size in metadata
Date: Tue, 16 Aug 2022 16:57:26 -0400 (EDT)

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

    candidate size in metadata
---
 consult-recoll.el | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/consult-recoll.el b/consult-recoll.el
index 1be7e00c60..a2a09e8e22 100644
--- a/consult-recoll.el
+++ b/consult-recoll.el
@@ -105,9 +105,6 @@ Set to nil to use the default 'title (path)' format."
   (setq consult-recoll--index 0)
   `("recollq" "-A" "-p" "5" ,@consult-recoll-search-flags ,text))
 
-(defconst consult-recoll--line-rx "^\\(.*?\\)\t\\[\\(.*?\\)\\]\t\\[\\(.*\\)\\]"
-  "Regular expression decomposing result lines returned by recollq")
-
 (defun consult-recoll--format (title urln mime)
   (if consult-recoll-format-candidate
       (funcall consult-recoll-format-candidate title urln mime)
@@ -124,6 +121,9 @@ Set to nil to use the default 'title (path)' format."
 (defsubst consult-recoll--candidate-url (candidate)
   (get-text-property 0 'url candidate))
 
+(defsubst consult-recoll--candidate-size (candidate)
+  (get-text-property 0 'size candidate))
+
 (defsubst consult-recoll--candidate-page (candidate)
   (get-text-property 0 'page candidate))
 
@@ -165,12 +165,17 @@ Set to nil to use the default 'title (path)' format."
         (when (string-prefix-p "text/" mime)
           (consult-recoll--search-snippet candidate mime))))))
 
+(defconst consult-recoll--line-rx
+  "^\\(.*?\\)\t\\[\\(.*?\\)\\]\t\\[\\(.*\\)\\]\\(\t\\([0-9]+\\)\\)?"
+  "Regular expression decomposing result lines returned by recollq")
+
 (defun consult-recoll--transformer (str)
   "Decode STR, as returned by recollq."
   (cond ((string-match consult-recoll--line-rx str)
          (let* ((mime (match-string 1 str))
                 (url (match-string 2 str))
                 (title (match-string 3 str))
+                (size (match-string 5 str))
                 (urln (if (string-prefix-p "file://" url) (substring url 7) 
url))
                 (idx (setq consult-recoll--index (1+ consult-recoll--index)))
                 (cand (consult-recoll--format title url mime))
@@ -178,7 +183,8 @@ Set to nil to use the default 'title (path)' format."
                                   'mime-type mime
                                   'url urln
                                   'title title
-                                  'index idx)))
+                                  'index idx
+                                  'size size)))
            (prog1 (and (not (consult-recoll--snippets)) 
consult-recoll--current)
              (setq consult-recoll--current cand))))
         ((string= "/SNIPPETS" str)



reply via email to

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