Make stylistic tweaks to denote--prepare-note

This commit is contained in:
Protesilaos 2026-05-12 13:25:01 +03:00
parent 59eea50d4b
commit 1aedcff2d7
No known key found for this signature in database
GPG key ID: 99BD6459CD5CA3EA

View file

@ -3086,11 +3086,11 @@ which case it is not added to the base file name."
Arguments TITLE, KEYWORDS, DATE, ID, DIRECTORY, FILE-TYPE, Arguments TITLE, KEYWORDS, DATE, ID, DIRECTORY, FILE-TYPE,
TEMPLATE, and SIGNATURE should be valid for note creation." TEMPLATE, and SIGNATURE should be valid for note creation."
(let* ((path (denote-format-file-name (let* ((extension (denote--file-extension file-type))
directory id keywords title (denote--file-extension file-type) signature)) (path (denote-format-file-name directory id keywords title extension signature))
;; NOTE 2025-08-02: Is it safe to assume that an ;; TODO 2025-08-02: Is it safe to assume that an existing and
;; existing+empty file is good for us to use? Otherwise, we ;; empty file is good for us to use? Otherwise, we should
;; should have a `y-or-n-p' prompt here. ;; have a `y-or-n-p' prompt here.
(buffer (if (and (file-regular-p path) (not (denote--file-empty-p path))) (buffer (if (and (file-regular-p path) (not (denote--file-empty-p path)))
(user-error "A file named `%s' already exists and is not empty" path) (user-error "A file named `%s' already exists and is not empty" path)
(find-file path))) (find-file path)))