(fix): autoloaded commands load org-roam-mode (#712)

Users should not have to explicitly enable the minor mode before using
autoloaded commands.
This commit is contained in:
N V
2020-05-28 00:25:19 -04:00
committed by GitHub
parent 2e220f511e
commit 5ee38f2d89
6 changed files with 21 additions and 0 deletions

View File

@ -41,12 +41,14 @@
(defvar org-roam-backlinks-mode)
(defvar org-roam-last-window)
(defvar org-ref-cite-types) ;; in org-ref-core.el
(defvar org-roam-mode)
(declare-function org-roam-db--ensure-built "org-roam-db")
(declare-function org-roam--extract-ref "org-roam")
(declare-function org-roam--get-title-or-slug "org-roam")
(declare-function org-roam--get-backlinks "org-roam")
(declare-function org-roam-backlinks-mode "org-roam")
(declare-function org-roam-mode "org-roam")
(defcustom org-roam-buffer-position 'right
"Position of `org-roam' buffer.
@ -266,6 +268,7 @@ Valid states are 'visible, 'exists and 'none."
(defun org-roam-buffer-toggle-display ()
"Toggle display of the `org-roam-buffer'."
(interactive)
(unless org-roam-mode (org-roam-mode))
(setq org-roam-last-window (get-buffer-window))
(pcase (org-roam-buffer--visibility)
('visible (delete-window (get-buffer-window org-roam-buffer)))