UP | HOME

emacs-org-roam-node操作排除daily文件夹下node

[2024-04-07 周日 10:00]

用下面的函数代替org-roam-node-find,可以在其界面排除掉路径包含daily的node

(use-package org-roam)

(org-roam-db-autosync-mode)

(cl-defmethod org-roam-node-directories ((node org-roam-node))
    (if-let ((dirs (file-name-directory (file-relative-name (org-roam-node-file node) org-roam-directory))))
        (format "(%s)" (car (split-string dirs "/")))
      ""))

(global-set-key "\C-cxf" (lambda () (interactive)
    (org-roam-node-find nil nil
        (lambda (node)
            (not (string-search "daily" (org-roam-node-directories node)))))))

▲ 编辑于 [2024-05-22 周三 21:58] | © Published by Emacs 31.0.50 (Org mode 9.7.16) on [2024-11-21 周四 00:22] | RSS