Merge pull request #96 from tarsius/autoload

* basic support for autoloading mu4e
This commit is contained in:
Dirk-Jan C. Binnema
2012-11-14 14:27:48 -08:00
3 changed files with 16 additions and 3 deletions

View File

@ -482,6 +482,7 @@ Ie. either 'name <email>' or 'email')."
;; mu4e-compose-func and mu4e-send-func are wrappers so we can set ourselves ;; mu4e-compose-func and mu4e-send-func are wrappers so we can set ourselves
;; as default emacs mailer (define-mail-user-agent etc.) ;; as default emacs mailer (define-mail-user-agent etc.)
;;;###autoload
(defun mu4e~compose-mail (&optional to subject other-headers continue (defun mu4e~compose-mail (&optional to subject other-headers continue
switch-function yank-action send-actions return-action) switch-function yank-action send-actions return-action)
"This is mu4e's implementation of `compose-mail'." "This is mu4e's implementation of `compose-mail'."
@ -515,11 +516,19 @@ Ie. either 'name <email>' or 'email')."
(message-goto-body)))) (message-goto-body))))
;; happily, we can re-use most things from message mode ;; happily, we can re-use most things from message mode
;;;###autoload
(define-mail-user-agent 'mu4e-user-agent (define-mail-user-agent 'mu4e-user-agent
'mu4e~compose-mail 'mu4e~compose-mail
'message-send-and-exit 'message-send-and-exit
'message-kill-buffer 'message-kill-buffer
'message-send-hook) '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) (defun mu4e~compose-browse-url-mail (url &optional ignored)
"Adapter for `browse-url-mailto-function." "Adapter for `browse-url-mailto-function."
@ -540,3 +549,7 @@ Ie. either 'name <email>' or 'email')."
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(provide 'mu4e-compose) (provide 'mu4e-compose)
;; Load mu4e completely even when this file was loaded through
;; autoload.
(require 'mu4e)

View File

@ -1,7 +1,6 @@
;; auto-generated ;; auto-generated
(defconst mu4e-mu-version "@VERSION@" (defconst mu4e-mu-version "@VERSION@"
"Required mu binary version; mu4e's version must agree with "Required mu binary version; mu4e's version must agree with this.")
this.")
(defconst mu4e-builddir "@abs_top_builddir@" (defconst mu4e-builddir "@abs_top_builddir@"
"Top-level build directory.") "Top-level build directory.")

View File

@ -52,7 +52,7 @@
(setq mu4e-remove-func 'mu4e~headers-remove-handler) (setq mu4e-remove-func 'mu4e~headers-remove-handler)
(setq mu4e-erase-func 'mu4e~headers-clear) (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-info-func 'mu4e-info-handler)
(setq mu4e-error-func 'mu4e-error-handler) (setq mu4e-error-func 'mu4e-error-handler)
;; note: mu4e-utils also dynamically (temporarily) ;; note: mu4e-utils also dynamically (temporarily)
@ -71,6 +71,7 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;###autoload
(defun mu4e () (defun mu4e ()
"Start mu4e." "Start mu4e."
(interactive) (interactive)