Use default buffer for Org location queries

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

View File

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