Skip to content

Commit

Permalink
* fix mkdir / interaction with 'move-to-maildir'
Browse files Browse the repository at this point in the history
  • Loading branch information
djcb committed Jan 3, 2012
1 parent 8235efc commit a60ecb5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
6 changes: 5 additions & 1 deletion emacs/mu4e-hdrs.el
Original file line number Diff line number Diff line change
Expand Up @@ -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)))))


Expand Down
4 changes: 4 additions & 0 deletions emacs/mu4e-proc.el
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,10 @@ set to e.g. '/drafts'; if this works, we will receive (:info :path
<path> :docid <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))
Expand Down

0 comments on commit a60ecb5

Please sign in to comment.