weirdNox / org-noter

Emacs document annotator, using Org-mode
GNU General Public License v3.0
1.08k stars 101 forks source link

custom property field for annotations #159

Closed uliw closed 2 years ago

uliw commented 2 years ago

currently, a note will create a properties drawer like this:

:PROPERTIES:
:NOTER_PAGE: [[pdf:~/user/papers_to_read/wolf-gladrow-2007-total-alkal.pdf::8++0.00;;annot-8-5]]
:ID:       ../../../papers_to_read/wolf-gladrow-2007-total-alkal.pdf-annot-8-5
:END:

when used in conjunction with org-roam, this will automatically create an org-roam node. adding:

:ROAM_EXCLUDE: t

will prevent this. However, is there a way to insert this into the property drawer as a default?

c1-g commented 2 years ago

Yes, org-noter-insert-heading-hook allows you to call a function every time a note heading is created by org-noter.

Put this in your .emacs file,

(defun my-exclude-heading-from-roam ()
  "Add ROAM_EXCLUDE property to a heading at point."
  (org-entry-put nil "ROAM_EXCLUDE" "t"))

(add-hook 'org-noter-insert-heading-hook 'my-exclude-heading-from-roam)
uliw commented 2 years ago

Much obliged!