This patch packages mu4e as an Emacs lisp package based on the mu4e
output of the multiple-output package mu, which makes mu4e a good
citizen of Emacs lisp packages in two aspects.
First, mu4e now utilizes the Emacs lisp package infrastructure in
Nixpkgs. This allows users who want to do AOT native compilation for
non-default Emacs variants[0] to build only mu4e itself instead of the
whole mu package[1].
Second, mu4e now conforms to the Emacs builtin package manager[2].
Without this patch, mu4e autoloaded commands do not work
out-of-the-box[3] because its directory is added to load-path by
site-start.el after the initialization of package-directory-list,
which causes package-activate-all to not load mu4e-autoloads.el. This
patch fixes this issue when mu4e is installed to Emacs using the
withPackages wrapper[4].
[0]: such as emacs-pgtk
[1]: mu.override { emacs = emacs-pgtk; }
[2]: package.el
[3]: either (require 'mu4e) or (require 'mu4e-autoloads) is needed to
be called before an autoloaded command is called
[4]: emacs-pgtk.pkgs.withPackages (epkgs: [ epkgs.mu4e ])
* What is autoload?
Basically, it allows you to delay the loading of a package[1].
* What is a name-autoloads.el file?
When installing a package using package.el, Emacs generates[1] a
name-autoloads.el file for that package, which is used to autoload the
principal user commands defined[2][3] in the package.
* What problem does this patch solve?
There are some autoload commands defined[3] by mu4e. Before, those
autoload commands cannot be autoloaded because of the missing
mu4e-autoloads.el file since mu4e installed from nixpkgs does not use
package.el. This patch fixes that.
To sum up, with this patch, you can call (mu4e) without
calling (require 'mu4e) first.
* Isn't it better to contribute to the build system of the upstream mu
project to generate that mu4e-autoloads.el file?
It seems impossible[4] to do so.
[1]: https://www.gnu.org/software/emacs/manual/html_node/elisp/Autoload.html
[2]: https://www.gnu.org/software/emacs/manual/html_node/elisp/Packaging-Basics.html
[3]: 581f8d7e92/mu4e/mu4e.el (L58)
[4]: https://github.com/djcb/mu/pull/2313
For reasons unknown, the list of support platforms tracked that of mesa.
That makes no sense whatsoever, so set it to a list of platforms that
actually should be supported.