Use default buffer for Org location queries

This commit is contained in:
Daniel Borchmann 2025-08-17 13:08:18 +02:00
parent 27582a4195
commit 9780f1fe7f
No known key found for this signature in database
GPG Key ID: 50EA937BF472ADD1

View File

@ -1907,20 +1907,21 @@ linking to any item."
(t (t
(list (buffer-file-name default-buffer))))) (list (buffer-file-name default-buffer)))))
(pom (consult--read (consult--slow-operation "Collecting headings..." (pom (with-current-buffer default-buffer
(or (consult-org--headings nil nil scope) (consult--read (consult--slow-operation "Collecting headings..."
(user-error "No headings"))) (or (consult-org--headings nil nil scope)
:prompt "Go to heading: " (user-error "No headings")))
:category 'org-heading :prompt "Go to heading: "
:sort nil :category 'org-heading
:initial initial-input :sort nil
:require-match t :initial initial-input
:history '(:input consult-org--history) :require-match t
:narrow (consult-org--narrow) :history '(:input consult-org--history)
:annotate #'consult-org--annotate :narrow (consult-org--narrow)
:group #'consult-org--group :annotate #'consult-org--annotate
:lookup (apply-partially #'consult--lookup-prop 'org-marker) :group #'consult-org--group
:preview-key nil))) :lookup (apply-partially #'consult--lookup-prop 'org-marker)
:preview-key nil))))
(if (markerp pom) (if (markerp pom)
pom pom
(user-error "Invalid location"))))) (user-error "Invalid location")))))