Load mu4e in a more-portable way

This commit is contained in:
Camden Dixie O'Brien 2021-01-01 00:00:33 +00:00
parent 3eacf8d663
commit 32b37420a3

View File

@ -602,20 +602,14 @@ needs to be set up to install them if they aren't already.
=mu4e= is a bit annoying as it's bundled along with =mu= rather than
being loaded from ELPA or MELPA, so it can't be loaded with
=use-package=. Indeed, how to load it depends on how =mu= was
packaged. On NixOS at least, =mu4e= gets put in a place where Emacs
is able to find it, so it just needs to be =require='d.
packaged. On NixOS, =mu4e= gets automagically introduced to Emacs,
but on OpenBSD we have to add its location to =load-path= ourselves.
#+begin_src emacs-lisp
(require 'mu4e)
#+end_src
I'm /sure/ this will break at some point; when it does, probably
makes sense to do something like:
#+begin_src emacs-lisp :tangle no
(let ((uname-output (shell-command-to-string "uname -a")))
(cond ((string-match-p "NixOS" uname-output) nil)
...))
((string-match-p "OpenBSD" uname-output)
(add-to-list 'load-path "/usr/local/share/emacs/site-lisp/mu4e"))))
(require 'mu4e)
#+end_src