diff options
| author | Szymon Szukalski <szymon@szymonszukalski.com> | 2026-04-09 10:53:27 +1000 |
|---|---|---|
| committer | Szymon Szukalski <szymon@szymonszukalski.com> | 2026-04-09 10:53:27 +1000 |
| commit | bc75732b9d37b77945a977ee9f7892cf6efc79c3 (patch) | |
| tree | 4d9273ccc12c29eccc44fdc12372bea047414353 /lisp/ss-denote.el | |
| parent | 12a5b1464bb919ba23f2aa6c22d44de81e382151 (diff) | |
Refactor Emacs config into modules
Diffstat (limited to 'lisp/ss-denote.el')
| -rw-r--r-- | lisp/ss-denote.el | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/lisp/ss-denote.el b/lisp/ss-denote.el new file mode 100644 index 0000000..65b9b53 --- /dev/null +++ b/lisp/ss-denote.el @@ -0,0 +1,49 @@ +;;; ss-denote.el --- Denote configuration -*- lexical-binding: t; -*- + +;;; Commentary: + +;; Durable note creation and Denote integration. + +;;; Code: + +(require 'ss-core) + +(declare-function denote-keywords-prompt "denote") +(declare-function denote-org-capture "denote") +(declare-function denote-org-capture-with-prompts "denote") + +(defun ss-denote-capture-in-directory (directory &optional keywords &rest prompts) + "Start a Denote Org capture in DIRECTORY with KEYWORDS and PROMPTS. +If PROMPTS is empty, rely on `denote-prompts'." + (let* ((prompt-for-keywords (memq :keywords prompts)) + (directory (ss-require-existing-directory directory)) + (denote-directory directory) + (denote-use-directory (unless (memq :subdirectory prompts) directory)) + (denote-use-keywords + (if prompt-for-keywords + (delete-dups (append keywords (denote-keywords-prompt))) + keywords))) + (if prompts + (denote-org-capture-with-prompts + (memq :title prompts) + nil + (memq :subdirectory prompts) + (memq :date prompts) + (memq :template prompts)) + (denote-org-capture)))) + +(defun ss-denote-setup () + "Initialize Denote." + (use-package denote + :ensure t + :after org + :config + (setq denote-directory ss-org-directory + denote-known-keywords '("project") + denote-prompts '(title keywords) + denote-org-capture-specifiers "%?") + (denote-rename-buffer-mode 1))) + +(provide 'ss-denote) + +;;; ss-denote.el ends here |
