I’m a long-time note-taking geek, currently using org-agenda/org-capture/Beorg for task management. I’m ready to dive in to org-roam for what I call my knowledge base and I’m considering adopting the org-roam journaling workflow as well.
My questions are:
Is org-journal still buying me something over org-roam-dailies? Or the reverse?
Which of these are people using?
Can I have weekly files instead of daily files using org-roam-dailies?
2 Likes
jbaty
June 16, 2020, 9:59am
2
For me, org-journal improves upon org-roam-dailies in a few ways…
I prefer the way it handles searches
It manages TODOs nicely (automatically updates the agenda files list and rolls incomplete TODOs forward
Better (I think) calendar mode integration and navigation between dates
Easier to create and browse future entries
3 Likes
Thanks for your answer @jbaty , it’s very helpful.
I’m keeping my TODOs in a small number of separate files and archive tasks regularly: I’m traumatized by the degradation in performance of org-agenda
once it has too much data to deal with. It’s not the ideal system (a tad more maintenance overhead than I would like) but manageable using org-capture
systematically and the occasional org-id
link to more substantial notes.
So for me point 2 would not apply (at least for now). Points 1, 3 and 4 sound like enough to give it a try, though.
Any org-roam-dailies
advocates out there?
1 Like
jethro
June 16, 2020, 1:43pm
4
It’s basically a stripped down version of org-journal. Some people dont want to install another package for journaling, and I think org-journal covers most of the daily notes functionality, so there’s little incentive to get it to feature parity. Unless someone comes up with a feature proposal that org-journal doesn’t cover I’d recommend it.
2 Likes
Very clear.
Thanks so much for the great work @jethro . I’d spent quite some time trying to figure out how to bend org-mode for my needs and was coming short; org-roam unlocks a lot of potential with an elegant solution. You guys are working fast and making good decisions, it’s very impressive.
Are the recent developments of org-roam-dailies changing the game in this area? Is it necessary or desirable to switch from org-journal to org-roam-daily in view of future developments?
kris
October 26, 2021, 8:18pm
7
For me the most important feature of org-journal is the second one you mentioned.
And I still use org-roam-dailies for its file can be included in org-roam database and shown in org-roam buffer.
So, I put my journal files into a directory in my org-roam-directory
to get both mode’s advantage.
A compatibility problem exists though, and I managed to solve it.
opened 09:47PM - 06 Sep 21 UTC
### Description
When using org-journal-mode in a org-roam-dailies file (more pr… ecisely, a file in `org-roam-directory`), after running `save-buffer`, org-journal-mode is turned off and evil shortcuts do not work.
Used edebug to find that this is caused by macro `org-roam-with-file`, if current buffer is not equal to org-mode (like org-journal-mode), the macro will `delay-mode-hooks` and run `(org-mode)`. Because of delaying of hooks, org-journal-mode is not activated, neither do evil key-bindings. [See related code](https://github.com/org-roam/org-roam/blob/1795039ab93ef19611dbb3fca21c4211c4e655a9/org-roam-utils.el#L78-L83).
#### Steps to Reproduce
1. set `org-journal-dir` and `org-roam-dailies-directory` to be the same and the latter should be in `org-roam-directory`, of course. (I think just make `org-journal-dir` to be inside of `org-roam-directory` should be enough to reproduce, since the problem is caused by `org-roam-with-file`.)
2. open a journal by `org-journal-new-entry`.
3. Make the buffer modified and save-buffer.
4. You can see org-journal-mode is turned off and evil shortcuts not working.
#### Backtrace
The following backtrace is generated by inserting `(edebug)` after [this line](https://github.com/org-roam/org-roam/blob/1795039ab93ef19611dbb3fca21c4211c4e655a9/org-roam-utils.el#L83).
```
Debugger entered: nil
edebug()
(save-current-buffer (set-buffer buf) (if (equal major-mode 'org-mode) nil (progn (make-local-variable 'delay-mode-hooks) (let ((delay-mode-hooks t)) (let ((org-inhibit-startup t) (org-agenda-files nil)) (org-mode))))) (edebug) (setq res (progn (let ((emacsql--connection (org-roam-db)) (emacsql--completed nil) (emacsql--transaction-level (1+ emacsql--transaction-level)) (emacsql--result)) (unwind-protect (while (not emacsql--completed) (condition-case nil (progn ... ...) (emacsql-locked ... ...))) (if (and (= 1 emacsql--transaction-level) (not emacsql--completed)) (progn (emacsql emacsql--connection ...)))) emacsql--result))) (if (and new-buf (not nil)) nil (save-buffer)))
(let* (new-buf (auto-mode-alist nil) (buf (or (and (not file-path) (current-buffer)) (find-buffer-visiting file-path) (progn (setq new-buf t) (find-file-noselect file-path)))) res) (save-current-buffer (set-buffer buf) (if (equal major-mode 'org-mode) nil (progn (make-local-variable 'delay-mode-hooks) (let ((delay-mode-hooks t)) (let ((org-inhibit-startup t) (org-agenda-files nil)) (org-mode))))) (edebug) (setq res (progn (let ((emacsql--connection (org-roam-db)) (emacsql--completed nil) (emacsql--transaction-level (1+ emacsql--transaction-level)) (emacsql--result)) (unwind-protect (while (not emacsql--completed) (condition-case nil ... ...)) (if (and ... ...) (progn ...))) emacsql--result))) (if (and new-buf (not nil)) nil (save-buffer))) (if (and new-buf (not nil)) (if (find-buffer-visiting file-path) (progn (kill-buffer (find-buffer-visiting file-path))))) res)
(if (string= content-hash db-hash) nil (let* (new-buf (auto-mode-alist nil) (buf (or (and (not file-path) (current-buffer)) (find-buffer-visiting file-path) (progn (setq new-buf t) (find-file-noselect file-path)))) res) (save-current-buffer (set-buffer buf) (if (equal major-mode 'org-mode) nil (progn (make-local-variable 'delay-mode-hooks) (let ((delay-mode-hooks t)) (let (... ...) (org-mode))))) (edebug) (setq res (progn (let ((emacsql--connection ...) (emacsql--completed nil) (emacsql--transaction-level ...) (emacsql--result)) (unwind-protect (while ... ...) (if ... ...)) emacsql--result))) (if (and new-buf (not nil)) nil (save-buffer))) (if (and new-buf (not nil)) (if (find-buffer-visiting file-path) (progn (kill-buffer (find-buffer-visiting file-path))))) res))
(let ((content-hash (org-roam-db--file-hash file-path)) (db-hash (car (car (org-roam-db-query [:select hash :from files :where (= file $s1)] file-path)))) info) (if (string= content-hash db-hash) nil (let* (new-buf (auto-mode-alist nil) (buf (or (and (not file-path) (current-buffer)) (find-buffer-visiting file-path) (progn (setq new-buf t) (find-file-noselect file-path)))) res) (save-current-buffer (set-buffer buf) (if (equal major-mode 'org-mode) nil (progn (make-local-variable 'delay-mode-hooks) (let (...) (let ... ...)))) (edebug) (setq res (progn (let (... ... ... ...) (unwind-protect ... ...) emacsql--result))) (if (and new-buf (not nil)) nil (save-buffer))) (if (and new-buf (not nil)) (if (find-buffer-visiting file-path) (progn (kill-buffer (find-buffer-visiting file-path))))) res)))
org-roam-db-update-file()
(progn (org-roam-db-update-file))
(if org-roam-db-update-on-save (progn (org-roam-db-update-file)))
org-roam-db-autosync--try-update-on-save-h()
funcall(org-roam-db-autosync--try-update-on-save-h)
(condition-case e (funcall hook) ((debug error) (signal 'doom-hook-error (list hook e))))
doom-run-hook(org-roam-db-autosync--try-update-on-save-h)
run-hook-wrapped(doom-run-hook org-roam-db-autosync--try-update-on-save-h)
(condition-case e (run-hook-wrapped hook #'doom-run-hook) ((debug doom-hook-error) (if debug-on-error nil (lwarn hook :error "Error running hook %S because: %s" (if (symbolp (car (cdr e))) (symbol-name (car (cdr e))) (car (cdr e))) (car (cdr (cdr e))))) (signal 'doom-hook-error (cons hook (cdr e)))))
(let ((hook (car --dolist-tail--))) (condition-case e (run-hook-wrapped hook #'doom-run-hook) ((debug doom-hook-error) (if debug-on-error nil (lwarn hook :error "Error running hook %S because: %s" (if (symbolp (car ...)) (symbol-name (car ...)) (car (cdr e))) (car (cdr (cdr e))))) (signal 'doom-hook-error (cons hook (cdr e))))) (setq --dolist-tail-- (cdr --dolist-tail--)))
(while --dolist-tail-- (let ((hook (car --dolist-tail--))) (condition-case e (run-hook-wrapped hook #'doom-run-hook) ((debug doom-hook-error) (if debug-on-error nil (lwarn hook :error "Error running hook %S because: %s" (if (symbolp ...) (symbol-name ...) (car ...)) (car (cdr ...)))) (signal 'doom-hook-error (cons hook (cdr e))))) (setq --dolist-tail-- (cdr --dolist-tail--))))
(let ((--dolist-tail-- hooks)) (while --dolist-tail-- (let ((hook (car --dolist-tail--))) (condition-case e (run-hook-wrapped hook #'doom-run-hook) ((debug doom-hook-error) (if debug-on-error nil (lwarn hook :error "Error running hook %S because: %s" (if ... ... ...) (car ...))) (signal 'doom-hook-error (cons hook (cdr e))))) (setq --dolist-tail-- (cdr --dolist-tail--)))))
doom-run-hooks(after-save-hook)
apply(doom-run-hooks after-save-hook)
run-hooks(after-save-hook)
basic-save-buffer()
```
#### My solution
Change code [here](https://github.com/org-roam/org-roam/blob/1795039ab93ef19611dbb3fca21c4211c4e655a9/org-roam-utils.el#L78-L83) from `(equal major-mode 'org-mode)` to `(derived-mode-p 'org-mode)`:
```emacs-lisp
(with-current-buffer buf
(unless (derived-mode-p 'org-mode)
(delay-mode-hooks
(let ((org-inhibit-startup t)
(org-agenda-files nil))
(org-mode))))
```
then, this block of code will not run in org-journal-mode, and the issue is avoided.
### Environment
- Emacs: GNU Emacs 28.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.29, cairo version 1.17.4)
of 2021-06-12
- Framework: Doom
- Org: Org mode version 9.5 (9.5-b83ae59 @ /home/user/doom-emacs/.local/straight/build-28.0.50/org/)
- Org-roam: v2.1.0-16-g1795039-dirty
- Org-roam commit: https://github.com/org-roam/org-roam/commit/1795039ab