1
0
Fork 0

Decouple ‘oni-org’ and ‘oni-org-roam’

‘org-roam’ doesn’t seem to work correctly on all the machines that I use
‘org-mode’ on.
This commit is contained in:
Tom Willemse 2021-03-25 20:20:04 -07:00
parent 0e0f464a65
commit dd9fedf8ff
3 changed files with 57 additions and 12 deletions

38
oni-org-roam.el Normal file
View file

@ -0,0 +1,38 @@
;;; oni-org-roam.el --- Configuration for org-roam -*- lexical-binding: t; -*-
;; Copyright (C) 2021 Tom Willemse
;; Author: Tom Willemse <tom@ryuslash.org>
;; Keywords: local
;; Version: 2021.0325.201203
;; Package-Requires: (oni-org org-roam)
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with this program. If not, see <https://www.gnu.org/licenses/>.
;;; Commentary:
;; Configuration specific to org-roam.
;;; Code:
(require 'org-roam)
(setq org-roam-directory (expand-file-name "~/documents/org/"))
(org-roam-mode)
;;;###autoload(with-eval-after-load 'org-roam (require 'oni-org-roam))
(provide 'oni-org-roam)
;;; oni-org-roam.el ends here

View file

@ -4,8 +4,8 @@
;; Author: Tom Willemse <tom@ryuslash.org>
;; Keywords: local
;; Version: 2021.0325.193551
;; Package-Requires: (oni-yasnippet oni-alert oni-hydra org-plus-contrib org-bullets org-edna diminish all-the-icons org-journal org-roam)
;; Version: 2021.0325.201211
;; Package-Requires: (oni-yasnippet oni-alert oni-hydra org-plus-contrib org-bullets org-edna diminish all-the-icons org-journal)
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
@ -141,8 +141,12 @@ _l_: Store link ^^ _j_: Journal entry
("t" (org-capture nil "t"))
("A" (org-capture nil "a"))
("j" (org-capture nil "j"))
("f" org-roam-find-file)
("i" org-roam-insert-immediate))
("f" (if (require 'oni-org-roam nil t)
(org-roam-find-file)
(error "Couldnt load org-roam, you should install oni-org-roam")))
("i" (if (require 'oni-org-roam nil t)
(org-roam-insert-immediate)
(error "Couldnt load org-roam, you should install oni-org-roam"))))
(defun oni-org-in-dblock-p ()
"Non-nil when point belongs to a dynamic block."
@ -488,13 +492,5 @@ After running it once remove it from `org-capture-after-finalize-hook'."
(setq org-journal-dir (expand-file-name "~/documents/org/journal/"))
(setq org-journal-file-format "%Y%m%d.org")
;;; org-roam
(require 'org-roam)
(setq org-roam-directory (expand-file-name "~/documents/org/"))
(org-roam-mode)
(provide 'oni-org)
;;; oni-org.el ends here

View file

@ -0,0 +1,11 @@
#!/usr/bin/env bats
@test "Loading org-roam also loads oni-org-roam" {
run emacs -batch -l package -f package-initialize \
-l org-roam \
-eval "(prin1 (featurep 'oni-org-roam))"
echo "$output"
[[ "$output" == *"t" ]]
}