I am having issues configuring org-capture templates on a work machine running windows 10.
I am currently using the standalone emacs 29.1-no-deps
.
I have this for capture config in init.el
:
(setq org-default-notes-file (expand-file-name "redacted"))
(setq org-capture-templates
'(("t" "Todo" entry (file+headline "redacted/capture.org" "Tasks")
"* TODO %?\n %i\n %a")
;; ("j" "Journal" entry (file+datetree "~/org/journal.org")
;; "* %?\nEntered on %U\n %i\n %a")
))
(defun my-org-capture-debug ()
(interactive)
(message "org-capture-templates: %s" org-capture-templates)
(org-capture))
(global-set-key (kbd "C-c c") 'my-org-capture-debug)
Y’all will have to trust me on the file names. Redacting the paths is maybe excessive but -shrug-.
Anyhow, if I C-c c
this is what I get in *Messages*
:
org-capture-templates: ((t Todo entry (file+headline redacted/capture.org Tasks) * TODO %?
%i
%a))
(New file)
File mode specification error: (wrong-number-of-arguments (0 . 0) 1)
org-capture: Capture abort: Wrong number of arguments: (0 . 0), 1
Quit
This is what I see in the debugger:
Debugger entered--Lisp error: (error "Capture abort: Wrong number of arguments: (0 . 0),...")
error("Capture abort: %s" "Wrong number of arguments: (0 . 0), 1")
org-capture()
my-org-capture-debug()
funcall-interactively(my-org-capture-debug)
command-execute(my-org-capture-debug)
That brings me to line 717 in org-capture
where I find the string "Capture abort: "
;; ...
(org-capture-set-target-location (and (equal goto 0) 'here))
(condition-case error
(org-capture-put :template (org-capture-fill-template))
((error quit)
(if (get-buffer "*Capture*") (kill-buffer "*Capture*"))
(error "Capture abort: %s" (error-message-string error))))
;; ...
I’m really not sure what the problem is. I copied the example from the Capture Templates docs page and changed the path.
My little own little debug function shows the correct path.
I have also tried:
- windows style paths
- unix style paths
- UNC style paths - some parts of emacs seem fine with these others choke on them (also note technically my files are on a network drive)
- creating a shortcut to my notes directory inside of
~/org
All result in the same error.