diff options
author | jao <jao@gnu.org> | 2022-03-27 05:36:09 +0100 |
---|---|---|
committer | jao <jao@gnu.org> | 2022-03-27 05:36:09 +0100 |
commit | ab3753cf4d8b493111de53ffd872099521c6359b (patch) | |
tree | 3ebbc02f17cb26d78eb36e2939ed21b4d5f774bb /lib/doc | |
parent | f19356b9fd514b9b0ed86172ec85d12206a9efa3 (diff) | |
download | elibs-ab3753cf4d8b493111de53ffd872099521c6359b.tar.gz elibs-ab3753cf4d8b493111de53ffd872099521c6359b.tar.bz2 |
jao-recoll: fix: allow no snippets
Diffstat (limited to 'lib/doc')
-rw-r--r-- | lib/doc/jao-recoll.el | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/lib/doc/jao-recoll.el b/lib/doc/jao-recoll.el index a49d183..f43451f 100644 --- a/lib/doc/jao-recoll.el +++ b/lib/doc/jao-recoll.el @@ -75,9 +75,8 @@ using org mode." (when (looking-at-p "Recoll query:") (setq jao-recoll--last-full-query (string-trim (thing-at-point 'line))) - (let ((kill-whole-line nil)) - (kill-line) - (insert query)) + (let ((kill-whole-line nil)) (kill-line)) + (insert query) (forward-line 2)) (open-line 1) (while (search-forward-regexp jao-recoll--file-regexp nil t) @@ -90,13 +89,15 @@ using org mode." (t (match-string 2)))) (replace-match (format "* [[%s][\\3]] (\\1)" lnk)) (forward-line) - (let ((kill-whole-line t)) (kill-line)) - (while (and (not (eobp)) (not (looking-at-p "/SNIPPETS"))) - (if (looking-at "^\\([1-9][0-9]*\\) : ") - (replace-match (format " - [[%s::\\1][\\1]] : " lnk)) - (insert " - ")) - (forward-line 1)) - (unless (eobp) (let ((kill-whole-line t)) (kill-line)))) + (when (looking-at-p "SNIPPETS") + (let ((kill-whole-line t)) + (kill-line) + (while (and (not (eobp)) (not (looking-at-p "/SNIPPETS"))) + (if (looking-at "^\\([1-9][0-9]*\\) : ") + (replace-match (format " - [[%s::\\1][\\1]] : " lnk)) + (insert " - ")) + (forward-line 1)) + (unless (eobp) (kill-line))))) (pop-to-buffer (current-buffer)) (goto-char (point-min)) (org-next-visible-heading 1) @@ -107,7 +108,7 @@ using org mode." (define-key recoll-mode-map [?p] 'org-previous-link) (define-key recoll-mode-map [?q] 'bury-buffer) (define-key recoll-mode-map [?r] 'jao-recoll-requery) -(define-key recoll-mode-map [?q] 'jao-recoll-requery) +(define-key recoll-mode-map [?g] 'jao-recoll-requery) (define-key recoll-mode-map [?w] 'jao-recoll-show-query) |