From 6424a82d60183c712b9d821e4077d284307d8fb5 Mon Sep 17 00:00:00 2001 From: Jonas Bernoulli Date: Wed, 14 Nov 2012 12:39:37 +0100 Subject: [PATCH 1/3] mu4e: add function mu4e-user-agent Without this `mail-user-agent' cannot be set to `mu4e-user-agent' through customize, as the custom type expects a function. Not sure whether this function is actually ever used; if it is then returning the symbol is probably the correct thing to do, as other such functions suggest. --- mu4e/mu4e-compose.el | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/mu4e/mu4e-compose.el b/mu4e/mu4e-compose.el index 0f29435d..62d2f4da 100644 --- a/mu4e/mu4e-compose.el +++ b/mu4e/mu4e-compose.el @@ -520,6 +520,13 @@ Ie. either 'name ' or 'email')." 'message-send-and-exit 'message-kill-buffer 'message-send-hook) +;; Without this `mail-user-agent' cannot be set to `mu4e-user-agent' +;; through customize, as the custom type expects a function. Not +;; sure whether this function is actually ever used; if it is then +;; returning the symbol is probably the correct thing to do, as other +;; such functions suggest. +(defun mu4e-user-agent () + 'mu4e-user-agent) (defun mu4e~compose-browse-url-mail (url &optional ignored) "Adapter for `browse-url-mailto-function." From 17be9ec05a38df35fce4a7c3f6530b7380f43962 Mon Sep 17 00:00:00 2001 From: Jonas Bernoulli Date: Wed, 14 Nov 2012 12:55:15 +0100 Subject: [PATCH 2/3] mu4e: autoload major entry points Autoload functions `mu4e' and `mu4e~compose-mail' and the definition of the mail-user-agent `mu4e-user-agent'. The last to are required so that `compose-mail' can be used without explicitly loading mu4e. Also require `mu4e' in mu4e-compose.el (after providing mu4e-compose to avoid a circular dependencies). This is required because the autoload definitions only cause mu4e-compose but not mu4e to be loaded when using `compose-mail', but if mu4e isn't loaded various handlers are not loaded (and possibly there are other problems if mu4e is not fully loaded). --- mu4e/mu4e-compose.el | 6 ++++++ mu4e/mu4e.el | 1 + 2 files changed, 7 insertions(+) diff --git a/mu4e/mu4e-compose.el b/mu4e/mu4e-compose.el index 62d2f4da..7cc94abc 100644 --- a/mu4e/mu4e-compose.el +++ b/mu4e/mu4e-compose.el @@ -482,6 +482,7 @@ Ie. either 'name ' or 'email')." ;; mu4e-compose-func and mu4e-send-func are wrappers so we can set ourselves ;; as default emacs mailer (define-mail-user-agent etc.) +;;;###autoload (defun mu4e~compose-mail (&optional to subject other-headers continue switch-function yank-action send-actions return-action) "This is mu4e's implementation of `compose-mail'." @@ -515,6 +516,7 @@ Ie. either 'name ' or 'email')." (message-goto-body)))) ;; happily, we can re-use most things from message mode +;;;###autoload (define-mail-user-agent 'mu4e-user-agent 'mu4e~compose-mail 'message-send-and-exit @@ -547,3 +549,7 @@ Ie. either 'name ' or 'email')." ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (provide 'mu4e-compose) + +;; Load mu4e completely even when this file was loaded through +;; autoload. +(require 'mu4e) diff --git a/mu4e/mu4e.el b/mu4e/mu4e.el index b2a66916..4ee708a0 100644 --- a/mu4e/mu4e.el +++ b/mu4e/mu4e.el @@ -71,6 +71,7 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;###autoload (defun mu4e () "Start mu4e." (interactive) From 371e3907c514c9e2988dfc4de5ad34f77bbf3450 Mon Sep 17 00:00:00 2001 From: Jonas Bernoulli Date: Wed, 14 Nov 2012 13:36:18 +0100 Subject: [PATCH 3/3] mu4e: fix typo and doc-string formatting --- mu4e/mu4e-meta.el.in | 3 +-- mu4e/mu4e.el | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/mu4e/mu4e-meta.el.in b/mu4e/mu4e-meta.el.in index 8e925b1b..91f52726 100644 --- a/mu4e/mu4e-meta.el.in +++ b/mu4e/mu4e-meta.el.in @@ -1,7 +1,6 @@ ;; auto-generated (defconst mu4e-mu-version "@VERSION@" - "Required mu binary version; mu4e's version must agree with - this.") + "Required mu binary version; mu4e's version must agree with this.") (defconst mu4e-builddir "@abs_top_builddir@" "Top-level build directory.") diff --git a/mu4e/mu4e.el b/mu4e/mu4e.el index 4ee708a0..d0a4dcce 100644 --- a/mu4e/mu4e.el +++ b/mu4e/mu4e.el @@ -52,7 +52,7 @@ (setq mu4e-remove-func 'mu4e~headers-remove-handler) (setq mu4e-erase-func 'mu4e~headers-clear) -;; these ones are define in mu4e-utils +;; these ones are defined in mu4e-utils (setq mu4e-info-func 'mu4e-info-handler) (setq mu4e-error-func 'mu4e-error-handler) ;; note: mu4e-utils also dynamically (temporarily)