The latest development version of GNU Emacs contains features coming in the next major release so I build Emacs from source. This development release is generally stable and very reliable.
The source code for GNU Emacs is available on Savannah and there is also a GitHub mirror available. I tend to use the GitHub mirror as it seems more reliable and faster.
Clone the latest, bleeding edge Emacs code.
$ git clone https://github.com/emacs-mirror/emacs.git # GitHub mirror
Configure and build Emacs
$ cd emacs
$ ./autogen.sh
$ ./configure --with-mailutils # silence warning
$ make -j 4 # 4 parallel threads
$ sudo make install
Occasionally, after upgrading to the latest version, Emacs produces a warning caused by a version mismatch for the Orgmode package. This helpful error message gives four possible causes.
Warning (emacs): Org version mismatch.
This warning usually appears when a built-in Org version is loaded
prior to the more recent Org version.
Version mismatch is commonly encountered in the following situations:
1. Emacs is loaded using literate Org config and more recent Org
version is loaded inside the file loaded by ‘org-babel-load-file’.
‘org-babel-load-file’ triggers the built-in Org version clashing
the newer Org version attempt to be loaded later.
It is recommended to move the Org loading code before the
‘org-babel-load-file’ call.
2. New Org version is loaded manually by setting ‘load-path’, but some
other package depending on Org is loaded before the ‘load-path’ is
configured.
This "other package" is triggering built-in Org version, again
causing the version mismatch.
It is recommended to set ‘load-path’ as early in the config as
possible.
3. New Org version is loaded using straight.el package manager and
other package depending on Org is loaded before straight triggers
loading of the newer Org version.
It is recommended to put
(straight-use-package 'org)
early in the config. Ideally, right after the straight.el
bootstrap. Moving ‘use-package’ :straight declaration may not be
sufficient if the corresponding ‘use-package’ statement is
deferring the loading.
4. A new Org version is synchronized with Emacs git repository and
stale .elc files are still left from the previous build.
It is recommended to remove .elc files from lisp/org directory and
re-compile.
In my case, none of these fixes resolved my issue but I discovered that there is a package cache stored in the ~/.emacs.d/elncache directory.
This 'elncache' directory stores natively compiled .eln files for Emacs packages with sub-directories for each Emacs version.
$ ls ~/.emacs.d/eln-cache/
30.2-6a8b22b2
31.0.50-be59b212
$ ls -1 ~/.emacs.d/eln-cache/31.0.50-be59b212/
autorevert-841d6890-e5e85ba9.eln
benchmark-0e5ff0c6-b45151e2.eln
blogmore-bd298bd5-140db3f8.eln
bookmark-8667481e-0391040a.eln
browse-url-87f72988-d18440ad.eln
<snip>
org-capture-31aeb3cb-5a0ab108.eln
org-compat-8f643782-38135399.eln
org-d208de9c-51cfc11b.eln
org-faces-fdfdb79f-6e1f5bdc.eln
org-footnote-a50a8027-86895802.eln
org-id-b4e96473-012fc1e0.eln
org-indent-91cb060a-1219f44c.eln
org-keys-d9945960-5b58cda5.eln
org-roam-56f7ff31-fcc8f708.eln
<snip>
You can either remove all files or remove individual packages.
$ rm -fr $HOME/.emacs.d/eln-cache
The eln cache is rebuilt on the next Emacs startup and this fix silences the irritating message on startup.
Non League football