# Org-roam-dailies: how to browse through previous days

**URL:** <https://org-roam.discourse.group/t/org-roam-dailies-how-to-browse-through-previous-days/1018>\
**Category:** Requests\
**Created:** [December 2, 2020, 2:05am UTC](https://org-roam.discourse.group/t/org-roam-dailies-how-to-browse-through-previous-days/1018 "2020-12-02T02:05:03Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![lyndondrake](https://avatars.discourse-cdn.com/v4/letter/l/49beb7/32.png) [@lyndondrake](https://org-roam.discourse.group/u/lyndondrake)\
**Post date:** [December 2, 2020, 2:05am UTC](https://org-roam.discourse.group/t/org-roam-dailies-how-to-browse-through-previous-days/1018/1 "2020-12-02T02:05:03Z")

</div>

I’m wondering what the best way is to look through previous days’ org-roam-dailies entries? I can call org-roam-dailies-date and it shows me a calendar, and dates with entries are highlighted. But, if I shift to a previous month, all the per-day highlighting vanishes.

Also, if I could, I’d love a kind of split-screen view where I could just navigate up and down the list on the left-hand side, and see the org-roam-dailies files on the right. Maybe there’s even a way to do that in Emacs already?

---

<div class="post-metadata">

**Author:** ![bepolymathe](https://yyz2.discourse-cdn.com/free1/user_avatar/org-roam.discourse.group/bepolymathe/32/688_2.png) [@bepolymathe](https://org-roam.discourse.group/u/bepolymathe)\
**Post date:** [December 2, 2020, 6:53am UTC](https://org-roam.discourse.group/t/org-roam-dailies-how-to-browse-through-previous-days/1018/2 "2020-12-02T06:53:21Z")

</div>

Hi,

For my part, I keep it simple. I put a “journal” folder in the “roam” folder that includes all journal entries. So I can search simply by the file name (which is the date) when I know the date. I use too `org-roam-dailes-find-yesterday` …

If you don’t know the date, you can use `deft` or `rg` to search in the notes.

---

<div class="post-metadata">

**Author:** ![lyndondrake](https://avatars.discourse-cdn.com/v4/letter/l/49beb7/32.png) [@lyndondrake](https://org-roam.discourse.group/u/lyndondrake)\
**Post date:** [December 2, 2020, 8:10am UTC](https://org-roam.discourse.group/t/org-roam-dailies-how-to-browse-through-previous-days/1018/3 "2020-12-02T08:10:07Z")

</div>

That makes sense. Is there a good way to have a split screen?

E.g. in using DevonThink, I could just use the arrow keys to scroll down the index on the left-hand-side of the screen, and the right-hand pane would show the contents of the current ite.

---

<div class="post-metadata">

**Author:** ![bepolymathe](https://yyz2.discourse-cdn.com/free1/user_avatar/org-roam.discourse.group/bepolymathe/32/688_2.png) [@bepolymathe](https://org-roam.discourse.group/u/bepolymathe)\
**Post date:** [December 2, 2020, 9:52am UTC](https://org-roam.discourse.group/t/org-roam-dailies-how-to-browse-through-previous-days/1018/4 "2020-12-02T09:52:45Z")

</div>

Something like this ?

 ![image](https://global.discourse-cdn.com/free1/uploads/orgroam/original/1X/b618b52f77047fbc6958672482dcd5e967fc0ffe.png)

---

<div class="post-metadata">

**Author:** ![nobiot](https://yyz2.discourse-cdn.com/free1/user_avatar/org-roam.discourse.group/nobiot/32/159_2.png) [@nobiot](https://org-roam.discourse.group/u/nobiot)\
**Post date:** [December 2, 2020, 1:07pm UTC](https://org-roam.discourse.group/t/org-roam-dailies-how-to-browse-through-previous-days/1018/5 "2020-12-02T13:07:10Z")

</div>

I have a very similar set up with the one @bepolymathe has

 ![image](https://global.discourse-cdn.com/free1/uploads/orgroam/original/1X/8e82a0aadd2377d6931658edd254f5ee83a5f081.png)

The very left is a simple Dired (with `dired-hide-details-mode` to show only the file names).  
The middle is the note, and the right is the backlink buffer from `org-roam`.

I have the following in my `init.el` to define custom functions for me to navigate the Dired buffer up and down.

Basically, up or down to display the note, and update the backlink. You don’t go out of Dired, so you can skim throught the directory with backlinks (it also works in directories outside Org-roam without backlinks).

I don’t use dailies, but I believe you can use this way for the dailies directory (??)

I have to add, though, splitting the screen in this way is manually done – I don’t have a good way to set the sizes correctly and automatically.

```auto
;;; Edited 20201-02-08
;;; Dired
(defun my/check-org-roam-buffer-p (buf)
  "Return non-nil if BUF is org-roam-buffer that can be refleshed.
It also checks the following:
- `org-roam' is indeed loaded
- BUF is visiting an Org-roam file
- org-roam-buffer exists"
  (and (functionp #'org-roam--org-roam-file-p)
       (org-roam--org-roam-file-p (buffer-file-name buf))
       (not (eq (org-roam-buffer--visibility) 'none))))

;;;###autoload
(defun my/dired-display-next-file ()
  "In Dired directory, go to the next file, and open it.
            If `org-roam-mode' is active, update the org-roam-buffer."
  (interactive)
  (dired-next-line 1)
  (let ((buf (find-file-noselect (dired-get-file-for-visit))))
    (display-buffer buf t)
    (when (my/check-org-roam-buffer-p buf)
      (with-current-buffer buf
        (setq org-roam--current-buffer buf)
        (org-roam-buffer-update)))))

;;;###autoload
(defun my/dired-display-prev-file ()
  "In Dired directory, go to the previous file, and open it.
            If `org-roam-mode' is active, update the org-roam-buffer."
  (interactive)
  (dired-previous-line 1)
  (let ((buf (find-file-noselect (dired-get-file-for-visit))))
    (display-buffer buf t)
    (when (my/check-org-roam-buffer-p buf)
      (with-current-buffer buf
        (setq org-roam--current-buffer buf)
        (org-roam-buffer-update)))))

(add-hook 'dired-mode-hook
          (lambda ()
            (dired-hide-details-mode 1)
            ;; I don't use dired-subtree at the moment
            ;;(define-key dired-mode-map (kbd "<tab>") #'dired-subtree-toggle)
            ;;(define-key dired-mode-map (kbd "<C-tab>") #'dired-subtree-cycle)
            (define-key dired-mode-map (kbd "<SPC>") #'my/dired-display-next-file)
            (define-key dired-mode-map (kbd "<down>") #'my/dired-display-next-file)
            (define-key dired-mode-map (kbd "<up>") #'my/dired-display-prev-file)))
```

---

<div class="post-metadata">

**Author:** ![lyndondrake](https://avatars.discourse-cdn.com/v4/letter/l/49beb7/32.png) [@lyndondrake](https://org-roam.discourse.group/u/lyndondrake)\
**Post date:** [December 2, 2020, 5:31pm UTC](https://org-roam.discourse.group/t/org-roam-dailies-how-to-browse-through-previous-days/1018/6 "2020-12-02T17:31:18Z")

</div>

> [@nobiot](#):
>
> The very left is a simple Dired (with `dired-hide-details-mode` to show only the file names).  
> The middle is the note, and the right is the backlink buffer from `org-roam` .

That’s exactly what I’m after.

How do you trigger your Dired window to get into that mode? Apologies for what is probably a dumb question - still trying to figure out how Emacs works. Is that lambda mode-hook something that you trigger manually, or (as I think) it kicks in whenever you invoke Dired?

---

<div class="post-metadata">

**Author:** ![nobiot](https://yyz2.discourse-cdn.com/free1/user_avatar/org-roam.discourse.group/nobiot/32/159_2.png) [@nobiot](https://org-roam.discourse.group/u/nobiot)\
**Post date:** [December 2, 2020, 10:02pm UTC](https://org-roam.discourse.group/t/org-roam-dailies-how-to-browse-through-previous-days/1018/7 "2020-12-02T22:02:03Z")

</div>

No worries.  
Yes, `(add-hook 'dired-mode-hook ...body...)` makes the body to kick in when `dired-mode` is invoked. In my case, all the body is encapsulated within the lambda expression (you can use a named function, but I find lambda convenient).

The way I get into Dired is simple. In the note you are in, call `C-x C-f`; stock standard `find-file` and type a dot (".") and enter (to open the current directory, not a file). This opens a Dired buffer, and replaces the note buffer. If you had the backlink buffer open, it should be kept open (this might depend on Doom, etc. but my vanilla does not close it).

Call `C-x 3` to split the window vertically. Then I manually drag the line to adjust the size… I am pretty sure there is more elegant way, but for me it’s enough. I also have a keybinding to adjust the size by a key stroke, but I rarely use it (the commands are `shrink-window-horizontally` and `enlarge-window-horizontally`).

Just as a side note, if you are still finding a way around Emacs… You might not like the esthetics of the menu bar, but I personally keep it on. It helps me discover and remind me of these “basic” navigation and functions, etc. – it might be helpful to keep it while until you are comfortable with Emacs. I would consider myself a confident Emacs user but I find it essential (It’s not distracting for me in most cases; I can easily turn it off temporarily if I want to focus on writing).

 ![image](https://global.discourse-cdn.com/free1/uploads/orgroam/original/1X/af964c08ddb064f2a9ab3f11c940360b33204051.png)

---

<div class="post-metadata">

**Author:** ![lyndondrake](https://avatars.discourse-cdn.com/v4/letter/l/49beb7/32.png) [@lyndondrake](https://org-roam.discourse.group/u/lyndondrake)\
**Post date:** [December 3, 2020, 12:53am UTC](https://org-roam.discourse.group/t/org-roam-dailies-how-to-browse-through-previous-days/1018/8 "2020-12-03T00:53:46Z")

</div>

Thanks for this - super helpful.

What do you do if you want a “standard” Dired, where you can see more details and do more stuff to files?

---

<div class="post-metadata">

**Author:** ![nobiot](https://yyz2.discourse-cdn.com/free1/user_avatar/org-roam.discourse.group/nobiot/32/159_2.png) [@nobiot](https://org-roam.discourse.group/u/nobiot)\
**Post date:** [December 3, 2020, 6:15am UTC](https://org-roam.discourse.group/t/org-roam-dailies-how-to-browse-through-previous-days/1018/10 "2020-12-03T06:15:18Z")

</div>

@lyndondrake

Remove this part, or call it via M-x in Dired to tooggle it on/off (I think).

> [@nobiot](#):
>
> `(dired-hide-details-mode 1)`

---

<div class="post-metadata">

**Author:** ![nobiot](https://yyz2.discourse-cdn.com/free1/user_avatar/org-roam.discourse.group/nobiot/32/159_2.png) [@nobiot](https://org-roam.discourse.group/u/nobiot)\
**Post date:** [December 3, 2020, 6:35am UTC](https://org-roam.discourse.group/t/org-roam-dailies-how-to-browse-through-previous-days/1018/11 "2020-12-03T06:35:29Z")

</div>

In fact, it’s this. I discovered something new with the menu bar, hey 😉

 ![image](https://global.discourse-cdn.com/free1/uploads/orgroam/original/1X/2b5b675693e9a726313cc668c39a99d1617ef95b.png)

---

<div class="post-metadata">

**Author:** ![lyndondrake](https://avatars.discourse-cdn.com/v4/letter/l/49beb7/32.png) [@lyndondrake](https://org-roam.discourse.group/u/lyndondrake)\
**Post date:** [December 3, 2020, 7:23am UTC](https://org-roam.discourse.group/t/org-roam-dailies-how-to-browse-through-previous-days/1018/12 "2020-12-03T07:23:00Z")

</div>

Ha! perfect

---

<div class="post-metadata">

**Author:** ![lyndondrake](https://avatars.discourse-cdn.com/v4/letter/l/49beb7/32.png) [@lyndondrake](https://org-roam.discourse.group/u/lyndondrake)\
**Post date:** [December 3, 2020, 7:23am UTC](https://org-roam.discourse.group/t/org-roam-dailies-how-to-browse-through-previous-days/1018/13 "2020-12-03T07:23:22Z")

</div>

The next thing I want to figure out is how to get a Helm buffer up with a list of the titles, working the same way… more for the main org-roam files, not the dailies

---

<div class="post-metadata">

**Author:** ![nobiot](https://yyz2.discourse-cdn.com/free1/user_avatar/org-roam.discourse.group/nobiot/32/159_2.png) [@nobiot](https://org-roam.discourse.group/u/nobiot)\
**Post date:** [December 3, 2020, 7:29am UTC](https://org-roam.discourse.group/t/org-roam-dailies-how-to-browse-through-previous-days/1018/14 "2020-12-03T07:29:01Z")

</div>

Sorry I can’t help you with that; I don’t use helm…

---

<div class="post-metadata">

**Author:** ![edumerco](https://yyz2.discourse-cdn.com/free1/user_avatar/org-roam.discourse.group/edumerco/32/52_2.png) [@edumerco](https://org-roam.discourse.group/u/edumerco)\
**Post date:** [December 22, 2020, 11:25pm UTC](https://org-roam.discourse.group/t/org-roam-dailies-how-to-browse-through-previous-days/1018/15 "2020-12-22T23:25:54Z")

</div>

If you want to open a note, doesn’t `org-roam-find-file` (C-c n f) or `org-roam-insert` (C-c n i) work for you?

---

<div class="post-metadata">

**Author:** ![lyndondrake](https://avatars.discourse-cdn.com/v4/letter/l/49beb7/32.png) [@lyndondrake](https://org-roam.discourse.group/u/lyndondrake)\
**Post date:** [December 30, 2020, 8:24am UTC](https://org-roam.discourse.group/t/org-roam-dailies-how-to-browse-through-previous-days/1018/16 "2020-12-30T08:24:53Z")

</div>

They do - it’s the quick browsing through of many notes that I’m after. Many GUI apps allow for fast/efficient browsing with a sidebar. Think of the Preview sidebar in the MacOS Finder, for example. I’m trying to recreate that experience.

---

<div class="post-metadata">

**Author:** ![edumerco](https://yyz2.discourse-cdn.com/free1/user_avatar/org-roam.discourse.group/edumerco/32/52_2.png) [@edumerco](https://org-roam.discourse.group/u/edumerco)\
**Post date:** [January 5, 2021, 4:17pm UTC](https://org-roam.discourse.group/t/org-roam-dailies-how-to-browse-through-previous-days/1018/17 "2021-01-05T16:17:42Z")

</div>

I don’t use MacOS so I don’t know exactly what you are after. However, did you try the hover over the nodes in the graph with the preview enabled? 🙂

---

<div class="post-metadata">

**Author:** ![jungleb77](https://avatars.discourse-cdn.com/v4/letter/j/c2a13f/32.png) [@jungleb77](https://org-roam.discourse.group/u/jungleb77)\
**Post date:** [January 31, 2021, 2:20pm UTC](https://org-roam.discourse.group/t/org-roam-dailies-how-to-browse-through-previous-days/1018/18 "2021-01-31T14:20:38Z")

</div>

I’m surprised that this isn’t a feature in Roam yet! I can’t imagine switching to a 1 entry per file for dailies and not be able to quickly scan up/down through the days. It’s the equivalent of flipping through pages in a journal. I thought I’d be able to use ranger with preview, but org-roam seems to break that feature somehow.

---

<div class="post-metadata">

**Author:** ![nobiot](https://yyz2.discourse-cdn.com/free1/user_avatar/org-roam.discourse.group/nobiot/32/159_2.png) [@nobiot](https://org-roam.discourse.group/u/nobiot)\
**Post date:** [February 8, 2021, 9:52am UTC](https://org-roam.discourse.group/t/org-roam-dailies-how-to-browse-through-previous-days/1018/19 "2021-02-08T09:52:48Z")

</div>

Just as a follow up.  
I think I have managed to open a dired on the side in a side window with this function.  
The size, which side (right, left, top, buttom), etc. etc. can be personalized.  
If you don’t want to automatically move to the side window, you can remove `(select-window)` function.

```auto
(defun my/dired-in-side-buffer ()
  "Display Dired in a side window."
  (interactive)
  (let* ((dir (read-directory-name "Direcotry: "))
         (buf (dired-noselect dir)))
    (select-window
     (display-buffer-in-side-window buf
                                   '((side . left)
                                     (window-width . 30)
                                     (slot . -1)
                                     (window-parameters . ((mode-line-format . none))))))))

```

 ![image](https://global.discourse-cdn.com/free1/uploads/orgroam/original/1X/91918434d99aa56b21d4bc19b5af02cc324c136e.png)

---

<div class="post-metadata">

**Author:** ![panmengguan](https://avatars.discourse-cdn.com/v4/letter/p/5f9b8f/32.png) [@panmengguan](https://org-roam.discourse.group/u/panmengguan)\
**Post date:** [January 23, 2023, 3:49am UTC](https://org-roam.discourse.group/t/org-roam-dailies-how-to-browse-through-previous-days/1018/20 "2023-01-23T03:49:53Z")

</div>

Thanks very much. I think this can also be a general solution for browsing files in a directory via Emacs dired-mode. But when I tried this, especially when I put the dired buffer as a side buffer, Emacs always splits the window when I navigates via the `my/dired-display-next-file` and `my/dired-display-prev-file` functions. Is there any suggestion to prevent this behaviour?

---

<div class="post-metadata">

**Author:** ![nobiot](https://yyz2.discourse-cdn.com/free1/user_avatar/org-roam.discourse.group/nobiot/32/159_2.png) [@nobiot](https://org-roam.discourse.group/u/nobiot)\
**Post date:** [January 23, 2023, 5:30pm UTC](https://org-roam.discourse.group/t/org-roam-dailies-how-to-browse-through-previous-days/1018/21 "2023-01-23T17:30:31Z")

</div>

This is from 2 years ago; I now use something different:

```plaintext
(defvar my/dired-preview-temp-buffer nil)

;;;###autoload
(defun my/dired-preview ()
  "Preview a file/directory at point in Dired.
It's similar to `dired-display-file' but it checks if a buffer
visiting a file is live. If not, it will be put into a temp file
to be removed."
  (when my/dired-preview-temp-buffer (kill-buffer my/dired-preview-temp-buffer))
  (setq my/dired-preview-temp-buffer nil)
  (let* ((file (dired-get-file-for-visit))
         (buf (find-buffer-visiting file)))
    (unless buf
      (setq buf (find-file-noselect file))
      (setq my/dired-preview-temp-buffer buf))
    ;; Check if a buffer visiting file is live; if not it's a temp buffer to be
    ;; deleted.
    (display-buffer buf t)))

;;;###autoload
(defun my/dired-next-line-display ()
  (interactive)(dired-next-line 1)(my/dired-preview))

;;;###autoload
(defun my/dired-previous-line-display ()
  (interactive)(dired-previous-line 1)(my/dired-preview))

```

Where the buffer is displayed depends on your configuration. Mine is vanilla and these functions are designed for my setup. If you are using Doom, you are likely to have very different behaviour – I believe by default a module called `popup` controls “window management”.

[Next page](https://org-roam.discourse.group/t/org-roam-dailies-how-to-browse-through-previous-days/1018.md?page=2)
