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 e6b2f9eefb
commit cff1c86d0b
No known key found for this signature in database
GPG Key ID: 50EA937BF472ADD1

View File

@ -1861,11 +1861,11 @@ not."
(t (user-error "Neither ID nor CUSTOM_ID given")))))
(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.
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
through the current buffer if that one is an Org buffer and is
@ -1910,7 +1910,7 @@ linking to any item."
(consult--read (consult--slow-operation "Collecting headings..."
(or (consult-org--headings t nil scope)
(user-error "No headings")))
:prompt "Choose heading: "
:prompt (or prompt "Choose heading: ")
:category 'org-heading
:sort nil
:initial initial-input