If you are reading this on GitHub, please be advised that the project is now hosted on GitLab. The GitHub repository is just a mirror setup for continuity purposes.
Emacs Modified for macOS
Emacs Modified for macOS is a distribution of GNU Emacs bundled with a few select packages for LaTeX users and R developers, most notably AUCTeX and ESS. The distribution is based on the latest stable release of GNU Emacs compiled by David Caldwell.
Other than the additions mentioned above and some minor configuration, this is a stock distribution of Emacs. Users of Emacs on other platforms will appreciate the similar look and feel of the application.
The official project page provides detailed information on the distribution and links to the binary release.
The repository contains a few distribution-specific files and a
Makefile to fetch the other components and combine everything into a
disk image. The complete source code of Emacs and the extensions is
not hosted here.
Building the distribution on macOS requires
git and a number of standard Unix command line tools. Many of these
utilities do not come bundled with the operating system. One first
needs to install Xcode from the App Store and, second, to install the
Command Line Developer Tools by launching from the Terminal the
$ xcode-select --install
Building the distribution
Makeconf file to set the version numbers of GNU Emacs, the
distribution and the various extensions (more on this below). Then
make all will launch the following three main steps:
get-packageswill fetch the binary release of GNU Emacs from Emacs for Mac OS X; the official releases of ESS, AUCTeX and org;
psvn.elfrom their respective GitHub or Subversion repositories; the snapshot of the master branch of Polymode.
emacswill, in summary, decompress the Emacs for Mac OS X disk image in a temporary directory, add all the extensions into the application tree and build a new signed application bundle.
releasewill upload the disk image to GitLab, create a release with the a link to the disk image in the release notes, and update the project's web page with the correct version numbers and hyperlinks.
Each of the above three steps is split into smaller recipes, around 20
in total. See the
Makefile for details.
Publishing on GitLab
Uploading files and publishing a release on GitLab from the command
line involves using the
GitLab API. The
interested reader may have a look at the
recipes in the
Makefile to see how we achieved complete automation
of the process, including the extraction of the release notes from the
Version numbers of the extensions
The most manual part of the build process has always been to get the version numbers of the latest releases for all the bundled extensions. Here's how I managed to make my life easier using Git Submodules.
In a separate directory, I created a purely local Git repository named
$ git init emacs-modified-extensions
In this repository I added the following submodules:
$ git submodule add https://github.com/emacs-ess/ESS/ $ git submodule add http://git.savannah.gnu.org/r/auctex.git $ git submodule add http://orgmode.org/org-mode.git/ $ git submodule add https://github.com/vspinu/polymode $ git submodule add https://github.com/jrblevin/markdown-mode $ git submodule add https://github.com/purcell/exec-path-from-shell
Finally, I created a
Makefile with the following content to fetch
the version numbers of the latest releases of each of the above
submodules (except Polymode, where the date of the latest snapshop of
the master branch is used). The script also extracts the latest
revision number of
psvn.el in the Subversion source code repository.
all : git submodule foreach 'git submodule update' if [ -f versions.txt ]; then rm versions.txt; fi touch versions.txt echo ESSVERSION=$(shell git -C ESS describe --tags | cut -d - -f 1 | tr -d v) \ >> versions.txt echo AUCTEXVERSION=$(shell git -C auctex describe --tags | cut -d - -f 1 | cut -d _ -f 2-3 | tr _ .) \ >> versions.txt echo ORGVERSION=$(shell git -C org-mode describe --tags | cut -d - -f 1 | cut -d _ -f 2) \ >> versions.txt echo POLYMODEVERSION=$(shell git -C polymode show -s --format="%ci" HEAD | cut -d " " -f 1) \ >> versions.txt echo MARKDOWNLOADVERSION=$(shell git -C markdown-mode describe --tags | cut -d - -f 1 | tr -d v) \ >> versions.txt echo EXECPATHVERSION=$(shell git -C exec-path-from-shell describe --tags | cut -d - -f 1) \ >> versions.txt echo PSVNVERSION=$(shell svn log -q -l 1 http://svn.apache.org/repos/asf/subversion/trunk/contrib/client-side/emacs/psvn.el \ | grep ^r | cut -d " " -f 1 | tr -d r) \ >> versions.txt
make in this directory yields a file
containing the variable initialization strings to use in this
This is actually simpler than using