[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/consult-recoll f32c281756 34/50: readme: example of a r
From: |
ELPA Syncer |
Subject: |
[elpa] externals/consult-recoll f32c281756 34/50: readme: example of a result formatter |
Date: |
Sat, 6 Aug 2022 18:57:42 -0400 (EDT) |
branch: externals/consult-recoll
commit f32c281756d60732663815d01e083c1721a1bdeb
Author: jao <jao@gnu.org>
Commit: jao <jao@gnu.org>
readme: example of a result formatter
---
readme.org | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/readme.org b/readme.org
index 7aa8d1d1d7..3337356664 100644
--- a/readme.org
+++ b/readme.org
@@ -78,6 +78,26 @@ display its results, via
[[https://github.com/minad/consult][consult]].
snippets of the file (when provided by recoll). The title, path and mime
type of the document are also shown in previews.
+*** Tip: formatting results list
+ As mentioned, one can use ~consult-recoll-format-candidate~ to customize
how
+ search results are shown in the minibufer. For instance, i like to
+ shorten paths removing common prefixes and to show MIME types, so i use
+ a formatter similar to this one:
+ #+begin_src emacs-lisp
+ (defun jao-recoll-format (title url mime-type)
+ ;; remove from url the common prefixes /home/jao/{org/doc,doc,...}
+ (let* ((u (replace-regexp-in-string "/home/jao/" "" url))
+ (u (replace-regexp-in-string
+ "\\(doc\\|org/doc\\|.emacs.d/gnus/Mail\\|var/mail\\)/" ""
u)))
+ (format "%s (%s, %s)"
+ (propertize title 'face 'consult-recoll-title-face)
+ (propertize u 'face 'consult-recoll-url-face)
+ (propertize mime-type 'face 'consult-recoll-mime-face))))
+
+
+ (setq consult-recoll-format-candidate #'jao-recoll-format)
+ #+end_src
+
** Opening search results
:PROPERTIES:
:CUSTOM_ID: opening-results
- [elpa] externals/consult-recoll 47b47e8a47 38/50: asynchronous snippets parsing, (continued)
- [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, 2022/08/06
- [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 <=
- [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
- [elpa] externals/consult-recoll 47f6c618a2 46/50: readme: thanks section, ELPA Syncer, 2022/08/06
- [elpa] externals/consult-recoll 72fc38d27a 49/50: readme: recommendation for a vertical completions UI, ELPA Syncer, 2022/08/06