prevent update when no backlinks

This commit is contained in:
Jethro Kuan
2020-02-03 01:06:23 +08:00
parent 4ab3c7d314
commit f968529b8d

View File

@ -170,6 +170,7 @@ Valid states are 'visible, 'exists and 'none."
(defun org-roam-update (file)
"Show the backlinks for given org file `FILE'."
(unless (string= org-roam-current-file file)
(when org-roam-hash-backlinks
(let ((backlinks (gethash file org-roam-hash-backlinks)))
(with-current-buffer org-roam-buffer
(read-only-mode -1)
@ -184,8 +185,8 @@ Valid states are 'visible, 'exists and 'none."
(dolist (content contents)
(insert (format "\n\n%s\n\n" content))))
backlinks))
(read-only-mode +1))))
(setq org-roam-current-file file))
(read-only-mode +1)))
(setq org-roam-current-file file))))
(defun org-roam ()
"Initialize `org-roam'.