From 82733e133ab03b0138201e28dcb06e073a4fb3cc Mon Sep 17 00:00:00 2001 From: Jethro Kuan Date: Sat, 21 Aug 2021 16:42:46 +0800 Subject: [PATCH] (fix)buffer: skip backlinks where file no longer exists This is a fix to #1763, and an alternative to #1765. The rationale for not running a db-sync on buffer redisplay is that this is run on `post-command-hook` and needs to be fast. --- org-roam-mode.el | 2 ++ 1 file changed, 2 insertions(+) diff --git a/org-roam-mode.el b/org-roam-mode.el index 7cd2883..5686c15 100644 --- a/org-roam-mode.el +++ b/org-roam-mode.el @@ -345,6 +345,8 @@ the same time: from SOURCE-NODE's file for the link (that references the other node) at POINT. Acts a child section of the previous one." + (unless (file-exists-p (org-roam-node-file source-node)) + (cl-return-from org-roam-node-insert-section)) (magit-insert-section section (org-roam-node-section) (let ((outline (if-let ((outline (plist-get properties :outline))) (mapconcat #'org-link-display-format outline " > ")