]> git.cworth.org Git - notmuch/commit - emacs/notmuch-mua.el
emacs: improve how cl-lib and pcase are required
authorJonas Bernoulli <jonas@bernoul.li>
Sun, 10 Jan 2021 14:01:07 +0000 (15:01 +0100)
committerDavid Bremner <david@tethera.net>
Fri, 15 Jan 2021 10:46:38 +0000 (06:46 -0400)
commit9ca1f945d9f5030600dc14ffff10d4dad14db4ca
tree746b3b70f2d43071ffd1ec077c6ab79563f09bab
parentf47e3333b5478e43840e55710311aebdd441fc0e
emacs: improve how cl-lib and pcase are required

We need to load `cl-lib' at run-time because we use more from it than
just macros.  Never-the-less many, but not all libraries required it
only at compile-time, which we got away with because at least some
libraries already required it at run-time as well.

We use `cl-lib' and (currently to a lesser extend) `pcase' throughout
the code-base, which means that we should require these features in
most libraries.

In the past we tried to only require these features in just the
libraries that actually need them, without fully succeeding.  We did
not succeed in doing so because that means we would have to check
every time that we use a function from these features whether they
are already being required in the current library.

An alternative would be to add the `require' forms at the top of every
library but that is a bit annoying too.

In order to make sure that these features are loaded when needed but
also to keep the noise down we only require them in "notmuch-lib.el",
which most other libraries require, and in most of the few libraries
that do not do so, namely "notmuch-draft.el", "notmuch-message.el" and
"notmuch-parser.el".  ("coolj.el", "make-deps.el", various generated
libraries, and "notmuch-compat.el" are left touched.)
14 files changed:
emacs/notmuch-address.el
emacs/notmuch-company.el
emacs/notmuch-draft.el
emacs/notmuch-hello.el
emacs/notmuch-jump.el
emacs/notmuch-lib.el
emacs/notmuch-maildir-fcc.el
emacs/notmuch-message.el
emacs/notmuch-mua.el
emacs/notmuch-parser.el
emacs/notmuch-show.el
emacs/notmuch-tag.el
emacs/notmuch-tree.el
emacs/notmuch.el