Function: denote-rename-buffer

denote-rename-buffer is a byte-compiled function defined in denote.el.

Signature

(denote-rename-buffer &optional BUFFER)

Documentation

Rename current buffer or optional BUFFER with denote-rename-buffer-format.

The symbol of this function is the default value of the user option denote-rename-buffer-function and is thus used by the denote-rename-buffer-mode(var)/denote-rename-buffer-mode(fun).

Source Code

;; Defined in ~/.emacs.d/elpa/denote-4.2.3/denote.el
(defun denote-rename-buffer (&optional buffer)
  "Rename current buffer or optional BUFFER with `denote-rename-buffer-format'.
The symbol of this function is the default value of the user
option `denote-rename-buffer-function' and is thus used by the
`denote-rename-buffer-mode'."
  (when-let* ((file (buffer-file-name buffer))
              ((denote-file-has-identifier-p file))
              (new-name (denote-rename-buffer--format (or buffer (current-buffer))))
              ((not (string-blank-p new-name))))
    (rename-buffer (denote-format-buffer-name new-name) :unique)))