org-capture: distinguishing denote as a target from other/regular org buffers #326
Unanswered
DivineDominion
asked this question in
Q&A
Replies: 1 comment
-
So one way to write the condition I tried is this: (string= (format "%s" (org-capture-get :target))
(format "%s" #'ct/denote-journal-filename)) But the first one returns Adding another quote works, but quoting a function-quoted form again...? (string= (format "%s" (org-capture-get :target))
(format "%s" '#'ct/denote-journal-filename)) Edit: ah, works with (equal (org-capture-get :target) '#'ct/denote-journal-filename) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
So I have this function that adds a properties drawer to the captured item via
org-capture-before-finalize-hook
.I also use org-capture to quickly append journal entries to denote-managed journal files. There, I don't want the hook to execute.
So I'm trying to write a
org-capture-targeting-denote-p
predicate of sorts.I tried to find a way to distinguish "is this going into denote" from all other capture targets but I couldn't get the info from
org-capture-plist
to do the job:This looks promising:
So a noob elisp question: how can I compare the function reference/symbols in a condition?
I'm now thinking about changing the approach to not automatically and silently add the property drawer, but make it part of the capture template strings instead, so that the denote capture template doesn't inherit this behavior. Nevertheless, the predicate sounds potentially useful to share with others, so I'd like to check what would be the best way to approach this :)
Example: the hook in question
Beta Was this translation helpful? Give feedback.
All reactions