emacs/org-roam 可以像 logseq 一样纵览 daily 笔记吗?

目前 emacss/org-roam 一次只能看一天的 daily note,logseq 一次可以通览多日 daily note 感觉很方便回顾,emacs 可以设置成这种模式不?

2 个赞

有一个函数 org-roam-dailies-find-directory ,可以查看 /daily 目录。可能不是很符合你的需求。

可以试试datetree形式

  (setq org-roam-dailies-capture-templates
	'(("d" "default" entry
           "* %?"
           :if-new (file+datetree "path/dailies.org" day ))))
1 个赞

我也考虑这个问题,org-roam 虽然提供了 find-date 来找特定日期的笔记,但如果想纵览不同时间的笔记,找一个笔记再重新按命令选择另一个日期显然是不方便的。我想的是把 daily 的笔记放到 treemacs 中,这样所有笔记都固定在侧边栏显示,就可以按日期来浏览所有的笔记,效果如下:

但还需要改进的是现在是把所有日期平铺展开了,如果能加上一个月份以及年份的层级,就能达到我希望的效果了。

一次看一日有时是无意义的,能通览日期范围最好 :sweat_smile:

logseq 是什么样子的呢?我没用过,我估计用 file+datetree 的方式来做 daily 的 capture 应该就可以吧?

有一个函数名字叫作 org-roam-dailies-goto-next-note,可以绑定到 hydra 或者 transient 上面就能够方便持续跳转了,不知道合不合你意

交互函数org-roam-dailies-goto-date,非常直观选择某个日子的日志。

image

3 个赞

这个方式挺好的, 我想用 treemac 展示 org-roam-node, 不知 treemac 要如何配置? 之前从来没有配置过 treemac

通览多日对于回顾确实很方便,treemacs也只是列出标题,没有列出内容。

我自己写了一个简单的函数,把窗口分成8格,正好展示7天deaily note和一个weekly note。

因为文件名有规律,用 (split-window-right) 、(windmove-right) 等函数按照固定流程跑一遍,自动打开对应名称的文件就行,如果对应名称没有文件,特殊处理一下。上一周、下一周的切换也很方便

2 个赞

我是记录 daily log,然后每天晚上或者第二天进行归档,归档是按照文件内容结构归档到 journey.org 当中,一年结束后,更改文件名为年份,然后重新创建一个 journey.org

只用一个 org 文件来专门记录日记就行了.

愿意分享函数上来吗? 发现改造一下, 还能和上一年的日记记录做对比

非常零散且粗糙的函数,强烈依赖于命名规则。

如果想与上一年的做对比,可以参考 yuchen/goto-next-weekly-reviewyuchen/get-next-week-daily-journal

  (defun yuchen/weekly-review ()
    "打开当前周的回顾视图"
    (interactive)
    (delete-other-windows)
    (let* ((time-list (decode-time))
           (time (apply #'encode-time time-list))
           (day-of-week (1- (string-to-number (format-time-string "%w" time))))
           )
      ;; 周一
      (cl-decf (nth 3 time-list) day-of-week)
      (yuchen/open-daily-journal-file-or-buffer time-list)
      (split-window-right)
      (split-window-right)
      (split-window-below)
      (windmove-right)
      ;; 周二
      (cl-incf (nth 3 time-list) 1)
      (yuchen/open-daily-journal-file-or-buffer time-list)
      (split-window-below)
      (windmove-right)
      (split-window-right)
      ;; 周三
      (cl-incf (nth 3 time-list) 1)
      (yuchen/open-daily-journal-file-or-buffer time-list)
      (split-window-below)
      (windmove-right)
      (split-window-below)
      ;; 周四
      (cl-incf (nth 3 time-list) 1)
      (yuchen/open-daily-journal-file-or-buffer time-list)
      (windmove-down)
      (windmove-left)
      (windmove-left)
      (windmove-left)
      ;; 周五
      (cl-incf (nth 3 time-list) 1)
      (yuchen/open-daily-journal-file-or-buffer time-list)
      (windmove-right)
      ;; 周六
      (cl-incf (nth 3 time-list) 1)
      (yuchen/open-daily-journal-file-or-buffer time-list)
      (windmove-right)
      ;; 周日
      (cl-incf (nth 3 time-list) 1)
      (yuchen/open-daily-journal-file-or-buffer time-list)
      (windmove-right)
      ;; 周回顾
      (yuchen/open-org-file-or-archive-or-buffer (expand-file-name (concat org-weekly-journal-dir (format-time-string weekly-journal-name-format))))
      ))

  (defun yuchen/open-daily-journal-file-or-buffer (time-list)
    (let* ((time (apply #'encode-time time-list))
           (daily-name (format-time-string daily-journal-name-format time)))
      (yuchen/open-org-file-or-archive-or-buffer (expand-file-name (concat org-journal-dir daily-name)))))

  (defun yuchen/open-org-file-or-archive-or-buffer (file-path)
    (let ((file-path-candidate (concat (file-name-sans-extension file-path) ".org_archive"))
          (file-name (file-name-base file-path)))
      (cond
       ((f-exists? file-path)
        (find-file file-path))
       ((f-exists? file-path-candidate)
        (find-file file-path-candidate))
       (t  ;; 是否当前周新建文件,以前周建buffer?
        (switch-to-buffer file-name)))
      ))

  (defun yuchen/parse-org-daily-journal-title ()
    (let ((file-name (file-name-base (buffer-name))))
      (encode-time (decoded-time-set-defaults (parse-time-string file-name)))))

  (defun yuchen/get-next-week-daily-journal (&optional backward)
    (let* ((file-day (yuchen/parse-org-daily-journal-title))
           (next-week (time-add file-day (days-to-time (if backward (* 7 backward) 7))))
           (next-week-daily-name (format-time-string daily-journal-name-format next-week)))
      (expand-file-name (concat org-journal-dir next-week-daily-name))
      ))

  (defun yuchen/goto-next-weekly-review (&optional backward)
    (interactive)
    (let* (file-name file-day next-weekly-journal-name)
      ;; 周一
      (while (windmove-find-other-window 'left)
        (windmove-left))
      (while (windmove-find-other-window 'up)
        (windmove-up))
      (yuchen/open-org-file-or-archive-or-buffer (yuchen/get-next-week-daily-journal backward))
      (setq file-day (yuchen/parse-org-daily-journal-title)
            next-weekly-journal-name (format-time-string weekly-journal-name-format file-day))
      ;; 周二
      (windmove-right)
      (yuchen/open-org-file-or-archive-or-buffer (yuchen/get-next-week-daily-journal backward))
      ;; 周三
      (windmove-right)
      (yuchen/open-org-file-or-archive-or-buffer (yuchen/get-next-week-daily-journal backward))
      ;; 周四
      (windmove-right)
      (yuchen/open-org-file-or-archive-or-buffer (yuchen/get-next-week-daily-journal backward))
      ;; 周五
      (windmove-down)
      (windmove-left)
      (windmove-left)
      (windmove-left)
      (yuchen/open-org-file-or-archive-or-buffer (yuchen/get-next-week-daily-journal backward))
      ;; 周六
      (windmove-right)
      (yuchen/open-org-file-or-archive-or-buffer (yuchen/get-next-week-daily-journal backward))
      ;; 周日
      (windmove-right)
      (yuchen/open-org-file-or-archive-or-buffer (yuchen/get-next-week-daily-journal backward))
      ;; 周回顾
      (windmove-right)
      (yuchen/open-org-file-or-archive-or-buffer (expand-file-name (concat org-weekly-journal-dir next-weekly-journal-name)))
      ))

1 个赞

请问你的 Emacs title bar 是如何配置的 (macOS)? 这个右上角的图标我觉得非常好看.

ScreenShot 18

观察真细~ 其实是在为Android emacs做准备,mac上没打算用的😂

这个不是title bar,是工具栏,默认长这样:

自定义工具栏 tool-bar,设置功能,选择你喜欢的图标就行,但是现在我还没有实现模式切换,正在求助

感觉大家用工具栏不太多,一直没人回复我😂 桌面端确实不太需要,但是安卓端是真心有用

1 个赞