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,7 +1905,8 @@ 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
(consult--read (consult--slow-operation "Collecting headings..."
(or (consult-org--headings nil nil scope) (or (consult-org--headings nil nil scope)
(user-error "No headings"))) (user-error "No headings")))
:prompt "Go to heading: " :prompt "Go to heading: "
@ -1918,7 +1919,7 @@ linking to any item."
:annotate #'consult-org--annotate :annotate #'consult-org--annotate
:group #'consult-org--group :group #'consult-org--group
:lookup (apply-partially #'consult--lookup-prop 'org-marker) :lookup (apply-partially #'consult--lookup-prop 'org-marker)
:preview-key nil))) :preview-key nil))))
(if (markerp pom) (if (markerp pom)
pom pom
(user-error "Invalid location"))))) (user-error "Invalid location")))))