[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/consult-recoll 2e70eebee4 40/50: new feature: grouping
From: |
ELPA Syncer |
Subject: |
[elpa] externals/consult-recoll 2e70eebee4 40/50: new feature: grouping search results by mime type |
Date: |
Sat, 6 Aug 2022 18:57:43 -0400 (EDT) |
branch: externals/consult-recoll
commit 2e70eebee41065866cb3f024f2b86ef2caa6d831
Author: jao <jao@gnu.org>
Commit: jao <jao@gnu.org>
new feature: grouping search results by mime type
---
consult-recoll.el | 12 +++++++++++-
readme.org | 5 +++++
2 files changed, 16 insertions(+), 1 deletion(-)
diff --git a/consult-recoll.el b/consult-recoll.el
index 9f3c7a6107..e4cdcf9397 100644
--- a/consult-recoll.el
+++ b/consult-recoll.el
@@ -55,7 +55,7 @@
(list string)))
(defcustom consult-recoll-open-fn #'find-file
- "Default function used to open candidate URL.
+ "Default function used to open candidate URLs.
It receives a single argument, the full path to the file to open.
See also `consult-recoll-open-fns'"
:type 'function)
@@ -64,6 +64,10 @@ See also `consult-recoll-open-fns'"
"Alist mapping mime types to functions to open a selected candidate."
:type '(alist :key-type string :value-type function))
+(defcustom consult-recoll-group-by-mime t
+ "When set, list search results grouped by mime type."
+ :type 'boolean)
+
(defcustom consult-recoll-format-candidate nil
"A function taking title, path and mime type, and formatting them for
display.
Set to nil to use the default 'title (path)' format."
@@ -161,6 +165,10 @@ Set to nil to use the default 'title (path)' format."
(when (get-buffer consult-recoll--preview-buffer)
(kill-buffer consult-recoll--preview-buffer)))))
+(defun consult-recoll--group (candidate transform)
+ "If TRANSFORM return candidate, othewise extract mime-type."
+ (if transform candidate (consult-recoll--candidate-mime candidate)))
+
(defun consult-recoll--search (&optional initial)
"Perform an asynchronous recoll search via `consult--read'.
If given, use INITIAL as the starting point of the query."
@@ -174,6 +182,8 @@ If given, use INITIAL as the starting point of the query."
:lookup #'consult--lookup-member
:sort nil
:state #'consult-recoll--preview
+ :group (and consult-recoll-group-by-mime
+ #'consult-recoll--group)
:initial (consult--async-split-initial initial)
:history '(:input consult-recoll-history)
:category 'recoll-result))
diff --git a/readme.org b/readme.org
index 3337356664..d5d83adc44 100644
--- a/readme.org
+++ b/readme.org
@@ -98,6 +98,11 @@ display its results, via
[[https://github.com/minad/consult][consult]].
(setq consult-recoll-format-candidate #'jao-recoll-format)
#+end_src
+*** Tip: disabling mime type groups
+ By default, results are listed grouped by their mime type. You can
+ disable grouping by setting the customizable variable
+ ~consult-recoll-group-by-mime~ to ~nil~.
+
** Opening search results
:PROPERTIES:
:CUSTOM_ID: opening-results
- [elpa] externals/consult-recoll fe7a09b99d 13/50: new consult--async-command protocol, (continued)
- [elpa] externals/consult-recoll fe7a09b99d 13/50: new consult--async-command protocol, ELPA Syncer, 2022/08/06
- [elpa] externals/consult-recoll 0c2c8c12b9 14/50: new user option consult-recoll-search-flags, ELPA Syncer, 2022/08/06
- [elpa] externals/consult-recoll 47b47e8a47 38/50: asynchronous snippets parsing, ELPA Syncer, 2022/08/06
- [elpa] externals/consult-recoll 889cd8daf2 26/50: readme: fragment for internal link, ELPA Syncer, 2022/08/06
- [elpa] externals/consult-recoll 2dd853c6c9 29/50: consult live previews showing recoll snippets, ELPA Syncer, 2022/08/06
- [elpa] externals/consult-recoll 7b54edb8ac 12/50: removing deprecated consult-async-default-split, ELPA Syncer, 2022/08/06
- [elpa] externals/consult-recoll 8210ee3fef 10/50: redundant subr-x require to bypass issue #1, ELPA Syncer, 2022/08/06
- [elpa] externals/consult-recoll 00105e94a4 03/50: customization group, ELPA Syncer, 2022/08/06
- [elpa] externals/consult-recoll d46470c64d 20/50: readme tweaks, ELPA Syncer, 2022/08/06
- [elpa] externals/consult-recoll 228306eeda 22/50: version bump, ELPA Syncer, 2022/08/06
- [elpa] externals/consult-recoll 2e70eebee4 40/50: new feature: grouping search results by mime type,
ELPA Syncer <=
- [elpa] externals/consult-recoll d80ad99e4d 30/50: readme: typo, ELPA Syncer, 2022/08/06
- [elpa] externals/consult-recoll f32c281756 34/50: readme: example of a result formatter, ELPA Syncer, 2022/08/06
- [elpa] externals/consult-recoll 39251b54eb 43/50: screenshot: no-groups and inline, ELPA Syncer, 2022/08/06
- [elpa] externals/consult-recoll 204a936c5b 35/50: fix: a better regexp for decomposing recollq results, ELPA Syncer, 2022/08/06
- [elpa] externals/consult-recoll d96779ece2 01/50: Initial commit, ELPA Syncer, 2022/08/06
- [elpa] externals/consult-recoll c68b79f130 05/50: customizable prompt, ELPA Syncer, 2022/08/06
- [elpa] externals/consult-recoll 6ea952cd4c 36/50: back to the previous regexp, it's more precise in the common case, ELPA Syncer, 2022/08/06
- [elpa] externals/consult-recoll 3070550d0f 41/50: index metadata for search results, ELPA Syncer, 2022/08/06
- [elpa] externals/consult-recoll 1c48329d90 48/50: fix: show also results that have no snippets, ELPA Syncer, 2022/08/06
- [elpa] externals/consult-recoll 6ef792703b 19/50: Note on two-phased queries (fixes #2), ELPA Syncer, 2022/08/06