get denote link in org-capture template with %a expansion
#702
|
Hello, This should be done by Line 6912 in e6f6111 |
Replies: 3 comments 1 reply
|
Hello @jarofromel!
This should happen by default. Something must be wrong. I will look into it tonight. |
|
Can you try this? (defun denote-link-ol-store (&optional _interactive?)
"Handler for `org-store-link' adding support for denote: links.
Optional INTERACTIVE? is used by `org-store-link'.
Also see the user option `denote-org-store-link-to-heading'."
(when-let* ((file (buffer-file-name))
((file-regular-p file))
((denote-file-is-in-denote-directory-p file))
((denote-file-has-denoted-filename-p file))
(file-id (denote-retrieve-filename-identifier file))
(description (denote-get-link-description file)))
(let ((heading-links (and denote-org-store-link-to-heading
(derived-mode-p 'org-mode)
(denote--org-capture-link-specifiers-p)))
(heading (denote-link-ol-get-heading)))
(org-link-store-props
:type "denote"
:description (if (and heading-links heading)
(denote-link-format-heading-description
description
heading)
description)
:link (cond
((when-let* ((id (org-entry-get (point) "CUSTOM_ID")))
(format "denote:%s::#%s" file-id id)))
((and heading-links (eq denote-org-store-link-to-heading 'context) heading)
(format "denote:%s::*%s" file-id heading))
((and heading-links heading)
(format "denote:%s::#%s" file-id (denote-link-ol-get-id)))
(t
(concat "denote:" file-id))))
org-store-link-plist)))I basically removed the test for |
|
I just committed the change. Thank you! |
Can you try this?