From a60ecb5284dd3762555ef66102bc253ac3686d75 Mon Sep 17 00:00:00 2001 From: djcb Date: Tue, 3 Jan 2012 22:33:41 +0200 Subject: [PATCH] * fix mkdir / interaction with 'move-to-maildir' --- emacs/mu4e-hdrs.el | 6 +++++- emacs/mu4e-proc.el | 4 ++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/emacs/mu4e-hdrs.el b/emacs/mu4e-hdrs.el index 5c8e2df9..d3b49c6e 100644 --- a/emacs/mu4e-hdrs.el +++ b/emacs/mu4e-hdrs.el @@ -708,12 +708,16 @@ not provided, function asks for it." (interactive) (with-current-buffer mu4e-hdrs-buffer (let* ((target (or target (mu4e-ask-maildir "Move message to: "))) + (target (if (string= (substring target 0 1) "/") + target + (concat "/" target))) (fulltarget (concat mu4e-maildir target))) (when (or (file-directory-p fulltarget) (and (yes-or-no-p (format "%s does not exist. Create now?" fulltarget)) (mu4e-proc-mkdir fulltarget))) - (mu4e-hdrs-mark 'move target) + (sleep-for 1) ;; ugly + (mu4e-hdrs-mark 'move target) (mu4e-next-header))))) diff --git a/emacs/mu4e-proc.el b/emacs/mu4e-proc.el index dce4b548..b504d4f9 100644 --- a/emacs/mu4e-proc.el +++ b/emacs/mu4e-proc.el @@ -401,6 +401,10 @@ set to e.g. '/drafts'; if this works, we will receive (:info :path :docid )." (mu4e-proc-send-command "add \"%s\" \"%s\"" path maildir)) +(defun mu4e-proc-mkdir (maildir) + "Update the message database for MAILDIR." + (mu4e-proc-send-command "mkdir \"%s\"" maildir)) + (defun mu4e-proc-save (docid partidx path) "Save attachment PARTIDX from message with DOCID to PATH." (mu4e-proc-send-command "save %d %d \"%s\"" docid partidx path))