Merge pull request #708 from segv/main

denote-open-or-create errors in directories with oddly-named files (#707)
This commit is contained in:
Protesilaos 2026-05-23 23:09:24 +03:00 committed by GitHub
commit 197b0acd38
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -906,16 +906,16 @@ The note's ID is derived from the date and time of its creation.")
(defconst denote-date-identifier-regexp "\\([0-9]\\{8\\}\\)\\(T[0-9]\\{6\\}\\)" (defconst denote-date-identifier-regexp "\\([0-9]\\{8\\}\\)\\(T[0-9]\\{6\\}\\)"
"Regular expression to match `denote-date-identifier-format'.") "Regular expression to match `denote-date-identifier-format'.")
(defconst denote-identifier-regexp "@@\\([^.]*?\\)\\(==.*\\|--.*\\|__.*\\|@@.*\\|\\..*\\)*$" (defconst denote-identifier-regexp "@@\\([^.]+?\\)\\(==.*\\|--.*\\|__.*\\|@@.*\\|\\..*\\)*$"
"Regular expression to match the IDENTIFIER field in a file name.") "Regular expression to match the IDENTIFIER field in a file name.")
(defconst denote-signature-regexp "==\\([^.]*?\\)\\(==.*\\|--.*\\|__.*\\|@@.*\\|\\..*\\)*$" (defconst denote-signature-regexp "==\\([^.]+?\\)\\(==.*\\|--.*\\|__.*\\|@@.*\\|\\..*\\)*$"
"Regular expression to match the SIGNATURE field in a file name.") "Regular expression to match the SIGNATURE field in a file name.")
(defconst denote-title-regexp "--\\([^.]*?\\)\\(==.*\\|__.*\\|@@.*\\|\\..*\\)*$" (defconst denote-title-regexp "--\\([^.]+?\\)\\(==.*\\|__.*\\|@@.*\\|\\..*\\)*$"
"Regular expression to match the TITLE field in a file name.") "Regular expression to match the TITLE field in a file name.")
(defconst denote-keywords-regexp "__\\([^.]*?\\)\\(==.*\\|--.*\\|__.*\\|@@.*\\|\\..*\\)*$" (defconst denote-keywords-regexp "__\\([^.]+?\\)\\(==.*\\|--.*\\|__.*\\|@@.*\\|\\..*\\)*$"
"Regular expression to match the KEYWORDS field in a file name.") "Regular expression to match the KEYWORDS field in a file name.")
(make-obsolete-variable (make-obsolete-variable
@ -1492,10 +1492,9 @@ there.")
(defun denote-file-prompt--format-identifier (file) (defun denote-file-prompt--format-identifier (file)
"Return identifier of FILE for `denote-file-prompt-affixate'." "Return identifier of FILE for `denote-file-prompt-affixate'."
(let* ((identifier (denote-retrieve-filename-identifier file)) (when-let* ((identifier (denote-retrieve-filename-identifier file))
(date-or-id (or (ignore-errors (denote-id-to-date identifier)) identifier)) (date-or-id (or (ignore-errors (denote-id-to-date identifier)) identifier)))
(propertized (propertize date-or-id 'face 'completions-annotations))) (format "%s " (propertize date-or-id 'face 'completions-annotations))))
(format "%s " propertized)))
(defun denote-file-prompt--format-keywords-and-signature (file) (defun denote-file-prompt--format-keywords-and-signature (file)
"Return keywords and signature of FILE for `denote-file-prompt-affixate'." "Return keywords and signature of FILE for `denote-file-prompt-affixate'."