Compare commits

..

3 Commits

Author SHA1 Message Date
ab09a694ae
Use consult function to provide org-goto
`org-goto` does not work as before, as our custom Org refile location query function does not honor
the `org-refile-targets` variable.  So, let's just use `consult-org-heading` directly, since this is
what I want.
2025-08-17 17:52:01 +02:00
dbf0963511
Provide regular expression in custom Org refile location function
Not sure what this is good for, but it might be necessary somewhen?
2025-08-17 17:51:33 +02:00
3f767faf08
Fix type signature for org-refile-get-location substitute function 2025-08-17 17:51:01 +02:00
2 changed files with 6 additions and 4 deletions

View File

@ -741,7 +741,8 @@ split horizontally again, but this extra work should not matter much."
:pin "gnu" :pin "gnu"
:bind (:map org-mode-map :bind (:map org-mode-map
([remap org-return] . (lambda () (interactive) (org-return :indent))) ([remap org-return] . (lambda () (interactive) (org-return :indent)))
([remap org-clock-goto] . db/org-clock-goto-first-open-checkbox)) ([remap org-clock-goto] . db/org-clock-goto-first-open-checkbox)
([remap org-goto] . consult-org-heading))
:autoload (org-get-todo-state :autoload (org-get-todo-state
org-entry-get) org-entry-get)
:commands (org-return) :commands (org-return)
@ -953,7 +954,7 @@ split horizontally again, but this extra work should not matter much."
;; Use consult for querying refile targets ;; Use consult for querying refile targets
(define-advice org-refile-get-location (:around (define-advice org-refile-get-location (:around
(orig-func prompt default-buffer new-nodes) (orig-func &optional prompt default-buffer new-nodes)
use-consult-instead) use-consult-instead)
(ignore orig-func) (ignore orig-func)
(db/org-refile-get-location prompt default-buffer new-nodes)))) (db/org-refile-get-location prompt default-buffer new-nodes))))

View File

@ -478,7 +478,7 @@ Via %%(with-temp-buffer (db/org-add-link-to-current-clock) (string-trim (buffer-
;; any agenda when a super-item is tagged with :HOLD:. ;; any agenda when a super-item is tagged with :HOLD:.
(not (member "HOLD" (org-get-tags (point)))))) (not (member "HOLD" (org-get-tags (point))))))
(defun db/org-refile-get-location (prompt default-buffer new-nodes) (defun db/org-refile-get-location (&optional prompt default-buffer new-nodes)
"Replacement function for `org-refile-get-location' using `consult'. "Replacement function for `org-refile-get-location' using `consult'.
This function can be used instead of `org-refile-get-location', This function can be used instead of `org-refile-get-location',
@ -496,7 +496,8 @@ Also note that the usual variables governing the behavior of
(db/org-get-location t nil (concat prompt " "))))) ; TODO: incorporate verify function (db/org-get-location t nil (concat prompt " "))))) ; TODO: incorporate verify function
(list (buffer-name (marker-buffer pom)) (list (buffer-name (marker-buffer pom))
(buffer-file-name (marker-buffer pom)) (buffer-file-name (marker-buffer pom))
"" ; some regexp matching the headline? ;; The third entry is some regexp matching the headline, apparently?
(format org-complex-heading-regexp-format (org-entry-get pom "ITEM"))
(marker-position pom)))) (marker-position pom))))