Fontification in Dired
One of the upsides of Denote’s file-naming scheme is the predictable pattern it establishes, which appears as a near-tabular presentation in a listing of notes (i.e. in Dired). The denote-dired-mode can help enhance this impression, by fontifying the components of the file name to make the date (identifier) and keywords stand out.
There are two ways to set the mode. Either use it for all directories, which probably is not needed:
(add-hook 'dired-mode-hook #'denote-dired-mode)Or configure the user option denote-dired-directories and then set up the function denote-dired-mode-in-directories:
;; We use different ways to specify a path for demo purposes.
(setq denote-dired-directories
(list denote-directory
(thread-last denote-directory (expand-file-name "attachments"))
(expand-file-name "~/Documents/vlog")))
(add-hook 'dired-mode-hook #'denote-dired-mode-in-directories)The user option denote-dired-directories-include-subdirectories specifies whether the denote-dired-directories also cover their subdirectories. By default they do not. Set this option to t to include subdirectories as well.
The faces we define for this purpose are:
denote-faces-datedenote-faces-delimiterdenote-faces-extensiondenote-faces-keywordsdenote-faces-signaturedenote-faces-subdirectorydenote-faces-timedenote-faces-title
For more control, we also provide these:
#+vindex denote-faces-year #+vindex denote-faces-month #+vindex denote-faces-day #+vindex denote-faces-hour #+vindex denote-faces-minute #+vindex denote-faces-second
denote-faces-yeardenote-faces-monthdenote-faces-daydenote-faces-hourdenote-faces-minutedenote-faces-second
For the time being, the ‘diredfl’ package is not compatible with this facility.
The denote-dired-mode does not only fontify note files that were created by Denote: it covers every file name that follows our naming conventions (The file-naming scheme). This is particularly useful for scenaria where, say, one wants to organise their collection of PDFs and multimedia in a systematic way (and, perhaps, use them as attachments for the notes Denote produces if you are writing Org notes and are using its standand attachments’ facility).