* small cleanup of the retagging support

This commit is contained in:
djcb
2012-12-09 15:07:21 +02:00
parent cd138a17dc
commit 0e204fece4
4 changed files with 37 additions and 29 deletions

View File

@ -407,7 +407,8 @@ cmd_add (ServerContext *ctx, GSList *args, GError **err)
msg = mu_store_get_msg (ctx->store, docid, err); msg = mu_store_get_msg (ctx->store, docid, err);
if (msg) { if (msg) {
sexp = mu_msg_to_sexp (msg, docid, NULL, MU_MSG_OPTION_VERIFY); sexp = mu_msg_to_sexp (msg, docid, NULL,
MU_MSG_OPTION_VERIFY);
print_expr ("(:update %s :move nil)", sexp); print_expr ("(:update %s :move nil)", sexp);
mu_msg_unref(msg); mu_msg_unref(msg);

View File

@ -216,8 +216,8 @@ store your org-contacts."
(call-process "sed" nil nil nil "-ine" (call-process "sed" nil nil nil "-ine"
(format "1,/^$/s/^%s:.*$/%s: %s/" header header tagstr) path) (format "1,/^$/s/^%s:.*$/%s: %s/" header header tagstr) path)
(message (concat "tagging: " (mapconcat 'identity taglist " "))) (mu4e-message (concat "tagging: " (mapconcat 'identity taglist " ")))
(mu4e~proc-add path maildir))) (mu4e-refresh-message path maildir)))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

View File

@ -397,7 +397,7 @@ of 'my' email addresses (see `mu4e-user-mail-address-list')."
"Add the message at PATH to the database. "Add the message at PATH to the database.
With MAILDIR set to the maildir this message resides in, With MAILDIR set to the maildir this message resides in,
e.g. '/drafts'; if this works, we will receive (:info add :path e.g. '/drafts'; if this works, we will receive (:info add :path
<path> :docid <docid>)." <path> :docid <docid>) as well as (:update <msg-sexp>)."
(mu4e~proc-send-command "add path:\"%s\" maildir:\"%s\"" (mu4e~proc-send-command "add path:\"%s\" maildir:\"%s\""
path maildir)) path maildir))

View File

@ -169,14 +169,16 @@ debuggable (backtrace) error."
(mu4e-log 'error (apply 'mu4e-format frm args)) (mu4e-log 'error (apply 'mu4e-format frm args))
(error "%s" (apply 'mu4e-format frm args))) (error "%s" (apply 'mu4e-format frm args)))
;; the user-error function is only available in emacs-trunk
(unless (fboundp 'user-error)
(defalias 'user-error 'error))
(defun mu4e-warn (frm &rest args) (defun mu4e-warn (frm &rest args)
"Create [mu4e]-prefixed warning based on format FRM and ARGS. "Create [mu4e]-prefixed warning based on format FRM and ARGS.
Does a local-exit and does not return. In emacs versions below Does a local-exit and does not return. In emacs versions below
24.2, the functions is the same as `mu4e-error'." 24.2, the functions is the same as `mu4e-error'."
(mu4e-log 'error (apply 'mu4e-format frm args)) (mu4e-log 'error (apply 'mu4e-format frm args))
(if (fboundp 'user-error) (user-error "%s" (apply 'mu4e-format frm args)))
(user-error "%s" (apply 'mu4e-format frm args)) ;; only in emacs-trunk
(error "%s" (apply 'mu4e-format frm args))))
(defun mu4e~read-char-choice (prompt choices) (defun mu4e~read-char-choice (prompt choices)
"Compatiblity wrapper for `read-char-choice'. "Compatiblity wrapper for `read-char-choice'.
@ -889,6 +891,11 @@ displaying it). Do _not_ bury the current buffer, though."
(goto-char (point-min))) (goto-char (point-min)))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun mu4e-refresh-message (path maildir)
"Re-parse message at PATH and MAILDIR; if this works, we will
receive (:info add :path <path> :docid <docid>) as well as (:update
<msg-sexp>)."
(mu4e~proc-add path maildir))
(provide 'mu4e-utils) (provide 'mu4e-utils)
;;; End of mu4e-utils.el ;;; End of mu4e-utils.el