[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/consult-recoll afce21b5b2 1/2: fixes for snippet text s
From: |
ELPA Syncer |
Subject: |
[elpa] externals/consult-recoll afce21b5b2 1/2: fixes for snippet text search |
Date: |
Sun, 14 Aug 2022 15:57:23 -0400 (EDT) |
branch: externals/consult-recoll
commit afce21b5b2356ab92cbefdca4eb74d5d811d781c
Author: jao <jao@gnu.org>
Commit: jao <jao@gnu.org>
fixes for snippet text search
---
consult-recoll.el | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/consult-recoll.el b/consult-recoll.el
index 1f31431b2d..8797f321f3 100644
--- a/consult-recoll.el
+++ b/consult-recoll.el
@@ -138,10 +138,12 @@ Set to nil to use the default 'title (path)' format."
(goto-char (point-min))
(when (or (search-forward txt nil t)
(and (derived-mode-p 'org-mode)
- (search-forward (replace-regexp-in-string "\\]\\].+" ""
- txt nil t)))
+ (let ((txt (replace-regexp-in-string "\\]\\].+" "" txt)))
+ (search-forward txt nil t)))
(and (string= mime "text/html")
- (search-forward (substring txt 0 (/ (length txt) 2)) nil
t)))
+ (let ((mid (/ (length txt) 2)))
+ (or (search-forward (substring txt 0 mid) nil t)
+ (search-forward (substring txt mid) nil t)))))
(goto-char (match-beginning 0))
(when (derived-mode-p 'org-mode) (org-reveal))))))