homebrew-emacs-head icon indicating copy to clipboard operation
homebrew-emacs-head copied to clipboard

GNU Emacs formula for the Homebrew package manager

#+begin_html

Banner

Emacs Head

GNU General Public License Version 3.0

Emacs 26 CI Status Badge Emacs 27 CI Status Badge Emacs 28 CI Status Badge Emacs 29 CI Status Badge

#+end_html

Emacs Head is an Homebrew Formula based on the original Homebrew Emacs [[https://github.com/Homebrew/homebrew-core/blob/master/Formula/emacs.rb][one]].

This formula currently supports:

  • GNU Emacs 26.3
  • GNU Emacs 27.2 (or HEAD)
  • GNU Emacs 28.1 (or HEAD)
  • GNU Emacs HEAD (currently 29.0.50)

** Installation You can install this formula using:

*** GNU Emacs 26 #+begin_src bash brew tap daviderestivo/emacs-head brew install emacs-head@26 --with-cocoa #+end_src

*** GNU Emacs 27 #+begin_src bash brew tap daviderestivo/emacs-head brew install emacs-head --with-cocoa #+end_src

If you wish to install the HEAD version of GNU Emacs 27 please do:

#+begin_src bash brew tap daviderestivo/emacs-head brew install --HEAD emacs-head --with-cocoa #+end_src

*** GNU Emacs 28 #+begin_src bash brew tap daviderestivo/emacs-head brew install emacs-head@28 --with-cocoa #+end_src

If you wish to install the HEAD version of GNU Emacs 28 please do:

#+begin_src bash brew tap daviderestivo/emacs-head brew install --HEAD emacs-head@28 --with-cocoa #+end_src

*** GNU Emacs 29 (HEAD) #+begin_src bash brew tap daviderestivo/emacs-head brew install emacs-head@29 --with-cocoa #+end_src

** Screenshots *** GNU Emacs running in terminal mode (28.x) [[/images/emacs-head-terminal.png]]

*** GNU Emacs running in GUI mode (28.x) GUI Theme: [[https://github.com/jonathanchu/atom-one-dark-theme][atom-one-dark-theme]]

Modeline Theme: [[https://github.com/daviderestivo/smart-mode-line-atom-one-dark-theme][smart-mode-line-atom-one-dark-theme]]

[[/images/emacs-head-cocoa.png]]

** Compilation options The following compilation options are available:

| Option | Description | |-------------------------+-------------------------------------------------------------------------------------------------| | ~--with-crash-debug~ | Append -g3 to CFLAGS to enable crash debugging | | ~--with-cocoa~ | Build a Cocoa version of GNU Emacs | | ~--with-ctags~ | Don't remove the ctags executable that GNU Emacs provides | | ~--with-dbus~ | Build with dbus support | | ~--without-gnutls~ | Disable gnutls support | | ~--with-imagemagick~ | Build with imagemagick support | | ~--without-librsvg~ | Disable librsvg support | | ~--with-mailutils~ | Build with mailutils support | | ~--with-multicolor-fonts~ | Enable multicolor fonts support on macOS (only on emacs-head@26) | | ~--without-modules~ | Disable dynamic modules support | | ~--with-no-frame-refocus~ | Disables frame re-focus (ie. closing one frame does not refocus another one) | | ~--without-libxml2~ | Disable libxml2 support | | ~--with-pdumper~ | Enable pdumper support (not available on emacs-head@26) | | ~--with-xwidgets~ | Enable xwidgets support (not available on emacs-head@26) | | ~--with-native-comp~ | Enable Elisp native compilation support (only on emacs-head@28 and emacs-head@29) | | ~--with-native-full-aot~ | Enable Elisp Ahead-of-Time native compilation support (only on emacs-head@28 and emacs-head@29) |

For the terminal version only of GNU Emacs please omit ~--with-cocoa~.

By default:

  • gnutls
  • librsvg
  • libxml2
  • dynamic modules

are enabled. If you want to disable them please use the above ~--without-*~ options.

** System appearance change support 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 [[https://support.apple.com/en-gb/guide/mac-help/mchl52e1c2d2/mac][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.

#+begin_src elisp (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) #+end_src

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.

** Pdumper support Note: portable dumper is not supported on emacs-head@26, and won't work with Native-comp support.

To enable this feature please use ~--with-pdumper~.

For a pdumper configuration example, you could take inspiration from [[https://github.com/daviderestivo/galactic-emacs][Galactic Emacs]]: [[https://github.com/daviderestivo/galactic-emacs/blob/master/conf/pdumper-init.el][pdumper-init.el]] and [[https://github.com/daviderestivo/galactic-emacs/blob/master/conf/pdumper-config.el][pdumper-config.el]] configuration files.

** Xwidgets support Note: xwidgets feature is not supported on emacs-head@26.

This formula support native macOS X Cocoa Xwidgets via embedding a native webkit window. To enable this feature please use ~--with-xwidgets~.

** Native-comp support Note: native-comp feature is not supported on emacs-head@26 and emacs-head@27.

This formula support native Elisp code compilation. In order to enable it please follow the below instructions:

#+begin_src bash brew install emacs-head@28 --with-cocoa --with-native-comp #+end_src

~NATIVE_FULL_AOT~ is disabled by default to improve build time. Only few lisp source files will be compiled during the build, all of the remaining ones will be dynamically compiled in the background once the Emacs application is launched for the first time. If you wish to enable native full AoT, please use ~--with-native-full-aot~ option together with ~--with-native-comp~.

More details about native Elisp code compilation can be found in the below links:

  • [[https://european-lisp-symposium.org/static/2020/corallo-nassi-manca-slides.pdf][Bringing GNU Emacs to Native Code (Slides)]]
  • [[https://www.youtube.com/watch?v=zKHYZOAc_bQ&app=desktop][Bringing GNU Emacs to Native Code (YouTube Video)]]
  • [[http://akrl.sdf.org/gccemacs.html][gccemacs]]

Additional useful links:

  • [[https://gist.github.com/AllenDang/f019593e65572a8e0aefc96058a2d23e][Use pre-built gccemacs]]
  • [[https://github.com/jimeh/build-emacs-for-macos][build-emacs-for-macos]]
  • [[https://github.com/shshkn/emacs.d/blob/master/docs/nativecomp.md][gccemacs]]
  • [[https://gist.github.com/mikroskeem/0a5c909c1880408adf732ceba6d3f9ab][gccemacs on OS X]]

** Available icons | Option | Description | Image | URL | |----------------------------------------------------+-----------------------------------------------------+--------------------------------------------------------+------| | ~--with-modern-icon-sjrmanning~ | Use a modern style icon by [[https://github.com/sjrmanning][Sjrmannings]] | [[/icons/modern-icon-sjrmanning.png]] | [[https://github.com/sjrmanning/emacs-icon][Link]] | | ~--with-modern-icon-asingh4242~ | Use a modern style icon by [[https://imgur.com/user/asingh4242][Asingh4242]] | [[/icons/modern-icon-asingh4242.png]] | [[https://imgur.com/YGxjLZw][Link]] | | ~--with-modern-icon-paper-icons~ | Use a modern style icon by [[https://github.com/snwh][Sam Hewitt]] | [[/icons/modern-icon-paper-icons.png]] | [[https://github.com/snwh/paper-icon-theme/blob/master/Paper/512x512/apps/emacs.png][Link]] | | ~--with-modern-icon-azhilin~ | Use a modern style icon by Andrew Zhilin | [[/icons/modern-icon-azhilin.png]] | [[https://commons.wikimedia.org/wiki/File:Emacs-icon-48x48.png][Link]] | | ~--with-modern-icon-mzaplotnik~ | Use a modern style icon by [[https://commons.wikimedia.org/wiki/User:MZaplotnik][Matjaz Zaplotnik]] | [[/icons/modern-icon-mzaplotnik.png]] | [[https://commons.wikimedia.org/wiki/File:Emacs-icon-48x48.svg][Link]] | | ~--with-modern-icon-bananxan~ | Use a modern style icon by [[https://www.deviantart.com/bananxan][BananXan]] | [[/icons/modern-icon-bananxan.png]] | [[https://www.deviantart.com/bananxan/art/Emacs-icon-207744728][Link]] | | ~--with-modern-icon-vscode~ | Use a modern style icon by [[https://github.com/vdegenne][Valentin Degenne]] | [[/icons/modern-icon-vscode.png]] | [[https://github.com/VSCodeEmacs/Emacs][Link]] | | ~--with-modern-icon-sexy-v1~ | Use a modern style icon by [[https://emacs.sexy][Emacs is Sexy]] | [[/icons/modern-icon-sexy-v1.png]] | [[https://emacs.sexy][Link]] | | ~--with-modern-icon-sexy-v2~ | Use a modern style icon by [[https://emacs.sexy][Emacs is Sexy]] | [[/icons/modern-icon-sexy-v2.png]] | [[https://emacs.sexy][Link]] | | ~--with-modern-icon-cg433n~ | Use a modern style icon by [[https://github.com/cg433n][Cg433n]] | [[/icons/modern-icon-cg433n.png]] | [[https://github.com/cg433n/emacs-mac-icon][Link]] | | ~--with-modern-icon-purple~ | Use a modern style icon by [[https://github.com/NicolasPetton][Nicolas Petton]] | [[/icons/modern-icon-purple.png]] | [[https://git.savannah.gnu.org/cgit/emacs.git/tree/etc/images/icons][Link]] | | ~--with-modern-icon-yellow~ | Use a modern style icon by Unknown | [[/icons/modern-icon-yellow.png]] | [[http://getdrawings.com/emacs-icon#emacs-icon-75.png][Link]] | | ~--with-modern-icon-orange~ | Use a modern style icon by [[https://github.com/VentGrey][Omar Jair Purata Funes]] | [[/icons/modern-icon-orange.png]] | [[https://github.com/PapirusDevelopmentTeam/papirus-icon-theme/issues/1742][Link]] | | ~--with-modern-icon-papirus~ | Use a modern style icon by [[https://github.com/PapirusDevelopmentTeam][Papirus Development Team]] | [[/icons/modern-icon-papirus.png]] | [[https://github.com/PapirusDevelopmentTeam/papirus-icon-theme][Link]] | | ~--with-modern-icon-pen~ | Use a modern style icon by [[https://github.com/nanasess][Kentaro Ohkouchi]] | [[/icons/modern-icon-pen.png]] | [[https://github.com/nanasess/EmacsIconCollections][Link]] | | ~--with-modern-icon-pen-3d~ | Use a modern style icon by Unknown | [[/icons/modern-icon-pen-3d.png]] | [[https://download-mirror.savannah.gnu.org/releases/emacs/icons][Link]] | | ~--with-modern-icon-pen-lds56~ | Use a modern style icon by [[http://lds56.github.io/about][lds56]] | [[/icons/modern-icon-pen-lds56.png]] | [[http://lds56.github.io/notes/emacs-icon-redesigned][Link]] | | ~--with-modern-icon-pen-black~ | Use a modern style icon by [[https://gitlab.com/csantosb][Cayetano Santos]] | [[/icons/modern-icon-pen-black.png]] | [[https://gitlab.com/uploads/-/system/project/avatar/11430322/emacs_icon_132408.png][Link]] | | ~--with-modern-icon-black-variant~ | Use a modern style icon by [[https://www.deviantart.com/blackvariant/about][BlackVariant (Patrick)]] | [[/icons/modern-icon-black-variant.png]] | [[https://www.deviantart.com/blackvariant][Link]] | | ~--with-modern-icon-purple-flat~ | Use a modern style icon by [[https://jeremiahfoster.com][Jeremiah Foster]] | [[/icons/modern-icon-purple-flat.png]] | [[https://icon-icons.com/icon/emacs/103962][Link]] | | ~--with-modern-icon-spacemacs~ | Use a modern style icon by [[https://github.com/nashamri][Nasser Alshammari]] | [[/icons/modern-icon-spacemacs.png]] | [[https://github.com/nashamri/spacemacs-logo][Link]] | | ~--with-modern-icon-alecive-flatwoken~ | Use a modern style icon by [[https://www.iconarchive.com/artist/alecive.html][Alessandro Roncone]] | [[/icons/modern-icon-alecive-flatwoken.png]] | [[https://www.iconarchive.com/show/flatwoken-icons-by-alecive.html][Link]] | | ~--with-modern-icon-elrumo1~ | Use a modern style icon by [[https://github.com/elrumo][Elias Ruiz Monserrat]] | [[/icons/modern-icon-elrumo1.png]] | [[https://github.com/d12frosted/homebrew-emacs-plus/issues/303#issuecomment-763928162][Link]] | | ~--with-modern-icon-elrumo2~ | Use a modern style icon by [[https://github.com/elrumo][Elias Ruiz Monserrat]] | [[/icons/modern-icon-elrumo2.png]] | [[https://github.com/d12frosted/homebrew-emacs-plus/issues/303#issuecomment-763928162][Link]] | | ~--with-modern-icon-bokehlicia-captiva~ | Use a modern style icon by [[https://www.deviantart.com/bokehlicia][Bokehlicia]] | [[/icons/modern-icon-bokehlicia-captiva.png]] | [[https://www.iconarchive.com/show/captiva-icons-by-bokehlicia/emacs-icon.html][Link]] | | ~--with-modern-icon-nuvola~ | Use a modern style icon by [[https://en.wikipedia.org/wiki/David_Vignoni][David Vignoni]] | [[/icons/modern-icon-nuvola.png]] | [[https://commons.wikimedia.org/wiki/File:Nuvola_apps_emacs_vector.svg][Link]] | | ~--with-modern-icon-black-gnu-head~ | Use a modern style icon by [[http://www.aha-soft.com][Aha-Soft]] | [[/icons/modern-icon-black-gnu-head.png]] | [[https://www.iconfinder.com/iconsets/flat-round-system][Link]] | | ~--with-modern-icon-dragon~ | Use a modern style icon by [[https://github.com/willbchang][Will B Chang]] | [[/icons/modern-icon-dragon.png]] | [[https://github.com/willbchang/emacs-dragon-icon][Link]] | | ~--with-modern-icon-black-dragon~ | Use a modern style icon by [[https://emacs-china.org/u/XYang][XYang]] and [[https://emacs-china.org/u/kongds][kongds]] | [[/icons/modern-icon-black-dragon.png]] | [[https://emacs-china.org/t/li-xinyang-logo/143/12][Link]] | | ~--with-modern-icon-emacs-icon1~ | Use a modern style icon by [[https://github.com/emacsfodder][Jasonm23]] | [[/icons/modern-icon-EmacsIcon1.png]] | [[https://github.com/emacsfodder/emacs-icons-project][Link]] | | ~--with-modern-icon-emacs-icon2~ | Use a modern style icon by [[https://github.com/emacsfodder][Jasonm23]] | [[/icons/modern-icon-EmacsIcon2.png]] | [[https://github.com/emacsfodder/emacs-icons-project][Link]] | | ~--with-modern-icon-emacs-icon3~ | Use a modern style icon by [[https://github.com/emacsfodder][Jasonm23]] | [[/icons/modern-icon-EmacsIcon3.png]] | [[https://github.com/emacsfodder/emacs-icons-project][Link]] | | ~--with-modern-icon-emacs-icon4~ | Use a modern style icon by [[https://github.com/emacsfodder][Jasonm23]] | [[/icons/modern-icon-EmacsIcon4.png]] | [[https://github.com/emacsfodder/emacs-icons-project][Link]] | | ~--with-modern-icon-emacs-icon5~ | Use a modern style icon by [[https://github.com/emacsfodder][Jasonm23]] | [[/icons/modern-icon-EmacsIcon5.png]] | [[https://github.com/emacsfodder/emacs-icons-project][Link]] | | ~--with-modern-icon-emacs-icon6~ | Use a modern style icon by [[https://github.com/emacsfodder][Jasonm23]] | [[/icons/modern-icon-EmacsIcon6.png]] | [[https://github.com/emacsfodder/emacs-icons-project][Link]] | | ~--with-modern-icon-emacs-icon7~ | Use a modern style icon by [[https://github.com/emacsfodder][Jasonm23]] | [[/icons/modern-icon-EmacsIcon7.png]] | [[https://github.com/emacsfodder/emacs-icons-project][Link]] | | ~--with-modern-icon-emacs-icon8~ | Use a modern style icon by [[https://github.com/emacsfodder][Jasonm23]] | [[/icons/modern-icon-EmacsIcon8.png]] | [[https://github.com/emacsfodder/emacs-icons-project][Link]] | | ~--with-modern-icon-emacs-icon9~ | Use a modern style icon by [[https://github.com/emacsfodder][Jasonm23]] | [[/icons/modern-icon-EmacsIcon9.png]] | [[https://github.com/emacsfodder/emacs-icons-project][Link]] | | ~--with-modern-icon-emacs-card-blue-deep~ | Use a modern style icon by [[https://github.com/emacsfodder][Jasonm23]] | [[/icons/modern-icon-emacs-card-blue-deep.png]] | [[https://github.com/emacsfodder/emacs-icons-project][Link]] | | ~--with-modern-icon-emacs-card-british-racing-green~ | Use a modern style icon by [[https://github.com/emacsfodder][Jasonm23]] | [[/icons/modern-icon-emacs-card-british-racing-green.png]] | [[https://github.com/emacsfodder/emacs-icons-project][Link]] | | ~--with-modern-icon-emacs-card-carmine~ | Use a modern style icon by [[https://github.com/emacsfodder][Jasonm23]] | [[/icons/modern-icon-emacs-card-carmine.png]] | [[https://github.com/emacsfodder/emacs-icons-project][Link]] | | ~--with-modern-icon-emacs-card-green~ | Use a modern style icon by [[https://github.com/emacsfodder][Jasonm23]] | [[/icons/modern-icon-emacs-card-green.png]] | [[https://github.com/emacsfodder/emacs-icons-project][Link]] | | ~--with-modern-icon-doom~ | Use a modern style icon by [[http://eccentric-j.com/][Eccentric J]] | [[/icons/modern-icon-doom.png]] | [[https://github.com/eccentric-j/doom-icon][Link]] | | ~--with-modern-icon-doom3~ | Use a modern style icon by [[http://eccentric-j.com/][Eccentric J]] | [[/icons/modern-icon-doom3.png]] | [[https://github.com/eccentric-j/doom-icon][Link]] | | ~--with-modern-icon-doom-cacodemon~ | Use a modern style icon by [[https://gitlab.com/wildwestrom][Christian Westrom]] | [[/icons/modern-icon-doom-cacodemon.png]] | [[https://gitlab.com/wildwestrom/emacs-doom-icon][Link]] | | ~--with-retro-icon-emacs-logo~ | Use a retro style icon by [[https://www.ee.ryerson.ca/~elf/][Luis Fernandes]] | [[/icons/retro-icon-emacs-logo.png]] | [[https://en.m.wikipedia.org/wiki/File:Emacs-logo.svg][Link]] | | ~--with-retro-icon-gnu-head~ | Use a retro style icon by [[https://github.com/aurium][Aurélio A. Heckert]] | [[/icons/retro-icon-gnu-head.png]] | [[https://www.gnu.org/graphics/heckert_gnu.html][Link]] | | ~--with-retro-icon-gnu-meditate-levitate~ | Use a retro style icon by Nevrax Design Team | [[/icons/retro-icon-gnu-meditate-levitate.png]] | [[https://www.gnu.org/graphics/meditate.en.html][Link]] | | ~--with-retro-icon-sink-bw~ | Use a retro style icon by Unknown | [[/icons/retro-icon-sink-bw.png]] | [[https://www.teuton.org/~ejm/emacsicon/][Link]] | | ~--with-retro-icon-sink~ | Use a retro style icon by [[https://www.teuton.org/~ejm/][Erik Mugele]] | [[/icons/retro-icon-sink.png]] | [[https://www.teuton.org/~ejm/emacsicon/][Link]] |

** Why yet another Homebrew GNU Emacs formula? Since the option ~--with-cocoa~ is not available anymore in the latest GNU Emacs homebrew-core formula (see [[https://github.com/Homebrew/homebrew-core/pull/36070][pull request]]), I decided to build my own formula.

** About the logo #+begin_quote 'Kitchen Sink' OS Announced

Coding has begun on a new operating system code named 'Kitchen Sink'. The new OS will be based entirely on GNU Emacs. One programmer explained, "Since many hackers spend a vast amount of their time in Emacs, why not just make it the operating system?" When asked about the name, he responded, "Well, it has been often said that Emacs has everything except a kitchen sink. Now it will." --- James Baughn

(https://web.archive.org/web/20180814225320/http://humorix.org/10016) #+end_quote

** Collaborating If you are interested in collaborating please open a [[https://github.com/daviderestivo/homebrew-emacs-head/compare][Pull Request]].