-
-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Additional file:
link in org-stored-links
candidate
#563
Comments
file:
link in org-stored-links
candidatefile:
link in org-stored-links
candidate
I suspect it may be related to issue 556, which was addressed by the Org maintainer. Unfortunately, I cannot access Savannah right now to review what changed in org.git. |
That granted, does the following work for you (while undoing the change you made): (setq denote-org-store-link-to-heading nil) |
As the denote manual shows, it produces links only to the current file, without additional links. |
(lambda () (interactive)
(denote-link-ol-store)
(let ((link (plist-get org-store-link-plist ':link))
(desc (plist-get org-store-link-plist ':description)))
(org-link--add-to-stored-links link desc)))
While undoing the change I made, I use this little script binding to another key, which bypass the |
I noticed issue #548 right now and I commented there. This is not the desired behaviour and we need to fix it. |
This issue existed in latest I think we can advice (defun my/clean-org-stored-links (&optional args interactive)
"Display a custom message after org-publish is done."
(let((link1 (car (nth 0 org-stored-links)))
(link2 (car (nth 1 org-stored-links))))
(when (and (and (string-match-p "^file:" link1) (string-match-p denote-id-regexp link1))
(and (string-match-p "^denote:" link2) (string-match-p denote-id-regexp link2)))
(setq org-stored-links (cdr org-stored-links)))))
(advice-add 'org-store-link :after #'my/clean-org-stored-links) |
I have not looked into how Org works in this case. In general though, I prefer to avoid the advice mechanism unless it is absolutely necessary. The reason is that it has a global effect, which might lead to weird issues. Maybe there is some less intrusive way of achieving the same result. Also, we do not know if people rely on this behaviour right now. |
Certainly, the best solution would be for the upstream to add a control variable for this ”human-readable“ link. |
My versions:
~/.emacs.d/org/journals $ (emacs-version) GNU Emacs 31.0.50 (build 2, aarch64-apple-darwin24.3.0, NS appkit-2575.40 Version 15.3.1 (Build 24D70)) of 2025-02-25 ~/.emacs.d/org/journals $ (org-version) 9.7.26
When I call
org-store-link
interactively, the first candidate oforg-insert-link
would be a link started withfile:
instead ofdenote:
.I think it's the
additional "human-readable" link
stored byorg-store-link
inol.el
:https://github.com/bzg/org-mode/blob/b6dbf8881076191e1351d7cd15e26547a2531fea/lisp/ol.el#L1942-L1952
And we have this in
denote.el
:denote/denote.el
Lines 5713 to 5723 in e41fd8e
So I currently just redefined
denote-link-ol-get-id
withID
, and it works normally:Is there a workaround to fix the first candidate issue without redefinition ?
The text was updated successfully, but these errors were encountered: