[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/denote 10b30d1e15 232/355: Expand manual on journaling
From: |
ELPA Syncer |
Subject: |
[elpa] externals/denote 10b30d1e15 232/355: Expand manual on journaling with past date |
Date: |
Sun, 26 Jun 2022 23:58:27 -0400 (EDT) |
branch: externals/denote
commit 10b30d1e158b7b9b7d3c2aa4177aa6461924a84f
Author: Protesilaos Stavrou <info@protesilaos.com>
Commit: Protesilaos Stavrou <info@protesilaos.com>
Expand manual on journaling with past date
Thanks to svnsbck for the discussion on issue 15 over at the GitHub
mirror: <https://github.com/protesilaos/denote/issues/15>.
---
README.org | 97 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++------
1 file changed, 89 insertions(+), 8 deletions(-)
diff --git a/README.org b/README.org
index 9214e609b1..ca0a06f914 100644
--- a/README.org
+++ b/README.org
@@ -1019,14 +1019,14 @@ Sources for =tmr=:
+ GitLab: <https://gitlab.com/protesilaos/tmr>
+ Mailing list: <https://lists.sr.ht/~protesilaos/tmr>
-Finally, recall what we discussed elsewhere in the manual about changing
-the file type and target directory
([[#h:f34b172b-3440-446c-aec1-bf818d0aabfe][Notes in multiple file types]]).
You
-basically ~let~ bind the relevant variables. Such bindings are specific
-to the function: they do not affect anything outside of it, so you can
-keep the defaults for your regular notes and use something different for
-your journaling. For example, the following snippet is like the
-previous sample of writing a journal entry and setting a timer, but it
-also uses a plain text file type and adds the new note to the
+Recall what we discussed elsewhere in the manual about changing the file
+type and target directory ([[#h:f34b172b-3440-446c-aec1-bf818d0aabfe][Notes in
multiple file types]]). You basically
+~let~ bind the relevant variables. Such bindings are specific to the
+function: they do not affect anything outside of it, so you can keep the
+defaults for your regular notes and use something different for your
+journaling. For example, the following snippet is like the previous
+sample of writing a journal entry and setting a timer, but it also uses
+a plain text file type and adds the new note to the
=~/Documents/journal/= directory:
#+begin_src emacs-lisp
@@ -1041,6 +1041,87 @@ also uses a plain text file type and adds the new note
to the
(tmr 10 "Practice writing in my journal")))
#+end_src
+Finally, we can incorporate the idea of the ~denote-date~ command into
+our journaling workflow. Unlike regular ~denote~, this command has a
+slightly different structure. Below are variants of the aforementioned
+ideas. If you pick more than one, just give them a unique name (the
+text right after ~defun~):
+
+#+begin_src emacs-lisp
+(defun my-denote-journal-with-date (date title)
+ "Ask for DATE and TITLE to write a journal entry.
+
+Read the doc string of `denote-date' on what a valid DATE is."
+ (interactive
+ (list
+ (denote--date-prompt)
+ (denote--title-prompt)))
+ (when-let ((d (denote--valid-date date))
+ (id (format-time-string denote--id-format d))
+ ((denote--barf-duplicate-id id)))
+ (denote--prepare-note title "journal" nil d id)))
+
+(defun my-denote-journal-with-date (date)
+ "Ask for DATE to write a journal entry.
+
+Read the doc string of `denote-date' on what a valid DATE input is.
+
+The title of the note is something like Tuesday 17 June 2020,
+though you can modify the `format-time-string' specifiers as
+described in its doc string."
+ (interactive (list (denote--date-prompt)))
+ (when-let ((d (denote--valid-date date))
+ (id (format-time-string denote--id-format d))
+ ((denote--barf-duplicate-id id)))
+ (denote--prepare-note
+ (format-time-string "%A %e %B %Y" d)
+ "journal" nil d id)))
+
+(defun my-denote-journal-with-date (date)
+ "Ask for DATE to write a journal entry.
+
+Journal entries are stored in ~/Documents/journal/ and use plain
+text for their `denote-file-type'.
+
+Read the doc string of `denote-date' on what a valid DATE input is.
+
+The title of the note is something like Tuesday 17 June 2020,
+though you can modify the `format-time-string' specifiers as
+described in its doc string."
+ (interactive (list (denote--date-prompt)))
+ (when-let ((d (denote--valid-date date))
+ (id (format-time-string denote--id-format d))
+ ((denote--barf-duplicate-id id))
+ (denote-file-type 'text) ; it supports other file types as well:
read its doc string
+ (denote-directory "~/Documents/journal/"))
+ (denote--prepare-note
+ (format-time-string "%A %e %B %Y" d)
+ "journal" nil d id)))
+
+(defun my-denote-journal-with-date (date)
+ "Ask for DATE to write a journal entry and start a 10-minute tmr.
+
+Journal entries are stored in ~/Documents/journal/ and use plain
+text for their `denote-file-type'. The `tmr' command comes from
+the package of the same name (same dev as Denote's).
+
+Read the doc string of `denote-date' on what a valid DATE input is.
+
+The title of the note is something like Tuesday 17 June 2020,
+though you can modify the `format-time-string' specifiers as
+described in its doc string."
+ (interactive (list (denote--date-prompt)))
+ (when-let ((d (denote--valid-date date))
+ (id (format-time-string denote--id-format d))
+ ((denote--barf-duplicate-id id))
+ (denote-file-type 'text) ; it supports other file types as well:
read its doc string
+ (denote-directory "~/Documents/journal/"))
+ (denote--prepare-note
+ (format-time-string "%A %e %B %Y" d)
+ "journal" nil d id)
+ (tmr 10 "Practice writing in my journal")))
+#+end_src
+
* Extending Denote
:PROPERTIES:
:CUSTOM_ID: h:8ed2bb6f-b5be-4711-82e9-8bee5bb06ece
- [elpa] externals/denote 4a5ba1603a 190/355: Document how to write metanotes, (continued)
- [elpa] externals/denote 4a5ba1603a 190/355: Document how to write metanotes, ELPA Syncer, 2022/06/27
- [elpa] externals/denote 92a4ff20b6 192/355: Remove obsolete description from doc string, ELPA Syncer, 2022/06/27
- [elpa] externals/denote ebd14ebbd6 187/355: Change placement of maxdepth argument for find, ELPA Syncer, 2022/06/27
- [elpa] externals/denote 979bf352d6 208/355: Clarify requirements for good front matter value, ELPA Syncer, 2022/06/27
- [elpa] externals/denote 0db5be04be 213/355: Use new helper FN for title value in links, ELPA Syncer, 2022/06/27
- [elpa] externals/denote 31fc567702 209/355: Accept optional filetype in front matter formatter, ELPA Syncer, 2022/06/27
- [elpa] externals/denote b64cc491bc 199/355: Add history to denote-link-add-links command, ELPA Syncer, 2022/06/27
- [elpa] externals/denote 4041e437b2 214/355: Add PROTOTYPE of front matter rewrite post-rename, ELPA Syncer, 2022/06/27
- [elpa] externals/denote f4e7cc9ab4 222/355: Document denote-dired-post-rename-functions, ELPA Syncer, 2022/06/27
- [elpa] externals/denote edbd2f7f1b 270/355: Use our pred instead of generic in file filtering, ELPA Syncer, 2022/06/27
- [elpa] externals/denote 10b30d1e15 232/355: Expand manual on journaling with past date,
ELPA Syncer <=
- [elpa] externals/denote b5c7bab15c 227/355: Update manual's Acknowledgements, ELPA Syncer, 2022/06/27
- [elpa] externals/denote 8dcb3aea4e 234/355: Add minor tweaks to the manual, ELPA Syncer, 2022/06/27
- [elpa] externals/denote 429763c246 257/355: Fix broken buttons in backlinks' buffer, ELPA Syncer, 2022/06/27
- [elpa] externals/denote 78f6c7ce35 279/355: Add missing doclicense.texi, ELPA Syncer, 2022/06/27
- [elpa] externals/denote b0d8ad46cf 273/355: Update denote-known-keywords doc string, ELPA Syncer, 2022/06/27
- [elpa] externals/denote da32e7f7f9 249/355: Tweak denote-dired-rewrite-front-matter docstring, ELPA Syncer, 2022/06/27
- [elpa] externals/denote 855c677724 277/355: Reword a minor statement, ELPA Syncer, 2022/06/27
- [elpa] externals/denote 9d599a518e 297/355: Include 'id:' link type in task list, ELPA Syncer, 2022/06/27
- [elpa] externals/denote 7074b25869 289/355: Buttonize all links when inserted in bulk, ELPA Syncer, 2022/06/27
- [elpa] externals/denote 95b5143fc2 274/355: Fix link to zetteldeft alternative package, ELPA Syncer, 2022/06/27