Updated jm/org-roam-goto-today to be relative (next/prev)
This commit is contained in:
parent
182e9c30da
commit
cf8eaf89bc
@ -7,8 +7,15 @@ As of now, I haven't added anything here, though I do expect to start adding som
|
||||
Shortcut to goto todays org-roam dailies document.
|
||||
|
||||
#+begin_src emacs-lisp
|
||||
(defun jm/dailies-file-p ()
|
||||
(let ((file-base (file-name-base (buffer-file-name))))
|
||||
(s-matches-p "^[0-9]+-[0-9]+-[0-9]+$" file-base)))
|
||||
|
||||
(defun jm/org-roam-goto-day (days)
|
||||
(let* ((rel-time (time-add (current-time) (days-to-time days)))
|
||||
(let* ((base-time (if (and (jm/dailies-file-p) (not (eq days 0)))
|
||||
(date-to-time (file-name-base (buffer-file-name)))
|
||||
(current-time)))
|
||||
(rel-time (time-add base-time (days-to-time days)))
|
||||
(path (format-time-string "%Y-%m-%d.org" rel-time))
|
||||
(full-path (file-name-concat org-roam-directory "daily" path)))
|
||||
(if (file-exists-p full-path)
|
||||
|
Loading…
x
Reference in New Issue
Block a user