diff --git a/helm-org.el b/helm-org.el index 527de0f..5eb5c85 100644 --- a/helm-org.el +++ b/helm-org.el @@ -374,12 +374,10 @@ nothing to CANDIDATES." (defun helm-org-insert-link-to-heading-at-marker (marker) "Insert link to heading at MARKER position." (with-current-buffer (marker-buffer marker) - (let ((heading-name (save-excursion (goto-char (marker-position marker)) - (nth 4 (org-heading-components)))) - (file-name (buffer-file-name))) + (let ((link (save-excursion (goto-char (marker-position marker)) + (org-store-link nil)))) (with-helm-current-buffer - (org-insert-link - file-name (concat "file:" file-name "::*" heading-name)))))) + (insert link))))) (defun helm-org-run-insert-link-to-heading-at-marker () "Run interactively `helm-org-insert-link-to-heading-at-marker'."