From c7bb9aef9aa3cff165c6b6a2666264deb55618f6 Mon Sep 17 00:00:00 2001 From: djcb Date: Fri, 28 Sep 2012 17:10:34 +0300 Subject: [PATCH] * mu4e: cosmetics --- mu4e/mu4e-compose.el | 23 +++++++++++------------ mu4e/mu4e-utils.el | 17 +++++++---------- mu4e/mu4e-view.el | 13 ++++++++----- 3 files changed, 26 insertions(+), 27 deletions(-) diff --git a/mu4e/mu4e-compose.el b/mu4e/mu4e-compose.el index 9a5b5fca..0e307ca1 100644 --- a/mu4e/mu4e-compose.el +++ b/mu4e/mu4e-compose.el @@ -56,13 +56,12 @@ the From: address.)" (defcustom mu4e-sent-messages-behavior 'sent "Determines what mu4e does with sent messages - this is a symbol -which can be either: -'sent --> move the sent message to the Sent-folder (`mu4e-sent-folder') -'trash --> move the sent message to the Trash-folder (`mu4e-trash-folder') -'delete --> delete the sent message. -Note, when using GMail/IMAP, you should set this to either 'trash -or 'delete, since GMail already takes care of keeping copies in the -sent folder." +which can be either: 'sent --> move the sent message to the +Sent-folder (`mu4e-sent-folder') 'trash --> move the sent message +to the Trash-folder (`mu4e-trash-folder') 'delete --> delete the +sent message. Note, when using GMail/IMAP, you should set this to +either 'trash or 'delete, since GMail already takes care of keeping +copies in the sent folder." :type 'symbol :safe 'symbolp :group 'mu4e-compose) @@ -401,7 +400,7 @@ Also sets `mu4e~compose-trash-folder', buffer-local, permanent variables." (unless mu4e-maildir (mu4e-error "mu4e-maildir not set")) (if (eq compose-type 'edit) - (find-file (mu4e-message-field msg :path)) + (find-file (mu4e-message-field msg :path)) (let* ((draftdir (mu4e-get-drafts-folder msg)) (draftfile (mu4e~compose-message-filename-construct "DS")) (draftpath (concat mu4e-maildir draftdir "/cur/" draftfile))) @@ -418,7 +417,7 @@ buffer-local, permanent variables." (mu4e~compose-setup-folder 'mu4e~compose-drafts-folder mu4e-get-drafts-folder msg) (mu4e~compose-setup-folder 'mu4e~compose-sent-folder mu4e-get-sent-folder msg)) - + ;; 'fcc' refers to saving a copy of a sent message to a certain folder. that's ;; what these 'Sent mail' folders are for! @@ -578,7 +577,7 @@ needed, set the Fcc header, and register the handler function." '("^References:" "^Face:" "^X-Face:" "^X-Draft-From:" "^User-Agent:" "^In-Reply-To:") "List of regexps with message headers that are to be hidden.") - + (defun mu4e~compose-handler (compose-type &optional original-msg includes) "Create a new draft message, or open an existing one. @@ -615,7 +614,7 @@ tempfile)." (message-insert-signature)) ;; hide some headers (let ((message-hidden-headers mu4e~compose-hidden-headers)) - (message-hide-headers)) + (message-hide-headers)) ;; buffer is not user-modified yet (mu4e~compose-set-friendly-buffer-name compose-type) (set-buffer-modified-p nil) @@ -701,7 +700,7 @@ for draft messages." (unless (or msg (eq compose-type 'new)) (mu4e-warn "No message at point")) (unless (member compose-type '(reply forward edit new)) - (mu4e-error "Invalid compose type '%S'" compose-type)) + (mu4e-error "Invalid compose type '%S'" compose-type)) (when (and (eq compose-type 'edit) (not (member 'draft (mu4e-message-field msg :flags)))) (mu4e-warn "Editing is only allowed for draft messages")) diff --git a/mu4e/mu4e-utils.el b/mu4e/mu4e-utils.el index f63a0baa..7a5f07de 100644 --- a/mu4e/mu4e-utils.el +++ b/mu4e/mu4e-utils.el @@ -100,7 +100,7 @@ parameter (which may be `nil'), and return the result." (mu4e~get-folder 'mu4e-trash-folder msg)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - + @@ -385,7 +385,7 @@ http://cr.yp.to/proto/maildir.html " (format "%2.1fK" (/ size 1000.0))) ((< size 1000) (format "%d" size)) (t (propertize "?" 'face 'mu4e-system-face)))) - + (defun mu4e-display-manual () "Display the mu4e manual page for the current mode, or go to the @@ -521,10 +521,7 @@ This is used by the completion function in mu4e-compose." (and mu4e-compose-complete-ignore-address-regexp (string-match mu4e-compose-complete-ignore-address-regexp mail)) (add-to-list 'lst - (if name (format "\"%s\" <%s>" - ;; hack so we don't get ',' in e-mail addresses... - (replace-regexp-in-string "," "" name) - mail) mail)))))) + (if name (format "\"%s\" <%s>" name mail) mail)))))) (setq mu4e~contacts-for-completion lst) (mu4e-message "Contacts received: %d" (length mu4e~contacts-for-completion)))) @@ -538,7 +535,7 @@ This is used by the completion function in mu4e-compose." (let ((version (plist-get mu4e~server-props :version))) (unless (string= version mu4e-mu-version) (mu4e-error "mu server has version %s, but we need %s" - version mu4e-mu-version)))) + version mu4e-mu-version)))) (unless (and mu4e-mu-binary (file-executable-p mu4e-mu-binary)) (mu4e-error "Please set `mu4e-mu-binary' to the full path to the mu binary.")) @@ -572,11 +569,11 @@ FUNC (if non-nil) afterwards." ;; if we're already running, simply go to the main view (if (mu4e~proc-is-running) ;; already running? (when func ;; yes! run func if defined - (funcall func)) + (funcall func)) (progn ;; no! do some checks, set up pong handler and ping the server - (lexical-let ((func func)) + (lexical-let ((func func)) (mu4e~check-requirements) ;; set up the 'pong' handler func (setq mu4e-pong-func @@ -604,7 +601,7 @@ FUNC (if non-nil) afterwards." (when mu4e-compose-complete-only-after (float-time (apply 'encode-time - (mu4e-parse-time-string mu4e-compose-complete-only-after))))))))) + (mu4e-parse-time-string mu4e-compose-complete-only-after))))))))) (defun mu4e~stop () diff --git a/mu4e/mu4e-view.el b/mu4e/mu4e-view.el index 5945693b..41fdac5c 100644 --- a/mu4e/mu4e-view.el +++ b/mu4e/mu4e-view.el @@ -336,7 +336,8 @@ at POINT, or if nil, at (point)." (let* ((parts (mu4e-message-field msg :parts)) (verdicts (remove-if 'null - (mapcar (lambda (part) (mu4e-message-part-field part :signature)) parts))) + (mapcar (lambda (part) (mu4e-message-part-field part :signature)) + parts))) (val (when verdicts (mapconcat (lambda (v) @@ -382,7 +383,8 @@ at POINT, or if nil, at (point)." (remove-if-not (lambda (part) (let ((mtype (mu4e-message-part-field part :mime-type)) - (isattach (member 'attachment (mu4e-message-part-field part :type)))) + (isattach (member 'attachment + (mu4e-message-part-field part :type)))) (or ;; remove if it's not an attach *or* if it's an ;; image/audio/application type (but not a signature) isattach @@ -1087,11 +1089,12 @@ user that unmarking only works in the header list." (defmacro mu4e~view-defun-mark-for (mark) "Define a function mu4e-view-mark-for-MARK." (let ((funcname (intern (concat "mu4e-view-mark-for-" (symbol-name mark)))) - (docstring (concat "Mark the current message for " (symbol-name mark) "."))) + (docstring (format "Mark the current message for %s." + (symbol-name mark)))) `(defun ,funcname () ,docstring (interactive) (mu4e~view-in-headers-context - (mu4e-headers-mark-and-next (quote mark)))))) + (mu4e-headers-mark-and-next (quote ,mark)))))) ;; would be cool to do something like the following, but somehow, I can't get ;; the quoting right... @@ -1208,6 +1211,6 @@ ensure we don't disturb other windows." (kill-buffer) (when (buffer-live-p mu4e~view-headers-buffer) (switch-to-buffer mu4e~view-headers-buffer)))))) - + (provide 'mu4e-view) ;; end of mu4e-view