From 220f395c1fc8e5182391dfcb72c9fb10371c3db9 Mon Sep 17 00:00:00 2001 From: Jethro Kuan Date: Mon, 22 Jun 2020 16:19:27 +0800 Subject: [PATCH] (feat): add org-roam-find-file-immediate (#852) Addresses #852. --- org-roam.el | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/org-roam.el b/org-roam.el index 68a458c..c439a19 100644 --- a/org-roam.el +++ b/org-roam.el @@ -1408,13 +1408,25 @@ If DESCRIPTION is provided, use this as the link label. See "Find an Org-roam file, and insert a relative org link to it at point. This variant of `org-roam-insert' inserts the link immediately by using the template in `org-roam-capture-immediate-template'. The -interactive ARG and ARGS are forward to `org-roam-insert'. +interactive ARG and ARGS are passed to `org-roam-insert'. See `org-roam-insert' for details." (interactive "P") (let ((args (push arg args)) (org-roam-capture-templates (list org-roam-capture-immediate-template))) (apply #'org-roam-insert args))) +;;;###autoload +(defun org-roam-find-file-immediate (arg &rest args) + "Find and open an Org-roam file. +This variant of `org-roam-find-file' uses the template in +`org-roam-capture-immediate-template', avoiding the capture +process. The interactive ARG and ARGS are passed to +`org-roam-find-file'. See `org-roam-find-file' for details." + (interactive "P") + (let ((args (push arg args)) + (org-roam-capture-templates (list org-roam-capture-immediate-template))) + (apply #'org-roam-find-file args))) + ;;;###autoload (defun org-roam-jump-to-index () "Find the index file in `org-roam-directory'.