mirror of
https://github.com/protesilaos/denote.git
synced 2026-09-10 07:16:20 -04:00
Ensure :get-file-type-function is called only when file exists
Otherwise we get an error upon creating the file. Thanks to potchie-maker for reporting the bug in issue 709: <https://github.com/protesilaos/denote/issues/709>.
This commit is contained in:
parent
77813e9956
commit
420710fb17
|
|
@ -7132,8 +7132,9 @@ Denote is meant to be a collective effort. Every bit of help matters.
|
|||
bdillahu, coherentstate, doolio, duli, drcxd, elge70, elliottw,
|
||||
fingerknight, GuutBoy, hpgisler, hyperfocus1337,johkneisl,
|
||||
jtpavlock, juh, leafarbelm, mentalisttraceur, mjkalyan, oatmealm,
|
||||
Pratik-Mishra-4979, pRot0ta1p, rbenit68, relict007, sarcom-sar,
|
||||
sienic, skissue, sundar bp, wuzhihao, yetanotherfossman, zadca123
|
||||
potchie-maker, Pratik-Mishra-4979, pRot0ta1p, rbenit68, relict007,
|
||||
sarcom-sar, sienic, skissue, sundar bp, wuzhihao, yetanotherfossman,
|
||||
zadca123
|
||||
|
||||
Special thanks to Peter Povinec who helped refine the file-naming
|
||||
scheme, which is the cornerstone of this project.
|
||||
|
|
|
|||
|
|
@ -3961,7 +3961,8 @@ Return nil if FILE is not recognized."
|
|||
(found (seq-find
|
||||
(lambda (type)
|
||||
(let ((properties (cdr type)))
|
||||
(if-let* ((file-type-fn (plist-get properties :get-file-type-function)))
|
||||
(if-let* ((file-type-fn (plist-get properties :get-file-type-function))
|
||||
(_ (file-exists-p file)))
|
||||
(funcall file-type-fn file)
|
||||
(ignore-errors
|
||||
(denote--regexp-in-file-p (plist-get properties :title-key-regexp) file)))))
|
||||
|
|
|
|||
Loading…
Reference in a new issue