summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOmar Antolín <omar.antolin@gmail.com>2026-03-30 14:27:25 -0600
committerOmar Antolín <omar.antolin@gmail.com>2026-03-30 14:27:25 -0600
commit0c06fcd5d2f7b7ede9b843e500007c56bb8338ad (patch)
tree332068a3d6a1c4831b993f2f0ff3eae8c6b27054
parent3c49062623eab04da95bfb4f51cea4c61c8bcf94 (diff)
Support org-goto and org-refile as sources of heading targets (fix #795)
This change on its own does not mean org-goto and org-refile will be consider to give heading targets, they still would need to report the org-heading completion category. For now, I am recommending that be done through marginalia.
-rw-r--r--embark-org.el6
1 files changed, 4 insertions, 2 deletions
diff --git a/embark-org.el b/embark-org.el
index feaaf3e..5196ffc 100644
--- a/embark-org.el
+++ b/embark-org.el
@@ -604,14 +604,16 @@ REST are the remaining arguments."
"RUN the action at the location of the heading TARGET refers to.
The location is given by the `org-marker' text property of
target. Applies RUN to the REST of the arguments."
- (if-let ((marker (get-text-property 0 'org-marker target)))
+ (if-let ((marker (or (get-text-property 0 'org-marker target)
+ (nth 3 (org-refile--get-location target nil)))))
(org-with-point-at marker
(apply run :target target rest))
(apply run :target target rest)))
(cl-defun embark-org-goto-heading (&key target &allow-other-keys)
"Jump to the org heading TARGET refers to."
- (when-let ((marker (get-text-property 0 'org-marker target)))
+ (when-let ((marker (or (get-text-property 0 'org-marker target)
+ (nth 3 (org-refile--get-location target nil)))))
(pop-to-buffer (marker-buffer marker))
(widen)
(goto-char marker)