From 6ba9ffe9c8df60dc20d0d5c6481efa1e15ca6263 Mon Sep 17 00:00:00 2001 From: Jethro Kuan Date: Tue, 10 Mar 2020 10:36:36 +0800 Subject: [PATCH] (fix): Error if org-roam-insert is not called from Org-roam file (#264) --- org-roam.el | 2 ++ 1 file changed, 2 insertions(+) diff --git a/org-roam.el b/org-roam.el index a61567b..782d150 100644 --- a/org-roam.el +++ b/org-roam.el @@ -741,6 +741,8 @@ GOTO and KEYS argument have the same functionality as "Find an Org-roam file, and insert a relative org link to it at point. If PREFIX, downcase the title before insertion." (interactive "P") + (unless (org-roam--org-roam-file-p) + (user-error "Not in an Org-roam file")) (let* ((region (and (region-active-p) ;; following may lose active region, so save it (cons (region-beginning) (region-end))))