From d9db76ce2a930dc7a9ff14486e4525a8ac14a8ca Mon Sep 17 00:00:00 2001
From: jao <jao@gnu.org>
Date: Tue, 29 Dec 2020 19:40:50 +0000
Subject: jao-recoll improvements

---
 doc/jao-recoll.el | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/doc/jao-recoll.el b/doc/jao-recoll.el
index eb73d62..28a1c1a 100644
--- a/doc/jao-recoll.el
+++ b/doc/jao-recoll.el
@@ -50,7 +50,9 @@ buffer using org mode."
                      jao-recoll-flags (shell-quote-argument keywords))))
       (shell-command c t))
     (goto-char (point-min))
-    (forward-line 2)
+    (when (looking-at-p "Recoll query:")
+      (let ((kill-whole-line t)) (kill-line))
+      (forward-line 1))
     (open-line 1)
     (while (search-forward-regexp jao-recoll--file-regexp nil t)
       (replace-match "* [[\\2][\\3]] (\\1)")
@@ -64,7 +66,10 @@ buffer using org mode."
         (fill-region p (point))
         (let ((kill-whole-line nil)) (kill-line))))
     (recoll-mode)
-    (pop-to-buffer (current-buffer))))
+    (pop-to-buffer (current-buffer))
+    (goto-char (point-min))
+    (org-cycle '(4))
+    (org-next-visible-heading 1)))
 
 (define-key recoll-mode-map [?n] 'org-next-link)
 (define-key recoll-mode-map [?p] 'org-previous-link)
-- 
cgit v1.2.3