Skip to content

Renaming files

Denote provides commands to rename files and update their front matter where relevant. For Denote to work, only the file name needs to be in order, by following our naming conventions (The file-naming scheme). The linking mechanism, in particular, needs just the identifier in the file name (Linking notes).

We write front matter in notes for the user’s convenience and for other tools to make use of that information (e.g. Org’s export mechanism). The renaming mechanism takes care to keep this data in sync with the file name, when the user performs a change.

Renaming is useful for managing existing files created with Denote, but also for converting older text files to Denote notes. Denote’s file-naming scheme is not specific to notes or text files: it is relevant for all sorts of items, such as multimedia and PDFs that form part of the user’s longer-term storage. While Denote does not manage such files (e.g. doesn’t create links to them), it already has all the mechanisms to facilitate the task of renaming them.

All renaming commands run the denote-after-rename-file-hook after a succesful operation (Access the data of the latest note). They also construct the file name in accordance with the user option denote-file-name-components-order (Change the order of file name components).

Apart from renaming files, Denote can also rename only the buffer. The idea is that the underlying file name is correct but it can be easier to use shorter buffer names when displaying them on the mode line or switching between then with commands like switch-to-buffer.

Automatically rename Denote buffers.

Find duplicate identifiers and put them in a Dired buffer.