Tidy: helm-org-ql

This commit is contained in:
Adam Porter 2019-12-02 20:21:34 -06:00
parent d7fe019d6a
commit cb84615d89

View file

@ -187,7 +187,7 @@ Is transformed into this query:
"Return Helm source named NAME that searches BUFFERS-FILES with `helm-org-ql'." "Return Helm source named NAME that searches 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 (helm-make-source name 'helm-source-sync
:candidates (lambda nil :candidates (lambda ()
(let* ((query (org-ql--plain-query helm-pattern)) (let* ((query (org-ql--plain-query helm-pattern))
(window-width (window-width (helm-window)))) (window-width (window-width (helm-window))))
(when query (when query
@ -208,7 +208,7 @@ Is transformed into this query:
;; where byte-compilation is actually done, but it might not be a good idea ;; where byte-compilation is actually done, but it might not be a good idea
;; to always ignore such errors/warnings. ;; to always ignore such errors/warnings.
(org-ql-select buffers-files query (org-ql-select buffers-files query
:action (list 'helm-org-ql--heading window-width)))))) :action `(helm-org-ql--heading ,window-width))))))
:match #'identity :match #'identity
:fuzzy-match nil :fuzzy-match nil
:multimatch nil :multimatch nil
@ -228,9 +228,9 @@ WINDOW-WIDTH should be the width of the Helm window."
;; call a setup function in a buffer before running queries. ;; call a setup function in a buffer before running queries.
(let* ((prefix (concat (buffer-name) ":")) (let* ((prefix (concat (buffer-name) ":"))
(width (- window-width (length prefix))) (width (- window-width (length prefix)))
(path (org-split-string (org-format-outline-path (org-get-outline-path) (path (-> (org-get-outline-path)
width nil "") (org-format-outline-path width nil "")
"")) (org-split-string "")))
(heading (org-get-heading t)) (heading (org-get-heading t))
(path (if helm-org-ql-reverse-paths (path (if helm-org-ql-reverse-paths
(concat heading "\\" (s-join "\\" (nreverse path))) (concat heading "\\" (s-join "\\" (nreverse path)))