mu
mu copied to clipboard
mu mkdir is not integrated into mu4e
up to you to see this as a bug or a feature, but I'd expect mu4e-main to offer some mu4e-mkdir as a wrapper to mu mkdir, eg on <+> key from mu4e-main-view.
Coding this as-is would be trivial. Except, i don't know about refreshing (mu4e-get-maildirs) result, and there's https://github.com/djcb/mu/issues/68, too.... depending on this, on the future it might be reasonnable to offer to imap-encode user input to create the dir... but that's another story.
I wrote "trivial" but forgot about separator.
(defun pyl/mu4e-create-dir (&optional prompted)
(interactive "MEnter folder name : ")
(let ((full (concat
mu4e-maildir
(funcall mu4e-completing-read-function "Parent dir : " (mu4e-get-maildirs))
"." ; only works-for-me.
prompted)))
(async-shell-command
(concat "mu mkdir " full))))
In the view, if you move to a folder that does not exist mu4e offers to create it. However, the move fails. I find I have to unmark and then mark for move again.
While that sounds like another bug report, my point is create is supported just in an awkward way.
Not planning to add maildir make as a main-view command, but the second point is valid; they should be created when needed, as per #628.