From 659babf922ba52fecbbd009814fc62a81c83b00e Mon Sep 17 00:00:00 2001 From: Jethro Kuan Date: Mon, 17 Feb 2020 19:02:46 +0800 Subject: [PATCH] (bugfix): force a cache update on making a new file (#107) --- org-roam.el | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/org-roam.el b/org-roam.el index 8350581..9205f54 100644 --- a/org-roam.el +++ b/org-roam.el @@ -239,7 +239,10 @@ If not provided, derive the title from the file name." (error (format "Aborting, file already exists at %s" file-path)) (if org-roam-autopopulate-title (org-roam--populate-title file-path title) - (make-empty-file file-path)))) + (make-empty-file file-path)) + (save-excursion + (with-current-buffer (find-file-noselect file-path) + (org-roam--update-cache))))) (defun org-roam--new-file-named (slug) "Create a new file named `SLUG'.