Hi all, I did some digging into Roam Research and noticed that they have the “daily for today” as the default launch page. I like this idea but am having some trouble reimplementing it in (doom) emacs.
Specifically, I have the following at the end of my config.el:
oh hey! actually, this works! I guess I had to disable my initial dashboard package. One hiccup is that I am always prompted for a template selection, which I would like to default. If someone had pointers here, this would be appreciated.
This PR addresses a larger concern of “how to deal with a dynamic file lookup” but since I am only interested in a static lookup of a specific template, the proposed workaround is a bit of an overkill:
(defun with-first-dailies-capture-template (dailies-find-function &rest args)
"Temporarily shadow org-roam-dailies-capture-templates with only
its first entry when calling DAILIES-FIND-FUNCTION to prevent
template-select menu from showing."
(let ((org-roam-dailies-capture-templates
(list (car org-roam-dailies-capture-templates))))
(apply dailies-find-function args)))
;; ADD advice to only use first dailies template for all dailies find functions
(advice-add #'org-roam-dailies-find-today :around #'with-first-dailies-capture-template)
(advice-add #'org-roam-dailies-find-date :around #'with-first-dailies-capture-template)
(advice-add #'org-roam-dailies-find-tomorrow :around #'with-first-dailies-capture-template)
(advice-add #'org-roam-dailies-find-yesterday :around #'with-first-dailies-capture-template)
Although, specifically, I needed to add (advice-add #'org-roam-dailies-goto-today :around #'with-first-dailies-capture-template).
Lightly tested to work on my end – I don’t use Doom so that may require your way with advice :around.
Just some ideas if you should prefer to avoid advice.
The documentation of org-roam-dailies-goto-today says this:
org-roam-dailies-goto-today is an interactive and natively compiled
function defined in org-roam-dailies.el.
Signature
(org-roam-dailies-goto-today &optional KEYS)
Documentation
Find the daily-note for today, creating it if necessary.
ELisp programs can set KEYS to a string associated with a template.
In this case, interactive selection will be bypassed.
In my configuration (using Doom Emacs), it’s only necessary to put the following in init.el: (setq initial-buffer-choice (lambda () (org-roam-dailies-goto-today "d") (current-buffer))). The (current-buffer) is because initial-buffer-choice is expected to return a buffer.
Thanks @telotortium! Yes, this answer is out of date with the latest version of org-roam — your answer would be the “accepted” one if this was stack overflow : )