* mu4e-hdrs: check whether we're on a message *before* asking for maildir to

move to
This commit is contained in:
djcb
2012-01-06 17:49:49 +02:00
parent 4d6ea2346b
commit c941dae85b

View File

@ -700,6 +700,8 @@ limit to up to `mu4e-search-results-limit'."
"Mark message at point for moving to maildir TARGET. If target is "Mark message at point for moving to maildir TARGET. If target is
not provided, function asks for it." not provided, function asks for it."
(interactive) (interactive)
(unless (mu4e-hdrs-get-docid)
(error "No message at point."))
(with-current-buffer mu4e-hdrs-buffer (with-current-buffer mu4e-hdrs-buffer
(let* ((target (or target (mu4e-ask-maildir "Move message to: "))) (let* ((target (or target (mu4e-ask-maildir "Move message to: ")))
(target (if (string= (substring target 0 1) "/") (target (if (string= (substring target 0 1) "/")