Emacs Plus
About
Emacs+ is β GNU Emacs formulae for macOS β Homebrew package manager. It offers a wide rage of extra functionality over regular β Emacs package. Emacs+ intent is to give the most of βplusβ stuff by default, leaving only controversial options as opt-in. Please refer to β Options section for more information.
$ brew tap d12frosted/emacs-plus
$ brew install emacs-plus [options] # install the latest release (Emacs 28)
$ brew install emacs-plus@30 [options] # install Emacs 30 (master)
$ brew install emacs-plus@29 [options] # install Emacs 29 (emacs-29)
$ brew install emacs-plus@28 [options] # install Emacs 28
$ brew install emacs-plus@27 [options] # install Emacs 27
$ brew install emacs-plus@26 [options] # install Emacs 26
Feel free to open an issue or contact me via email if you face any issues, questions or feature requests. I love pull requests, so do send them. You might want to check β Development guidelines to have better understanding on how to contribute.
Table of Contents
- About
- Install
- Reinstall
- Emacs 30
- Emacs 29
- Emacs 28
- Emacs 27
- Emacs 26
- Features explained
- Icons
- Emacs configuration
- Known Issues
- Screenshots
- Acknowledgements
Install
Emacs Plus contains separate formulas for different Emacs versions:
emacs-plus
install current release version (Emacs 28);emacs-plus@30
install Emacs 30, development version.emacs-plus@29
install Emacs 29, pre-release version.emacs-plus@28
install Emacs 28, current release version.emacs-plus@27
install Emacs 27, previous release version;emacs-plus@26
install Emacs 26, previous release version;$ brew tap d12frosted/emacs-plus $ brew install emacs-plus [options] # install the latest release (Emacs 28) $ brew install emacs-plus@30 [options] # install Emacs 30 $ brew install emacs-plus@29 [options] # install Emacs 29 $ brew install emacs-plus@28 [options] # install Emacs 28 $ brew install emacs-plus@27 [options] # install Emacs 27 $ brew install emacs-plus@26 [options] # install Emacs 26
By default (without any addition options) this formula install Cocoa version of Emacs with support of gnutls
, imagemagick
(not included by default with emacs-plus@29
and emacs-plus@30
), librsvg
, libxml2
, dynamic modules and multicolor fonts. Please see the list of available options to disable any bit of default behaviour or add even more stuff.
Installing from feature branch
Sometimes you might want to install from a feature branch. In that case you can switch the branch in the tap and install Emacs+ again.
Prerequisites are:
- Emacs+ is tapped (e.g.
brew tap d12frosted/emacs-plus
). jq
is available (e.g.brew install jq
).
Open terminal and type the following commands (donβt forget to use correct Emacs+ version, branch and options):
$ brew uninstall emacs-plus@29
$ cd $(brew tap-info --json d12frosted/emacs-plus@29 | jq -r '.[0].path') && git switch BRANCH
$ brew install emacs-plus@29 [OPTIONS]
Reinstall
If you wish to reinstall emacs-plus
with you should not use reinstall
command of brew
(not related to this formula, itβs a general advice). Instead, you should uninstall
a package and then install
it with desired options.
Avoid reinstall
even if you want to reinstall
with the same set of options, otherwise you will likely to get compilation errors! For example, #218 and #321.
In short, brew
doesnβt really support options. They break time to time (brew#4793, brew#7397, brew#7498 to show a few).
$ brew uninstall emacs-plus
$ brew install emacs-plus [options]
Emacs 30
Included
By default emacs-plus@30
uses the following features.
- Injected
PATH
value from user shell (see separate section explaining this feature). - Cocoa version, e.g. builds
Emacs.app
. - Unconditional support for
gnutls
,librsvg
,libxml2
,little-cms2
and dynamic modules.
Options
Option | Description |
---|---|
--with-ctags | donβt remove the ctags executable that Emacs provides |
--with-dbus | build with dbus support |
--with-debug | build with debug symbols and debugger friendly optimizations |
--with-mailutils | build with mailutils support |
--with-no-frame-refocus | disables frame re-focus (ie. closing one frame does not refocus another one) |
--with-x11 | build with x11 support |
--with-xwidgets | build β with xwidgets support |
--without-cocoa | build a non-Cocoa version of Emacs (terminal only) |
--with-imagemagick | build with imagemagick support |
--with-native-comp | build with native compilation aka β gccemacs |
--with-poll | build with poll() instead of select() to enable more file descriptors |
No title bar
Please note, that --with-no-titlebar
is no longer needed in Emacs 30, since the same can be achieved natively using this method.
Emacs 29
Included
By default emacs-plus@29
uses the following features.
- Injected
PATH
value from user shell (see separate section explaining this feature). - Cocoa version, e.g. builds
Emacs.app
. - Unconditional support for
gnutls
,librsvg
,libxml2
,little-cms2
and dynamic modules.
Options
Option | Description |
---|---|
--with-ctags | donβt remove the ctags executable that Emacs provides |
--with-dbus | build with dbus support |
--with-debug | build with debug symbols and debugger friendly optimizations |
--with-mailutils | build with mailutils support |
--with-no-frame-refocus | disables frame re-focus (ie. closing one frame does not refocus another one) |
--with-x11 | build with x11 support |
--with-xwidgets | build β with xwidgets support |
--without-cocoa | build a non-Cocoa version of Emacs (terminal only) |
--with-imagemagick | build with imagemagick support |
--with-native-comp | build with native compilation aka β gccemacs |
--with-poll | build with poll() instead of select() to enable more file descriptors |
No title bar
Please note, that --with-no-titlebar
is no longer needed in Emacs 29, since the same can be achieved natively using this method.
Emacs 28
Included
By default emacs-plus@28
uses the following features.
- Injected
PATH
value from user shell (see separate section explaining this feature). - Cocoa version, e.g. builds
Emacs.app
. - Unconditional support for
gnutls
,librsvg
,libxml2
,little-cms2
and dynamic modules.
Options
Option | Description |
---|---|
--with-ctags | donβt remove the ctags executable that Emacs provides |
--with-dbus | build with dbus support |
--with-debug | build with debug symbols and debugger friendly optimizations |
--with-mailutils | build with mailutils support |
--with-no-frame-refocus | disables frame re-focus (ie. closing one frame does not refocus another one) |
--with-no-titlebar | build β without titlebar |
--with-no-titlebar-and-round-corners | build β without titlebar, but round corners instead of square |
--with-x11 | build with x11 support |
--with-xwidgets | build β with xwidgets support |
--without-cocoa | build a non-Cocoa version of Emacs (terminal only) |
--with-imagemagick | build with imagemagick support |
--HEAD | build from emacs-28 branch |
--with-native-comp | build with native compilation aka β gccemacs |
Emacs 27
Included
By default emacs-plus@27
uses the following features.
- Cocoa version, e.g. builds
Emacs.app
. - Unconditional support for
gnutls
,librsvg
,libxml2
,little-cms2
and dynamic modules.
Options
Option | Description |
---|---|
--with-ctags | donβt remove the ctags executable that Emacs provides |
--with-dbus | build with dbus support |
--with-debug | build with debug symbols and debugger friendly optimizations |
--with-mailutils | build with mailutils support |
--with-no-frame-refocus | disables frame re-focus (ie. closing one frame does not refocus another one) |
--with-no-titlebar | build β without titlebar |
--with-x11 | build with x11 support |
--with-xwidgets | build β with xwidgets support |
--without-cocoa | build a non-Cocoa version of Emacs (terminal only) |
--without-imagemagick | build without imagemagick support |
--HEAD | build from emacs-27 branch |
Emacs 26
Emacs 26 comes without any available options due to β #195.
Features explained
Injected PATH
Ever find that a command works in your shell, but not in Emacs?
(c) @purcell
In macOS applications are started in the login environment, meaning that all user defined environment variables are not available in application process. In the most cases itβs not a big deal, but in Emacs it becomes a source of troubles as we want to use binaries from the non-standard locations (for example, those installed via package managers).
There is a wonderful solution to overcome this problem, purcell/exec-path-from-shell. As with any package that is not preinstalled with Emacs, you need to discover it first, and then install it. And while being a well known package and popular package (top 100 on MELPA), not everyone install it. In addition, with native-comp
feature you might need itβs functionality before any package is bootstrapped.
All that being said, during installation Emacs+ injects value of PATH
into Emacs.app/Contents/Info.plist
file, making this value available whenever you start Emacs.app
from Finder, Docker, Spotlight, open
command in Terminal or via launchd
. This solves a wide range of problems for GUI users without the need to use purcell/exec-path-from-shell, but if needed you can still fall back to this wonderful package, especially if you need other variables.
In case you have a non-trivial setup relying on specific value of PATH
inherited from current terminal session, it is advised to start Emacs using /opt/homebrew/bin/emacs
instead of open -n -a /path/to/Emacs.app
, because open
messes around with PATH
value even without Emacs+ injection. You can find more information in #469.
And if for some reason PATH injection doesnβt work for you, report it either in #469 or open a new issue.
No Titlebar
square corners | round corners |
---|---|
Emacs 28 and Emacs 27
This patch is enabled with the --with-no-titlebar
option for emacs-plus@27
and emacs-plus@28
. It is meant for use with window tiling applications like β yabai, β chunkwm or β amethyst so that the titlebar wonβt take up screen real estate.
Use --with-no-titlebar-and-round-corners
option (instead of --with-no-titlebar
), if you want to keep round corners (for example, to be consistent with other macOS applications).
If you see gaps between your emacs frames and other windows, try this:
(setq frame-resize-pixelwise t)
Emacs 29 and Emacs 30
In emacs-plus@29
and emacs-plus@30
this option is not available anymore as you can achieve the same result using Emacs Lisp by adding the following line in your early-init.el
file:
(add-to-list 'default-frame-alist '(undecorated . t))
Add the following line instead for round corners:
(add-to-list 'default-frame-alist '(undecorated-round . t))
Xwidgets (webkit)
Browse the web in Emacs as in modern browser.
The original β Emacs xwidgets builds and works on macOS however must be used with X11 and hence not practical option on macOS. This version enables xwidgets
on native macOS Cocoa via embedding a native webkit window.
More details can be seen here β Veshbooβs emacs branch.
System appearance change
This patch is enabled by default and canβt be disabled. It adds a hook, ns-system-appearance-change-functions
, that is called once the system appearance is changed. Functions added to this hook will be called with one argument, a symbol that is either light
or dark
. This mainly allows loading a different theme to better match the system appearance.
(defun my/apply-theme (appearance)
"Load theme, taking current system APPEARANCE into consideration."
(mapc #'disable-theme custom-enabled-themes)
(pcase appearance
('light (load-theme 'tango t))
('dark (load-theme 'tango-dark t))))
(add-hook 'ns-system-appearance-change-functions #'my/apply-theme)
Note that this hook is also run once when Emacs is initialized, so simply adding the above to your init.el
will allow matching the system appearance upon startup. You can also determine what the current system appearance is by inspecting the value of the ns-system-appearance
variable.
The hook is NOT run in TTY Emacs sessions.
gccemacs
gccemacs is a modified Emacs capable of compiling and running Emacs Lisp as native code in form of re-loadable elf files. As the name suggests this is achieved blending together Emacs and the gcc infrastructure.
While gccemacs
gives performance boost in many scenarios, this feature is still experimental and might require time and effort from your side for it to work! Use at our own risk :)
Please see official β gccemacs documentation for more information.
Knows issues:
ld: library not found for -lSystem
. This only happens on older versions ofgcc
installed by Homebrew. Please execute$ brew reinstall gcc libgccjit
to resolve this issue.- Errors during compilation of your
init.el
. Try running Emacs with-Q
option and give it some time to compile everything (maybe runM-x
to force compilation) - you shall see buffer*Async-native-compile-log*
in the list of buffers.
Icons
Option | Author | Image | URL |
---|---|---|---|
--with-EmacsIcon1-icon | β Jason Milkins | β Link | |
--with-EmacsIcon2-icon | β Jason Milkins | β Link | |
--with-EmacsIcon3-icon | β Jason Milkins | β Link | |
--with-EmacsIcon4-icon | β Jason Milkins | β Link | |
--with-EmacsIcon5-icon | β Jason Milkins | β Link | |
--with-EmacsIcon6-icon | β Jason Milkins | β Link | |
--with-EmacsIcon7-icon | β Jason Milkins | β Link | |
--with-EmacsIcon8-icon | β Jason Milkins | β Link | |
--with-EmacsIcon9-icon | β Jason Milkins | β Link | |
--with-cacodemon-icon | β Christian Westrom | β Link | |
--with-dragon-icon | β Will B Chang | β Link | |
--with-elrumo1-icon | β Elias | β Link | |
--with-elrumo2-icon | β Elias | β Link | |
--with-emacs-card-blue-deep-icon | β Jason Milkins | β Link | |
--with-emacs-card-british-racing-green-icon | β Jason Milkins | β Link | |
--with-emacs-card-carmine-icon | β Jason Milkins | β Link | |
--with-emacs-card-green-icon | β Jason Milkins | β Link | |
--with-gnu-head-icon | β AurΓ©lio A. Heckert | β Link | |
--with-memeplex-slim-icon | β memeplex | β Link | |
--with-memeplex-wide-icon | β memeplex | β Link | |
--with-modern-alecive-flatwoken-icon | β Alessandro Roncone | β Link | |
--with-modern-asingh4242-icon | β Asingh4242 | β Link | |
--with-modern-azhilin-icon | Andrew Zhilin | β Link | |
--with-modern-bananxan-icon | β BananXan | β Link | |
--with-modern-black-dragon-icon | β Osike | β Link | |
--with-modern-black-gnu-head-icon | β Aha-Soft | β Link | |
--with-modern-black-variant-icon | β BlackVariant | β Link | |
--with-modern-bokehlicia-captiva-icon | β Bokehlicia | β Link | |
--with-modern-cg433n-icon | β cg433n | β Link | |
--with-modern-doom-icon | β Eccentric J | β Link | |
--with-modern-doom3-icon | β Eccentric J | β Link | |
--with-modern-icon | Unknown | Unknown | |
--with-modern-mzaplotnik-icon | β Matjaz Zaplotnik | β Link | |
--with-modern-nuvola-icon | β David Vignoni | β Link | |
--with-modern-orange-icon | β Omar Jair Purata Funes | β Link | |
--with-modern-paper-icon | β Sam Hewitt | β Link | |
--with-modern-papirus-icon | β Papirus Development Team | β Link | |
--with-modern-pen-3d-icon | Unknown | β Link | |
--with-modern-pen-black-icon | β Cayetano Santos | β Link | |
--with-modern-pen-icon | β Kentaro Ohkouchi | β Link | |
--with-modern-pen-lds56-icon | β lds56 | β Link | |
--with-modern-purple-flat-icon | β Jeremiah Foster | β Link | |
--with-modern-sexy-v1-icon | β Emacs is Sexy | β Link | |
--with-modern-sexy-v2-icon | β Emacs is Sexy | β Link | |
--with-modern-sjrmanning-icon | β sjrmannings | β Link | |
--with-modern-vscode-icon | β Valentin Degenne | β Link | |
--with-modern-yellow-icon | Unknown | β Link | |
--with-nobu417-big-sur-icon | β Nobuyuki Sato | β Link | |
--with-retro-emacs-logo-icon | β Luis Fernandes | β Link | |
--with-retro-gnu-meditate-levitate-icon | Nevrax Design Team | β Link | |
--with-retro-sink-bw-icon | Unknown | β Link | |
--with-retro-sink-icon | β Erik Mugele | β Link | |
--with-spacemacs-icon | β Nasser Alshammari | β Link | |
--with-savchenkovaleriy-big-sur-icon | β Valeriy Savchenko | β Link |
Emacs configuration
Emacs is a journey. And for some of you these projects might be inspiring.
Known Issues
Please checkout β Issues page for a list of all known issues. But here are several you should be aware of.
emacs
dependency in other formulas
In some cases (like when installing cask
) regular emacs
package will be required. In such cases you might want to install all dependencies manually (except for emacs
) and then install desired package with --ignore-dependencies
option.
$ brew install cask --ignore-dependencies
Screenshots
Acknowledgements
Many thanks to all β contributors, issue reporters and bottle providers (β Sudarshan Wadkar, β Jon Hermansen).
Special thanks to patrons supporting existence of this project: