From e88c869d6eca148ce8984be7bc8801b892a2ac15 Mon Sep 17 00:00:00 2001 From: Tassilo Horn Date: Sun, 15 Jan 2023 14:31:46 +0100 Subject: [PATCH] Multiword maildirs are not quoted when autocomplete is used (fixes #2389) --- mu4e/mu4e-search.el | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/mu4e/mu4e-search.el b/mu4e/mu4e-search.el index cd9e4ec4..9b57f071 100644 --- a/mu4e/mu4e-search.el +++ b/mu4e/mu4e-search.el @@ -389,7 +389,13 @@ status, STATUS." ((looking-back "maildir:\\([a-zA-Z0-9/.]*\\)" nil) (list (match-beginning 1) (match-end 1) - (mu4e-get-maildirs))) + (mapcar (lambda (dir) + ;; Quote maildirs with whitespace in their name, e.g., + ;; maildir:"Foobar/Junk Mail". + (if (string-match-p "[[:space:]]" dir) + (concat "\"" dir "\"") + dir)) + (mu4e-get-maildirs)))) ((looking-back "prio:\\(\\w*\\)" nil) (list (match-beginning 1) (match-end 1)