branch: externals/denote
commit cdfffbaeaa040aeaece97496cdaebe42018de129
Author: Protesilaos Stavrou <[email protected]>
Commit: Protesilaos Stavrou <[email protected]>

    Account for subdirs in denote-file-prompt-group function
---
 denote.el | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/denote.el b/denote.el
index 308a604601..5e5bd1fa23 100644
--- a/denote.el
+++ b/denote.el
@@ -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)

Reply via email to