Scope window-width lexically and do not check for candidate type
This commit is contained in:
parent
555ae98eb8
commit
8ba81a4441
1 changed files with 22 additions and 23 deletions
|
|
@ -177,14 +177,13 @@ 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 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
|
|
||||||
:filtered-candidate-transformer (lambda (candidates _)
|
|
||||||
(let ((window-width (window-width (helm-window))))
|
(let ((window-width (window-width (helm-window))))
|
||||||
(mapcar (lambda (marker)
|
(helm-make-source name 'helm-source-sync
|
||||||
(unless (markerp marker) (user-error "Unexpected candidate for `helm-org-ql-source'"))
|
:filtered-candidate-transformer (lambda (candidate-markers _)
|
||||||
(org-with-point-at marker
|
(mapcar (lambda (candidate-marker)
|
||||||
|
(org-with-point-at candidate-marker
|
||||||
(helm-org-ql--heading window-width)))
|
(helm-org-ql--heading window-width)))
|
||||||
candidates)))
|
candidate-markers))
|
||||||
:candidates (lambda ()
|
:candidates (lambda ()
|
||||||
(let* ((query (org-ql--query-string-to-sexp helm-pattern)))
|
(let* ((query (org-ql--query-string-to-sexp helm-pattern)))
|
||||||
(when query
|
(when query
|
||||||
|
|
@ -200,7 +199,7 @@ Is transformed into this query:
|
||||||
:nohighlight t
|
:nohighlight t
|
||||||
:match-dynamic t
|
:match-dynamic t
|
||||||
:keymap helm-org-ql-map
|
:keymap helm-org-ql-map
|
||||||
:action helm-org-ql-actions))
|
: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