I have tried:
(setq initial-buffer-choice "~/todo.org")
But it opens the file in a new buffer (not scratch).
I have also tried:
(setq initial-scratch-message "~/todo.org")
But it prints the file path in the scratch buffer and i would like it's content.
I have tried:
(setq initial-major-mode org-mode)
But i have an initialisation error
Symbol's value as variable is void: org-mode
Finally, i'll go for this:
(condition-case err
(when (get-buffer "*scratch*")
(with-current-buffer "*scratch*"
(erase-buffer)
(insert-file-contents "~/todo.org")
(org-mode)
)
)
(error (message "%s" error-message-string err)))