Merge 85ccc3c699 into 4b8330a683
This commit is contained in:
commit
820ddf81a5
1 changed files with 23 additions and 18 deletions
|
|
@ -189,24 +189,29 @@ Is transformed into this query:
|
||||||
(cl-defun helm-org-ql-source (buffers-files &key (name "helm-org-ql"))
|
(cl-defun helm-org-ql-source (buffers-files &key (name "helm-org-ql"))
|
||||||
"Return Helm source named NAME to search BUFFERS-FILES with `helm-org-ql'."
|
"Return Helm source named NAME to search BUFFERS-FILES with `helm-org-ql'."
|
||||||
;; Expansion of `helm-build-sync-source' macro.
|
;; Expansion of `helm-build-sync-source' macro.
|
||||||
(helm-make-source name 'helm-source-sync
|
(let ((window-width (window-width (helm-window))))
|
||||||
:candidates (lambda ()
|
(helm-make-source name 'helm-source-sync
|
||||||
(let* ((query (org-ql--query-string-to-sexp helm-pattern))
|
:filtered-candidate-transformer (lambda (candidate-markers _)
|
||||||
(window-width (window-width (helm-window))))
|
(mapcar (lambda (candidate-marker)
|
||||||
(when query
|
(org-with-point-at candidate-marker
|
||||||
(with-current-buffer (helm-buffer-get)
|
(helm-org-ql--heading window-width)))
|
||||||
(setq helm-org-ql-buffers-files buffers-files))
|
candidate-markers))
|
||||||
(ignore-errors
|
:candidates (lambda ()
|
||||||
;; Ignore errors that might be caused by partially typed queries.
|
(let* ((query (org-ql--query-string-to-sexp helm-pattern)))
|
||||||
(org-ql-select buffers-files query
|
(when query
|
||||||
:action `(helm-org-ql--heading ,window-width))))))
|
(with-current-buffer (helm-buffer-get)
|
||||||
:match #'identity
|
(setq helm-org-ql-buffers-files buffers-files))
|
||||||
:fuzzy-match nil
|
(ignore-errors
|
||||||
:multimatch nil
|
;; Ignore errors that might be caused by partially typed queries.
|
||||||
:nohighlight t
|
(org-ql-select buffers-files query
|
||||||
:volatile t
|
:action `(point-marker))))))
|
||||||
:keymap helm-org-ql-map
|
:match #'identity
|
||||||
:action helm-org-ql-actions))
|
:fuzzy-match nil
|
||||||
|
:multimatch nil
|
||||||
|
:nohighlight t
|
||||||
|
:match-dynamic t
|
||||||
|
:keymap helm-org-ql-map
|
||||||
|
:action helm-org-ql-actions)))
|
||||||
|
|
||||||
(defun helm-org-ql--heading (window-width)
|
(defun helm-org-ql--heading (window-width)
|
||||||
"Return string for Helm for heading at point.
|
"Return string for Helm for heading at point.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue