2

I've been using this guide to set up email in Emacs on macOS. I managed the offlineimap connection and replication into a Maildir. I installed mu with brew install mu:

$ which mu
/usr/local/bin/mu

But I cannot find anything in the Emacs site-lisp to launch mu4e:

$ ls /usr/local/share/emacs/site-lisp/mu/ ls: /usr/local/share/emacs/site-lisp/mu/: No such file or directory

But the website suggests that mu4e is installed:

mu includes an emacs-based e-mail client (mu4e)

I tried building from git and using brew in this way:

EMACS=$(which emacs) brew install mu --with-emacs --HEAD

and in both cases I get:

configure: error: Package requirements (gmime-3.0) were not met:

No package 'gmime-3.0' found

Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.

Alternatively, you may set the environment variables GMIME_CFLAGS
and GMIME_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.

and this package is not in brew:

Error: No formulae found in taps.

Furthermore, on my home computer the command EMACS=$(which emacs) brew install mu --with-emacs --HEAD reinstalls emacs with brew, despite it being already installed.

Another attempt is to install mu, then just copy the mu4e files to site-lisp:

brew install mu
git clone git://github.com/djcb/mu.git
mkdir /usr/local/share/emacs/site-lisp/mu/
cp -r mu4e /usr/local/share/emacs/site-lisp/mu/

and adding this in ~/.emacs:

(require 'mu4e)
(add-to-list 'load-path "/usr/local/share/emacs/site-lisp/mu/mu4e")

But I get the error Cannot open load file: No such file or directory, mu4e-meta. And still, M-x mu4e doesn't work.

How can I install mu4e?

2
  • And your .emacs configuration? is mu4e required? is the mail path loaded? can you please provide a link to your config? or paste the relevant par there? Nov 22, 2018 at 22:00
  • I had not added (require 'mu4e), which I now updated the question with. Those two lines are the relevant part of .emacs.
    – emonigma
    Nov 23, 2018 at 9:34

3 Answers 3

3

To get elisp files installed together with mu using brew in OSX, you need to run:

brew install mu

The available arguments to mu install is shown with brew info mu.

You can get the list of all installed files with brew ls --verbose mu. At the moment, the directory /usr/local/Cellar/mu/1.0/share/emacs/site-lisp/mu/mu4e/ gets symlinked to /usr/local/share/emacs/site-lisp/mu/mu4e.

The mu configuration in your emacs init file needs to first call add-to-list pointing to the directory where mu4e files are, followed by the form (require mu4e) and all other variable settings:

(add-to-list 'load-path "/usr/local/share/emacs/site-lisp/mu/mu4e")
(require 'mu4e)
 ...

If mu4e fails to start even after require'ing it, you should try adding (setq mu4e-mu-binary "/usr/local/bin/mu"). mu4e has tons more variables you can set to get the behavior you want.

6
  • I ran that, and got ls: /usr/local/Cellar/mu/1.0/share/emacs/site-lisp/mu/mu4e/: No such file or directory.
    – emonigma
    Nov 23, 2018 at 9:27
  • Find out where the files are with brew ls --verbose mu
    – Heikki
    Nov 24, 2018 at 12:52
  • You need to add-to-list the relavant directory before you require.
    – Heikki
    Nov 24, 2018 at 13:24
  • These changes worked: brew install mu --wtih-emacs and add-to-list before require! I then configured mu4e with this minimal configuration. Can you include those changes so I accept the answer?
    – emonigma
    Nov 27, 2018 at 10:41
  • 2
    The option --with-emacs fails. mu comes with mu4e, so you can install with brew install mu and verify that mu4e is installed if brew ls --verbose mu> lists directories with emacs/site-lisp.
    – emonigma
    Mar 12, 2019 at 13:04
2

I just got mu with mu4e installed on Mojave. Here are links to the problems associated with doing so on a Mac:

Cf for an explanation of the problem & hurdles:

  1. "installing mu and mu4e with homebrew with emacs from emacsforosx" https://blog.danielgempesaw.com/post/43467552978/installing-mu-and-mu4e-with-homebrew-with-emacs

  2. "A COMPLETE GUIDE TO EMAIL IN EMACS USING MU AND MU4E" http://cachestocaches.com/2017/3/complete-guide-email-emacs-using-mu-and-/

And, here is what worked for me:

  1. In order to modify /usr/bin/emacs to prevent Homebrew from dropping the co-install of "mu4e", I had to disable the System Integrity Process: reboot + Cmd+R for recovery mode + 'Utilities' > Terminal & csrutil status && csrutil disable && reboot (to exit recovery mode)

  2. Then, after moving /usr/bin/emacs to /usr/bin/emacs.bak, I symlinked a version of Emacs > 23.6 (I think that's the minimum version required by Homebrew to trigger an install of 'mu4e' along with mu) into /usr/bin (which is where Homebrew checks to see which version of Emacs is installed). See the above linked webpages for details.

  3. Symlink an installed Emacs > 23.6 into /usr/bin

➜ ✗ sudo ln -s /Applications/Emacs1.app/Contents/MacOS/Emacs /usr/bin/emacs

  1. Verify the symlink:

➜ ✗ ls -l /usr/bin/emacs lrwxr-xr-x 1 root wheel 45 Apr 12 17:04 /usr/bin/emacs -> /Applications/Emacs1.app/Contents/MacOS/Emacs

  1. Install mu w/ mu4e (Already had Emacs-27.0.90 installed.)

➜ ✗ brew install mu --HEAD

This is what I had for mu & mu4e after the install:

➜ ✗ ls /usr/local/share/emacs/site-lisp/mu/mu4e

➜ ✗ ls -l /usr/local/share/emacs/site-lisp/mu/mu4e

  1. Symlink 'mu' to /usr/local/bin

➜ ✗ ln -s /usr/local/Cellar/mu/HEAD-e9fb70e_1/bin/mu /usr/local/bin/

  1. Verify the symlink.

➜ ✗ ls -l /usr/local/bin/mu /usr/local/bin/mu -> /usr/local/Cellar/mu/HEAD-e9fb70e_1/bin/mu

  1. Verify the 'mu' symlink ➜ ✗ which mu /usr/local/bin/mu

  2. Test 'mu' command-line use

➜ ✗ mu --version mu (mail indexer/searcher) version 1.3.10 Copyright (C) 2008-2020 Dirk-Jan C. Binnema License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html.

That's as far as I've gone with mu+mu4e. I haven't yet tested it in Emacs.

Good luck.

2

The advice of running brew ls mu is a great start but it'll get you a path that has a version number in it. E. g., [snip]/1.x.x/share/emacs/site-lisp/mu/mu4e. I am guessing this link goes bad if the version number changes after an update. That is why we need a symlink.

It seems that the symlink used to be at /usr/local/share/emacs/site-lisp/mu/mu4e but as many comments point out--that is no longer true. It is probably because the output to brew --prefix has changed from /usr/local. The symlink can always be reliably found by echo $(brew --prefix)/share/emacs/site-lisp/mu/mu4e. Try,

ls $(brew --prefix)/share/emacs/site-lisp/mu/mu4e

And you should see the elisp files.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.