Configure denote with directory and journal function
This commit is contained in:
parent
c4651cde45
commit
a9f3383bbd
1 changed files with 17 additions and 1 deletions
|
|
@ -116,7 +116,23 @@
|
|||
|
||||
(use-package denote
|
||||
:config
|
||||
(setq denote-directory (expand-file-name "~/TobCloud/org/notes")))
|
||||
(setq denote-directory (expand-file-name "~/TobCloud/org/notes"))
|
||||
(defun to/denote-journal()
|
||||
"Create an entry tagged 'journal' with the data as its title.
|
||||
If a journal for the current day exists, visit it. If multiple
|
||||
entries exist, prompt with completion for a choice between them.
|
||||
Else create a new file."
|
||||
(interactive)
|
||||
(let* ((today (format-time-string "%A %e %B %Y"))
|
||||
(string (denote-sluggify today))
|
||||
(files (denote-directory-files-matching-regexp string)))
|
||||
(cond
|
||||
((> (length files) 1)
|
||||
(find-file (completing-read "Select file: " files nil :require-match)))
|
||||
(files
|
||||
(find-file (car files)))
|
||||
(t
|
||||
(denote today '("journal")))))))
|
||||
|
||||
(use-package dired
|
||||
:ensure nil
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue