I put the following in my .init file:
(defun ndk/org-refile-candidates ()
(directory-files "/home/rob/Dokumente/todo/" t ".*\\.org$"))
(add-to-list 'org-refile-targets '(ndk/org-refile-candidates :maxlevel . 3))
It does work when evaluating manually with C-x C-e, but not when I restart Emacs.
I get the error:
Symbol's value as variable is void: org-refile-targets To ensure normal operation, you should investigate and remove the cause of the error in your initialization file. Start Emacs with the ‘--debug-init’ option to view a complete error backtrace.
Why isn't it setting the value of the variable like when I do it manually? Does it get overwritten by some default somehow? Can somebody point me into the right direction?