Skip to content

Rename a file by adding or removing a title interactively

The command denote-rename-file-title streamlines the process of interactively adding or removing a title to/from a file, while changing its file name accordingly. It asks for a title using the familiar minibuffer prompt (Standard note creation). It then renames the file. The command respect the values of denote-rename-confirmations and denote-save-buffers:

Technically, denote-rename-file-title is a wrapper for denote-rename-file, doing all the things that does (Rename a single file).

Concretely, this command can add or remove a title in one go. It does it by prepopulating the minibuffer prompt with the existing title. Users can then modify it. An empty input means to remove the title altogether (The file-naming scheme).

[ NOTE: Please check with your minibuffer user interface how to provide an empty input. The Emacs default setup accepts the empty minibuffer contents as they are, though popular packages like vertico use the first available completion candidate instead. For vertico, the user must either move one up to select the prompt and then type ‘RET’ there with empty contents, or use the command vertico-exit-input with empty contents. That Vertico command is bound to ‘M-RET’ as of this writing on 2024-06-30 10:37 +0300. ]