Homebrew 软件包管理器的 GNU Emacs 公式
#+begin_html
Emacs Head
#+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:
** 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
If you wish to install the latest commit of the emacs-26 branch then:
#+begin_src bash brew tap daviderestivo/emacs-head brew install --HEAD emacs-head@26 --with-cocoa #+end_src
*** GNU Emacs 27 #+begin_src bash brew tap daviderestivo/emacs-head brew install emacs-head@27 --with-cocoa #+end_src
If you wish to install the latest commit of the emacs-27 branch then:
#+begin_src bash brew tap daviderestivo/emacs-head brew install --HEAD emacs-head@27 --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 latest commit of the emacs-28 branch then:
#+begin_src bash brew tap daviderestivo/emacs-head brew install --HEAD emacs-head@28 --with-cocoa #+end_src
*** GNU Emacs 29 #+begin_src bash brew tap daviderestivo/emacs-head brew install emacs-head@29 --with-cocoa #+end_src
If you wish to install the latest commit of the emacs-29 branch then:
#+begin_src bash brew tap daviderestivo/emacs-head brew install --HEAD emacs-head@29 --with-cocoa #+end_src
*** GNU Emacs 30 #+begin_src bash brew tap daviderestivo/emacs-head brew install emacs-head@30 --with-cocoa #+end_src
If you wish to install the latest commit of the emacs-30 branch then:
#+begin_src bash brew tap daviderestivo/emacs-head brew install --HEAD emacs-head --with-cocoa #+end_src
*** GNU Emacs 31 (default) #+begin_src bash brew tap daviderestivo/emacs-head brew install emacs-head --with-cocoa #+end_src
*** GNU Emacs 32 #+begin_src bash brew tap daviderestivo/emacs-head brew install emacs-head@32 --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 (not available on emcas-head >=31) |
| --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). Not required in emacs-head >=30 |
| --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 (not available on emacs-head@26 and emacs-head@27) |
| --with-native-full-aot | Enable elisp ahead-of-time native compilation support (not available on emacs-head@26 and emacs-head@27) |
| --with-tree-sitter | Enable Tree-sitter support (only on emacs-head >=29) |
| --with-mps | Use the Memory Pool System garbage collection library (only on emacs-head@32) |
For the terminal version only of GNU Emacs please omit --with-cocoa.
By default:
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 supports 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 supports 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:
Additional useful links:
** MPS garbage collector Note: MPS is only supported on emacs-head@32
This formula supports the MPS garbage collector which theoretically can improve performance. It is a stable system that has been in use for years. However, in emacs this is an experimental feature.
More details about MPS can be found in the below links:
** Available icons
| Option | Description | Image | macOS 26+ Ready (*) | URL |
|----------------------------------------------------+----------------------------------------------------------+-----------------------------------------------------------------+---------------------+------|
| --with-modern-icon | Use a modern style icon by Unknown | [[/icons/previews/modern-icon.png]] | No | - |
| --with-modern-icon-sjrmanning | Use a modern style icon by [[https://github.com/sjrmanning][Sjrmannings]] | [[/icons/previews/modern-icon-sjrmanning.png]] | No | [[https://github.com/sjrmanning/emacs-icon][Link]] |
| --with-modern-icon-asingh4242 | Use a modern style icon by [[https://imgur.com/user/asingh4242][Asingh4242]] | [[/icons/previews/modern-icon-asingh4242.png]] | No | [[https://imgur.com/YGxjLZw][Link]] |
| --with-modern-icon-paper-icons | Use a modern style icon by [[https://github.com/snwh][Sam Hewitt]] | [[/icons/previews/modern-icon-paper-icons.png]] | No | [[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/previews/modern-icon-azhilin.png]] | No | [[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/previews/modern-icon-mzaplotnik.png]] | No | [[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]
暂无开放 Issues,或尚未同步最近议题。