Allow custom prompt in own Org location query function

This commit is contained in:
Daniel Borchmann 2025-08-17 15:47:50 +02:00
parent eff28a5321
commit 44fb922b66
No known key found for this signature in database
GPG Key ID: 50EA937BF472ADD1

View File

@ -1863,11 +1863,11 @@ not."
(t (user-error "Neither ID nor CUSTOM_ID given"))))) (t (user-error "Neither ID nor CUSTOM_ID given")))))
(org-search-view nil query))) (org-search-view nil query)))
(defun db/org-get-location (&optional use-all-org-files initial-input) (defun db/org-get-location (&optional use-all-org-files initial-input prompt)
"Interactively query for location and return mark. "Interactively query for location and return mark.
Use INITIAL-INPUT as initial input when filtering available Use INITIAL-INPUT as initial input when filtering available
locations. locations. Use PROMPT as prompt when given.
When USE-ALL-ORG-FILES is nil, this functions by default searches When USE-ALL-ORG-FILES is nil, this functions by default searches
through the current buffer if that one is an Org buffer and is through the current buffer if that one is an Org buffer and is
@ -1912,7 +1912,7 @@ linking to any item."
(consult--read (consult--slow-operation "Collecting headings..." (consult--read (consult--slow-operation "Collecting headings..."
(or (consult-org--headings t nil scope) (or (consult-org--headings t nil scope)
(user-error "No headings"))) (user-error "No headings")))
:prompt "Choose heading: " :prompt (or prompt "Choose heading: ")
:category 'org-heading :category 'org-heading
:sort nil :sort nil
:initial initial-input :initial initial-input