Journaling with the new denote-journal-extras
==============================================

The journaling functionality in Denote is meant to be be used to write
a diary or a journal. For each day, it creates a new file.

This journal system can be used for daily notes, sometimes called
"dailies". Here you can write thoughts, keep a log of your activities,
write your most important tasks for the day, and so on. 

People use daily notes in many different ways.

I use the journal files as a scratch file, to support my thinking.
Every day starts with a new file, so previous writings are out of your
way. On the other hand, the notes don't vaporize, but are still there.

The new denote-journal-extras put the journal files in their own sub
directory, so they don't clutter your Denote notes directory.

Denote
------
Denote is the package for simple notes for Emacs with an efficient
file-naming scheme. Denote is created by Protesilaos Stavrou, also
known as "Prot".

Prot always write wonderful documentation, very good to read and with
all the information you need.

For the documentation of denote, see [1].

According to the documentation, Denote aims to be a simple-to-use,
focused-in-scope, and effective note-taking and file-naming tool for
Emacs.

Denote offers a linking system to easily link notes to each
other. Denote can be used to create a Zettelkasten, but it can also be
used for simple, less ambitious, note taking.

Denote development version
--------------------------
Denote is available as GNU ELPA package. GNU ELPA provides the latest
stable release.
 
Currently, the development target is 2.1.0-dev. 

The development version can be installed from Git.

This is how Prot describes the installation from Git:

    cd ~/.emacs.d

    # Create a directory for manually-installed packages
    mkdir manual-packages

    # Go to the new directory
    cd manual-packages

    # Clone this repo, naming it "denote"
    git clone https://git.sr.ht/~protesilaos/denote denote

In your ~/.emacs or other Emacs init file, you add:

    ;; Make Elisp files in that directory available to the user.
    (add-to-list 'load-path "~/.emacs.d/manual-packages/denote")
   
New journaling functionality
----------------------------
The functionality for journaling is rewritten as part of 2.1.0-dev.

In order to use this you have to install the development version.
Install it by cloning the Git repository, as described above.

Add the following to your ~/.emacs or other Emacs init file:

(require 'denote-journal-extras)

Journaling functionality
------------------------
The journaling functionality works with a separate journal file for
each day. There are commands to create a new journal file, or edit
today's journal file.

The journal files are placed in a sub directory of the denote
directory, called "journal". The files have the date of the current
day and the current time as title (like "Wednesday 4 October 2023
17:01") and "journal" as the keyword.

The file created with the title mentioned above and the keyword
"journal" will have the name:

   "20231004T170146--wednesday-4-october-2023-1701__journal.org"

Of course, this can all be configured.

The commands to create a new entry are:

* denote-journal-extras-new-entry
* denote-journal-extras-new-or-existing-entry

I use the second command. This will use the journal file for the
current date, or create a new one when it does not exists yet.

Key binding
-----------
To use the journaling functionality, I have added a single key binding
in my ~/.emacs:

    (let ((map global-map))
      (define-key map (kbd "C-c n j") #'denote-journal-extras-new-or-existing-entry)
      ... ;; (other denote keybindings)

Template
--------
Because the journal file is an org file, it is very simple to use
yasnippet templates. Just create one or more snippets for org-mode,
give these a key.

To insert the template into the journal file, just type the key
followed by TAB in the buffer of the journal file.

Add new keywords to the current journal file
--------------------------------------------
It can be useful to add one or more keywords to the current journal
file. E.g., when you discover that you have written some information
and want to be able to retrieve it using a keyword.

Prot has added a brilliant function for this to Denote.

First, save the file (C-x C-s) and then give the command:

    M-x denote-keywords-add

Enter one or more keywords, separated by a comma.

The new keywords will be added to the #+filetags line in the front
matter, and the file name will be changed accordingly.

Adding some keywords this way can be done on the fly and is very
efficient.

Saving content from a journal file as a new Denote note
-------------------------------------------------------
Sometimes a part of the current journal file is a good starting
point for a new note in the main Denote note system.

For this, I found the command "denote-region" very useful.
This command too is rewritten in the development version.

Simply mark a region in the journal file, and give the command

    M-x denote-region

This will create a new, normal, Denote note, with the region as
content. Denote will prompt for a title and a keyword.

The original journal file will not be touched by this, so your
journal stays intact.

Happy journaling!

[1]: https://protesilaos.com/emacs/denote



Last edited: $Date: 2023/10/04 16:04:00 $