-
-
Notifications
You must be signed in to change notification settings - Fork 468
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
ROAM_REFS is being inserted into file top PROPERTIES when capturing ref as an entry #1937
Comments
I hit the exact issue today. All my roam_refs are essentially duplicated by this. Do you find a way to not automatically insert ROAM_REFS at file level? |
This hook is automatically added for capture which caused the problem. I worked around by Some relevant discussion here |
For me this change fixed the behavior for diff --git a/org-roam-capture.el b/org-roam-capture.el
index 8ec9170..4c9b328 100644
--- a/org-roam-capture.el
+++ b/org-roam-capture.el
@@ -495,9 +495,8 @@ Return the ID of the location."
new-file-p (org-roam-capture--new-file-p path))
(when new-file-p (org-roam-capture--put :new-file path))
(set-buffer (org-capture-target-buffer path))
- (setq p (point-min))
(let ((m (org-roam-capture-find-or-create-olp olp)))
- (goto-char m))
+ (setq p (goto-char m)))
(widen))
(`(file+head ,path ,head)
(setq path (org-roam-capture--target-truepath path)
@@ -516,9 +515,8 @@ Return the ID of the location."
(when new-file-p
(org-roam-capture--put :new-file path)
(insert (org-roam-capture--fill-template head 'ensure-newline)))
- (setq p (point-min))
(let ((m (org-roam-capture-find-or-create-olp olp)))
- (goto-char m)))
+ (setq p (goto-char m))))
(`(file+datetree ,path ,tree-type)
(setq path (org-roam-capture--target-truepath path))
(require 'org-datetree) Used with this template: (setq org-roam-capture-ref-templates
'(("r" "reference" plain "%?"
:target (file+olp "references.org" ("${title}"))
:unnarrowed t))) |
Suitable for maintaining a list of references in a single specific file, possibly in cooperation with org-bibtex. Related to issue org-roam#1937.
Description
When I attempt to capture some ref from browser as entry (as level 1 heading inside org-roam file node), the ROAM_REFS gets inserted into its file-top :PROPERTIES: drawer in addition to correct expansion from the capture template itself.
I tracked down this behavior to
org-roam-protocol--insert-captured-ref-h
and its invocation inorg-roam-capture--prepare-buffer
through(run-hooks 'org-roam-capture-new-node-hook)
Steps to Reproduce
Backtrace
Expected Results
ROAM_REFS gets added only to the newly created level 1 org entry in accordance with capture template "r"
Actual Results
ROAM_REFS gets added to the file top PROPERTIES drawer in addition to expansion of template "r"
Environment
latest org-roam commit, up-to-date doom-emacs, emacs 28.60 native-comp
The text was updated successfully, but these errors were encountered: