summaryrefslogtreecommitdiffhomepage
path: root/lib/doc
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2021-08-29 19:42:45 +0100
committerjao <jao@gnu.org>2021-08-29 19:42:45 +0100
commitf79918fc8fcc2ae811af82b7f21875bc05df1dfa (patch)
tree44b9cdef6e5cfe4617b7596824cac65316e7671a /lib/doc
parentdd84ad177d145756bf48c082f059c3179c07c3e8 (diff)
downloadelibs-f79918fc8fcc2ae811af82b7f21875bc05df1dfa.tar.gz
elibs-f79918fc8fcc2ae811af82b7f21875bc05df1dfa.tar.bz2
whitespace
Diffstat (limited to 'lib/doc')
-rw-r--r--lib/doc/jao-org-notes.el15
1 files changed, 5 insertions, 10 deletions
diff --git a/lib/doc/jao-org-notes.el b/lib/doc/jao-org-notes.el
index 2c328c5..3f6e725 100644
--- a/lib/doc/jao-org-notes.el
+++ b/lib/doc/jao-org-notes.el
@@ -34,20 +34,16 @@
"--no-heading" "--line-number" "--smart-case" "." "-e"
,(format "^(#.(title|filetags): .*)%s" str)))
-(defvar jao-org-notes--trx "[0-9]+:#\\+\\(file\\)?\\(title\\|tags\\):")
-
(defun jao-org-notes--clean-match (m)
(cons (format "%s %s"
(replace-regexp-in-string "^\\./" "" (car m))
- (replace-regexp-in-string jao-org-notes--trx " (\\2)" (cadr m)))
+ (replace-regexp-in-string "[0-9]+:#\\+\\(file\\)?\\(title\\|tags\\):"
+ " (\\2)" (cadr m)))
(expand-file-name (car m) default-directory)))
(defun jao-org-notes--matches (lines)
(mapcar (lambda (l) (jao-org-notes--clean-match (split-string l "\0" t))) lines))
-(defun jao-org-notes--lookup (_ cands cand)
- (or (cdr (assoc cand cands)) cand))
-
(defvar jao-org-notes--grep-history nil)
(defun jao-org--grep (prompt &optional cat no-req)
@@ -56,13 +52,12 @@
(consult--async-command #'jao-org-notes--rg
(consult--async-transform jao-org-notes--matches))
:prompt prompt
- :lookup #'jao-org-notes--lookup
+ :lookup (lambda (_ cands cand) (or (cdr (assoc cand cands)) cand))
:initial (consult--async-split-initial "")
- :add-history (concat (consult--async-split-initial "") (thing-at-point 'symbol))
+ :add-history (concat (consult--async-split-initial (thing-at-point 'symbol)))
:require-match (not no-req)
:category 'jao-org-notes-lookup
- :history '(:input jao-org-notes--grep-history)
- :sort nil)))
+ :history '(:input jao-org-notes--grep-history))))
(defun jao-org-notes-cats ()
(seq-difference (directory-files jao-org-notes-dir) '("." ".." "attic")))