I have following config for my org-roam:
(use-package org-roam
:ensure t
:init
(setq org-roam-v2-ack t)
:custom
(org-roam-directory "~/roamnotes")
(org-roam-completion-everywhere t)
(org-roam-capture-templates
'(("d" "Default" plain
"%?"
:if-new (file+head
"%<%Y%m%d%H%M%S>-${slug}.org"
"#+title: ${title}\n#+filetags: :nohtmlexport:\n#+date: %U\n#+auto_tangle: nil") ;; I want to split this long line
:unnarrowed t)
))
:config
(org-roam-setup)
(require 'org-roam-dailies)
(org-roam-db-autosync-mode)
)
What I want to do: To split long line: "#+title: ${title}\n#+filetags: :nohtmlexport:\n#+date: %U\n#+auto_tangle: nil".
What I've tried so far I: This works without an error, but stylistically looks very bad. (Just bad indent)
...
...
(org-roam-capture-templates
'(("d" "Default" plain
"%?"
:if-new (file+head
"%<%Y%m%d%H%M%S>-${slug}.org"
"#+title: ${title}
#+filetags: :nohtmlexport:
#+date: %U
#+auto_tangle: nil")
:unnarrowed t)
))
...
...
)
What I've tried so far II: This stylistically desirable, but this gets an error:
(org-roam-capture-templates
'(("d" "Default" plain
"%?"
:if-new (file+head
"%<%Y%m%d%H%M%S>-${slug}.org"
(concat
"#+title: ${title}\n"
"#+filetags: :nohtmlexport:\n"
"#+date: %U\n"
"#+auto_tangle: nil"
)
)
:unnarrowed t)
))
org-roam-capture--fill-template: Wrong type argument: char-or-string-p, (concat "#+title: ${title}
" "#+filetags: :nohtmlexport:
" "#+date: %U
" "#+auto_tangle: nil")
Question:
- Why I can't use
concatinsideorg-roam-capture-templatesas written in above? - If it's possible to use
concat(or anything else), how to implement it?
backquoteandcommato evaluate part of the (now completely unevaluated because it is quoted) expression. – NickD May 02 '23 at 12:28\(file+head "...org" ,(concat "line1\n" "line2\n" "line3\n"))? Am I doing correct? This produces errororg-roam-capture--prepare-buffer: Wrong type argument: integer-or-marker-p, nil` – Garid May 02 '23 at 12:43,@which you can read about in the Emacs Lisp Ref doc. – NickD May 02 '23 at 13:37...'(("d" "Default" plain ...with a backquote:...`(("d" "Default" plain .... – NickD May 02 '23 at 18:05