Account for subdirs in denote-file-prompt-group function

This commit is contained in:
Protesilaos Stavrou 2025-12-16 08:45:10 +02:00
parent 5f082c5a07
commit cdfffbaeaa
No known key found for this signature in database
GPG key ID: 99BD6459CD5CA3EA

View file

@ -1474,7 +1474,13 @@ there.")
"Retun group of FILE if TRANSFORM is non-nil, per `completion-metadata'."
(cond
(transform
(or (denote-retrieve-filename-title file) file))
(if-let* ((title (denote-retrieve-filename-title file)))
(if-let* ((in-subdir-p (string-match-p "/" file))
(components (split-string file "/"))
(dir (string-join (butlast components) "/")))
(format "%s: %s" dir title)
title)
file))
((string-match-p (regexp-opt denote-encryption-file-extensions) file)
"Encrypted")
((string-match-p (regexp-opt (denote-file-type-extensions)) file)