From 2dd84b8e2f0286df73f19bcb7449dac6a9cad362 Mon Sep 17 00:00:00 2001 From: Brian McGillion Date: Sat, 11 Apr 2020 16:53:12 +0400 Subject: [PATCH] Add org-noter package This package allows the creation of notes on a document (pdf, EPub, etc.) which will be kept in sync with the document. Providing context sensitive annotations that are managed in plaintext. --- modules/config/default/+emacs-bindings.el | 4 +++- modules/config/default/+evil-bindings.el | 3 +++ modules/lang/org/README.org | 13 +++++++++++++ modules/lang/org/config.el | 1 + modules/lang/org/contrib/noter.el | 14 ++++++++++++++ modules/lang/org/packages.el | 2 ++ 6 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 modules/lang/org/contrib/noter.el diff --git a/modules/config/default/+emacs-bindings.el b/modules/config/default/+emacs-bindings.el index 7cfdb43dc7b..e07af04a121 100644 --- a/modules/config/default/+emacs-bindings.el +++ b/modules/config/default/+emacs-bindings.el @@ -128,7 +128,9 @@ :desc "Bibliographic entries" "b" (cond ((featurep! :completion ivy) #'ivy-bibtex) ((featurep! :completion helm) #'helm-bibtex))) - + (:when (featurep! :lang org +noter) + :desc "Org noter" "e" #'org-noter) + :desc "Find file in notes" "f" #'+default/find-in-notes :desc "Browse notes" "F" #'+default/browse-notes :desc "Org store link" "l" #'org-store-link diff --git a/modules/config/default/+evil-bindings.el b/modules/config/default/+evil-bindings.el index e0fe4744bff..90ee2f48283 100644 --- a/modules/config/default/+evil-bindings.el +++ b/modules/config/default/+evil-bindings.el @@ -464,6 +464,9 @@ :desc "Toggle org-clock" "c" #'+org/toggle-clock :desc "Cancel org-clock" "C" #'org-clock-cancel :desc "Open deft" "d" #'deft + (:when (featurep! :lang org +noter) + :desc "Org noter" "e" #'org-noter) + :desc "Find file in notes" "f" #'+default/find-in-notes :desc "Browse notes" "F" #'+default/browse-notes :desc "Org store link" "l" #'org-store-link diff --git a/modules/lang/org/README.org b/modules/lang/org/README.org index 12a554e8847..b7d86b6f996 100644 --- a/modules/lang/org/README.org +++ b/modules/lang/org/README.org @@ -18,6 +18,7 @@ - [[#built-in-custom-link-types][Built-in custom link types]] - [[#configuration][Configuration]] - [[#changing-org-directory][Changing ~org-directory~]] + - [[#changing-org-noter-notes-search-path][Changing ~org-noter-notes-search-path~]] * Description This module adds org-mode support to Doom Emacs, along with a number of @@ -68,6 +69,8 @@ https://www.mfoot.com/blog/2015/11/22/literate-emacs-configuration-with-org-mode + =+present= Enables integration with reveal.js, beamer and org-tree-slide, so Emacs can be used for presentations. + =+roam= Enables org-roam integration. ++ =+noter= Enables org-noter integration. Keeps notes in sync with a document. + Requires [[https://www.gnu.org/software/emacs/manual/html_node/emacs/Document-View.html][pdf-tools]] (=:tools pdf=) or [[https://www.gnu.org/software/emacs/manual/html_node/emacs/Document-View.html][DocView]] or [[https://github.com/wasamasa/nov.el][nov.el]] to be enabled. ** Plugins + [[https://github.com/hniksic/emacs-htmlize][htmlize]] @@ -121,6 +124,9 @@ https://www.mfoot.com/blog/2015/11/22/literate-emacs-configuration-with-org-mode + =+roam= + [[https://github.com/jethrokuan/org-roam][org-roam]] + [[https://github.com/jethrokuan/company-org-roam][company-org-roam]] ++ =+noter= + + [[https://github.com/weirdNox/org-noter][org-noter]] + ** Hacks + The window is recentered when following links. @@ -223,3 +229,10 @@ To modify ~org-directory~ it must be set /before/ =org= has loaded: ;; ~/.doom.d/config.el (setq org-directory "~/new/org/location/") #+END_SRC +** Changing ~org-noter-notes-search-path~ +To modify ~org-noter-notes-search-path~ set: + +#+BEGIN_SRC emacs-lisp +;; ~/.doom.d/config.el +(setq org-noter-notes-search-path '("~/notes/path/")) +#+END_SRC diff --git a/modules/lang/org/config.el b/modules/lang/org/config.el index c2c8a2b72a3..aec684f417f 100644 --- a/modules/lang/org/config.el +++ b/modules/lang/org/config.el @@ -965,6 +965,7 @@ compelling reason, so..." (if (featurep! +pomodoro) (load! "contrib/pomodoro")) (if (featurep! +present) (load! "contrib/present")) (if (featurep! +roam) (load! "contrib/roam")) + (if (featurep! +noter) (load! "contrib/noter")) ;; Add our general hooks after the submodules, so that any hooks the ;; submodules add run after them, and can overwrite any defaults if necessary. diff --git a/modules/lang/org/contrib/noter.el b/modules/lang/org/contrib/noter.el new file mode 100644 index 00000000000..5702e1e0aea --- /dev/null +++ b/modules/lang/org/contrib/noter.el @@ -0,0 +1,14 @@ +;;; lang/org/contrib/noter.el -*- lexical-binding: t; -*- +;;;###if (featurep! +noter) + +(use-package! org-noter + :defer t + :preface + ;; Allow the user to preempt this and set the document search path + ;; If not set then use `org-directory' + (defvar org-noter-notes-search-path nil) + :config + (setq org-noter-auto-save-last-location t + org-noter-separate-notes-from-heading t) + (unless org-noter-notes-search-path + (setq org-noter-notes-search-path org-directory))) diff --git a/modules/lang/org/packages.el b/modules/lang/org/packages.el index f63159d6acd..8c8f677d9d1 100644 --- a/modules/lang/org/packages.el +++ b/modules/lang/org/packages.el @@ -75,6 +75,8 @@ (package! org-roam :pin "e33c144298") (when (featurep! :completion company) (package! company-org-roam :pin "0913d86f16"))) +(when (featurep! +noter) + (package! org-noter :pin "9ead81d42d")) ;;; Babel (package! ob-async :pin "80a30b96a0")