mirror of
https://github.com/protesilaos/denote.git
synced 2026-09-10 07:16:20 -04:00
Fix file-prompt crash when denote-directory contains files like __.js
Using denote in a directory that includes files matching '*/__.js' breaks with "Wrong type argument: stringp, nil" on the file prompt. lodash ships such files in node_modules, so accidentally pointing denote at a lodash checkout (or having one under denote-directory) triggers the error. These files pass denote-file-has-denoted-filename-p because the empty keywords section matches denote-keywords-regexp, but they have no identifier, so denote-file-prompt--format-identifier passed nil to propertize during affixation. Return nil in that case; denote-file-prompt-affixate already substitutes "" for a nil prefix. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
30c0d6536e
commit
6ba209704d
|
|
@ -1492,10 +1492,9 @@ there.")
|
|||
|
||||
(defun denote-file-prompt--format-identifier (file)
|
||||
"Return identifier of FILE for `denote-file-prompt-affixate'."
|
||||
(let* ((identifier (denote-retrieve-filename-identifier file))
|
||||
(date-or-id (or (ignore-errors (denote-id-to-date identifier)) identifier))
|
||||
(propertized (propertize date-or-id 'face 'completions-annotations)))
|
||||
(format "%s " propertized)))
|
||||
(when-let* ((identifier (denote-retrieve-filename-identifier file))
|
||||
(date-or-id (or (ignore-errors (denote-id-to-date identifier)) identifier)))
|
||||
(format "%s " (propertize date-or-id 'face 'completions-annotations))))
|
||||
|
||||
(defun denote-file-prompt--format-keywords-and-signature (file)
|
||||
"Return keywords and signature of FILE for `denote-file-prompt-affixate'."
|
||||
|
|
|
|||
Loading…
Reference in a new issue