branch: externals/denote commit 98113698a76c61bb0911aa98f590f70fc7f0cadf Author: Protesilaos Stavrou <i...@protesilaos.com> Commit: Protesilaos Stavrou <i...@protesilaos.com>
Expand sample configuration If you had the "C-c n" key binding before, the code's evaluation will throw an error. You either need to set it to nil beforehand or add the code and restart Emacs. --- README.org | 40 +++++++++++++++++++++++++++++++++------- 1 file changed, 33 insertions(+), 7 deletions(-) diff --git a/README.org b/README.org index 2e6a2e6062..e324a12fbf 100644 --- a/README.org +++ b/README.org @@ -1097,9 +1097,13 @@ Everything is in place to set up the package. '("emacs" "philosophy" "politics" "economics")) (setq denote-infer-keywords t) (setq denote-sort-keywords t) -(setq denote-file-type nil) +(setq denote-file-type nil) ; Org is the default, set others here -(setq denote-front-matter-date-format 'org-timestamp) +;; We allow multi-word keywords by default. The author's personal +;; preference is for single-word keywords for a more rigid workflow. +(setq denote-allow-multi-word-keywords t) + +(setq denote-front-matter-date-format nil) ; change this to `org-timestamp' or custom string (require 'denote-link) (require 'denote-dired) @@ -1117,12 +1121,34 @@ Everything is in place to set up the package. ;; OR better: (add-hook 'dired-mode-hook #'denote-dired-mode-in-directories) -;; You can bind `denote' to a global key if you prefer not to use -;; `org-capture' or want an alternative. Denote does not define any key -;; bindings though: this is for the user to decide. For example: +;; Here is a custom, user-level command from one of the examples we +;; showed in this manual. We define it here and add it to a key binding +;; below. +(defun my-denote-journal () + "Create an entry tagged 'journal', while prompting for a title." + (interactive) + (denote + (denote--title-prompt) + "journal")) + +;; Denote does not define any key bindings. This is for the user to +;; decide. For example: (let ((map global-map)) - (define-key map (kbd "C-c n") #'denote) - (define-key map (kbd "C-c N") #'denote-type)) + (define-key map (kbd "C-c n j") #'my-denote-journal) ; our custom command + (define-key map (kbd "C-c n n") #'denote) + (define-key map (kbd "C-c n N") #'denote-type) + ;; If you intend to use Denote with a variety of file types, it is + ;; easier to bind the link-related commands to the `global-map', as + ;; shown here. Otherwise follow the same pattern for `org-mode-map', + ;; `markdown-mode-map', and/or `text-mode-map'. + (define-key map (kbd "C-c n i") #'denote-link) ; "insert" mnemonic + (define-key map (kbd "C-c n I") #'denote-link-add-links) + (define-key map (kbd "C-c n l") #'denote-link-find-file) ; "list" links + (define-key map (kbd "C-c n b") #'denote-link-backlinks) + ;; Note that `denote-dired-rename-file' can work from any context, not + ;; just Dired bufffers. That is why we bind it here to the + ;; `global-map'. + (define-key map (kbd "C-c n r") #'denote-dired-rename-file)) (with-eval-after-load 'org-capture (require 'denote-org-capture)