Skip to content

Latest commit

Β 

History

603 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

An enhanced inline patch for GNU Emacs

../../actions/workflows/head-latest.yml/badge.svg

see https://qiita.com/takaxp/items/e07bb286d80fa9dd8e05 and https://qiita.com/takaxp/items/6a7f9b26eb1b1a8237a0

Note

Emacs 31.1 has been released. An updated inline patch (emacs-31.1-inline.patch) is now available, along with installer packages for Intel-based Mac and Apple Silicon Mac.

Supported features

  • avoid β€œM-x あ”
  • faces for composing text
  • non ja locale
  • directly change input source

Supported Emacs version

  • Emacs HEAD (emacs-head-inline.patch)
  • Emacs 31.1 (emacs-31.1-inline.patch)
  • Emacs 30.2, 30.1 (emacs-29.1-inline.patch)
  • Emacs 29.4, 29.3, 29.2, 29.1 (emacs-29.1-inline.patch)
  • Emacs 28.2, 28.1 (emacs-28.1-inline.patch)
  • Emacs 27.2, 27.1 (emacs-27.1-inline.patch)
  • Emacs 26.3, 26.2, 26.1 (emacs-25.2-inline.patch)
  • Emacs 25.3, 25.2 (emacs-25.2-inline.patch)

Integrated functions and hooks

  • M-x mac-build-info
  • M-x mac-ime-input-source-list
  • M-x mac-ime-activate
  • M-x mac-ime-deactivate
  • M-x mac-ime-toggle
  • mac-ime-before-put-text-hook
  • mac-ime-after-put-text-hook

How to use?

Add the following code to your init.el.

(when (and (memq window-system '(ns nil))
           (fboundp 'mac-get-current-input-source))
  (when (version< "27.0" emacs-version)
    ;; Required for some cases when auto detection is failed or the locale is "en".
    (custom-set-variables
     '(mac-default-input-source "com.google.inputmethod.Japanese.base")))
  (mac-input-method-mode 1))

Tip

You can find available input sources by M-x mac-ime-input-source-list. The available sources will be listed in the Message buffer.

Build scripts

For your convenience, some build scripts are provided. Before you run the script, please run setup.sh first.

git clone --depth=1 https://github.com/takaxp/ns-inline-patch.git
cd ns-inline-patch
sh ./build/setup.sh
sh ./build/emacs-31.sh -n

Important

Please provide -n option to enable NativeComp if needed.

Tip

Specifying CC may resolve your issue when you get an error on missing AppKit.h.

CC=/usr/bin/clang sh ./build/emacs-31.sh

If your environment for building Emacs is under PROXY, you can use emacs-mirror to get Emacs source codes. Please change the URL of the git repository specified in emacs-head.sh and emacs-31.sh if needed.

Pre-built distribution package

You can download my pre-built Emacs HEAD, 31.1, 30.2, 29.4, 28.2, 27.2 with ns-inline patch. Emacs.app will be installed under /Applications/Emacs-takaxp in your macOS. Please copy Emacs.app into /Applications if needed. The provided packages contain GnuTLS and jansson. Also TREE-SITTER is included in 29.4 or later packages.

All packages are signed and notarized with my Apple developer ID: H2PH8KNN3H.

Emacs 32.x !unstable!

Warning

These packages are built based on the latest development source code. So it may be unstable or broken.

  • Emacs 32.0.50 HEAD of Master branch with NativeComp

../../actions/workflows/nightly-arm64-nc.yml/badge.svg ../../actions/workflows/nightly-x86_64-nc.yml/badge.svg

VersionChipmacOSπŸ”—Datemd5
32.0.50AppleTahoe or laterπŸ“¦2026-09-057efc4ce2ea90e3c6be2fcd19f8b5c9a1
32.0.50AppleSequoia (15)πŸ“¦2026-09-057e0acf149143fb1b9717b5e68e1bbb9d
32.0.50AppleSonoma (14)πŸ“¦2026-09-05ec0c041c3f1cc8b62284645074cd361b
32.0.50IntelTahoe or laterπŸ“¦2026-09-052ba39a4b4095cacc4218fde852d0983d
32.0.50IntelSequoia (15)πŸ“¦2026-09-05f28083464e502b909a61798fa18b3c3a

Important

Please read Using NativeComp section if you have any troubles.

If you want to try the above HEAD package without enabling NativeComp, please check disable NativeComp section.

Emacs 31 (latest stable version)

  • Emacs 31.1 with NativeComp

../../actions/workflows/release-31-arm64-nc.yml/badge.svg ../../actions/workflows/release-31-x86_64-nc.yml/badge.svg

VersionChipmacOSπŸ”—Datemd5
31.1AppleTahoe or laterπŸ“¦2026-08-25689f182a359f61a6b05555c3970a73d6
31.1AppleSequoia (15)πŸ“¦2026-08-25f4459c8ea44228370ae51c29b403c546
31.1AppleSonoma (14)πŸ“¦2026-08-25c2addec864403ff4648e452a7519caed
31.1IntelTahoe or laterπŸ“¦2026-08-258dab305da1b6d588a4984ae0fab3c488
31.1IntelSequoia (15)πŸ“¦2026-08-25dbd9dd7f37127657317c80b74eef9895

Important

Please read Using NativeComp section if you have any troubles.

  • Emacs 31.1 without NativeComp

../../actions/workflows/release-31-arm64.yml/badge.svg ../../actions/workflows/release-31-x86_64.yml/badge.svg

VersionChipmacOSπŸ”—Datemd5
31.1AppleTahoe or laterπŸ“¦2026-08-2500ecb349a32842b51fcb10def584d9b7
31.1AppleSequoia (15)πŸ“¦2026-08-25ba30f72b68ff972da07047d48d033aed
31.1AppleSonoma (14)πŸ“¦2026-08-252bcfc372d4da8a905bbb82be949793c6
31.1IntelTahoe or laterπŸ“¦2026-08-25c9b7eba45770f32b29fdf1ad2ec883c2
31.1IntelSequoia (15)πŸ“¦2026-08-2547e266a745643b6cc6307b6a543a7b9a

Emacs 30

  • Emacs 30.2 with NativeComp

../../actions/workflows/release-30-arm64-nc.yml/badge.svg ../../actions/workflows/release-30-x86_64-nc.yml/badge.svg

VersionChipmacOSπŸ”—Datemd5
30.2AppleTahoe or laterπŸ“¦2026-08-25c345a2d4afe02431e6e39475ebfdb545
30.2AppleSequoia (15)πŸ“¦2026-08-25f4155cb1ea254e7dfc54ebf890761f04
30.2AppleSonoma (14)πŸ“¦2026-08-2518d94f2ea86a166687bf35b3cf419f0b
30.2IntelTahoe or laterπŸ“¦2026-08-25c7ee489e46708c69990add3c9cbf89cd
30.2IntelSequoia (15)πŸ“¦2026-08-2534da821ee79ec81dab406ddddce9ca5f

Important

Please read Using NativeComp section if you have any troubles.

  • Emacs 30.2 without NativeComp

../../actions/workflows/release-30-arm64.yml/badge.svg ../../actions/workflows/release-30-x86_64.yml/badge.svg

VersionChipmacOSπŸ”—Datemd5
30.2AppleTahoe or laterπŸ“¦2026-03-13ad5b507f695067829751b0b46e97e565
30.2AppleSequoia (15)πŸ“¦2026-03-137933203c044d489a26a80d7b6ebbbb1f
30.2AppleSonoma (14)πŸ“¦2026-03-135bbb7fa31b2903a1463853617313086f
30.2IntelTahoe or laterπŸ“¦2026-03-13a48c13e135b88c656e7fe73d36b5566d
30.2IntelSequoia (15)πŸ“¦2026-03-13295cc10126d11db4e1271191f93b5d30

Emacs 29

  • Emacs 29.4 with NativeComp

../../actions/workflows/release-29-arm64-nc.yml/badge.svg ../../actions/workflows/release-29-x86_64-nc.yml/badge.svg

VersionChipmacOSπŸ”—Datemd5
29.4AppleTahoe or laterπŸ“¦2026-08-25bf6a6cb8d79d51f2f80e962721be6431
29.4AppleSequoia (15)πŸ“¦2026-08-25e2442bb75edd3732cf110dfd5753e829
29.4AppleSonoma (14)πŸ“¦2026-08-2550ea74196883b70772140ba597c6ad11
29.4IntelTahoe or laterπŸ“¦2026-08-25e8721af5a84f406849310adbed2e7250
29.4IntelSequoia (15)πŸ“¦2026-08-25b48e3c7bdc6e2395811c0c726ef6c030

Important

Please read Using NativeComp section if you have any troubles.

  • Emacs 29.4 without NativeComp

../../actions/workflows/release-29-arm64.yml/badge.svg ../../actions/workflows/release-29-x86_64.yml/badge.svg

VersionChipmacOSπŸ”—Datemd5
29.4AppleTahoe or laterπŸ“¦2026-03-130cbe422978d5ec8706a36007cd179036
29.4AppleSequoia (15)πŸ“¦2026-03-13fd05d58389a2a1b7c55b074cc77c867e
29.4AppleSonoma (14)πŸ“¦2026-03-13f226ee11ed332d764fe3428a55cbe7ee
29.4IntelTahoe or laterπŸ“¦2026-03-13574a928f270a468f737217eb7fbb453d
29.4IntelSequoia (15)πŸ“¦2026-03-13627b58efb880090c283e0defdc742396

Emacs 28

  • Emacs 28.2 without NativeComp

../../actions/workflows/release-28-arm64.yml/badge.svg ../../actions/workflows/release-28-x86_64.yml/badge.svg

VersionChipmacOSπŸ”—Datemd5
28.2AppleTahoe or laterπŸ“¦2026-03-130f94d657345e05413c3e631c8c71cca9
28.2AppleSequoia (15)πŸ“¦2026-03-13cbc20c66b49e798baa4a52d345501c15
28.2AppleSonoma (14)πŸ“¦2026-03-13fda1c4883182bc4b217570e12124ac88
28.2IntelTahoe or laterπŸ“¦2026-03-13103e7a1f85038a643b9ea15efb2b0a70
28.2IntelSequoia (15)πŸ“¦2026-03-13786fd12f9616b6fdba1e6da0061618c2

Emacs 27

  • Emacs 27.2 without NativeComp

../../actions/workflows/release-27-arm64.yml/badge.svg ../../actions/workflows/release-27-x86_64.yml/badge.svg

VersionChipmacOSπŸ”—Datemd5
27.2AppleTahoe or laterπŸ“¦2026-03-13f145f239ee6ebfff137a5c1353247925
27.2AppleSequoia (15)πŸ“¦2026-03-13d4e03c78596485da0e4b1a746352c254
27.2AppleSonoma (14)πŸ“¦2026-03-138f6f81d47eb2123b2f7bf66351d0680c
27.2IntelTahoe or laterπŸ“¦2026-03-13ba2dcc3fc41740e95d4942c93bb4a1d2
27.2IntelSequoia (15)πŸ“¦2026-03-139a48ad3a12858be0939668b6a4c0b923

Using NativeComp

For Emacs 32.x, 31.1, 30.2, and 29.4 users, you can try to use an Emacs supporting NativeComp by downloading pkg from the links in above sections. Integrated lisp code are natively compiled so the pkg size is increased compared to that of the normal pkg file.

Currently, installing gcc by brew is required to compile additional lisp code by the installed Emacs. And adding the following configuration will be needed to your early-init.el or beginning of init.el when you face a warning like Warning (comp): libgccjit.so: error: error invoking gcc driver.

(setenv "LIBRARY_PATH"
        (string-join
         '("/opt/homebrew/opt/gcc/lib/gcc/15"
           "/opt/homebrew/opt/libgccjit/lib/gcc/16"
           "/opt/homebrew/opt/gcc/lib/gcc/16/gcc/aarch64-apple-darwin25/16")
         ":"))

Note

  • 16 specified in the above paths may have to be aligned to your environment.
  • For Intel mac user, please replace aarch64 with x86_64.
  • darwin25 may also be changed, check the output of M-x emacs-version, or run /opt/homebrew/bin/gcc-15 -dumpmachine.

If you use batch-native-compile or batch-byte+native-compile in a batch mode, setting for LIBRARY_PATH in your shell may be required as well.

export LIBRARY_PATH="/opt/homebrew/opt/gcc/lib/gcc/16:/opt/homebrew/opt/libgccjit/lib/gcc/16:/opt/homebrew/opt/gcc/lib/gcc/16/gcc/aarch64-apple-darwin25/16"
${EMACS} -Q --batch --eval="(setq native-comp-eln-load-path (list (expand-file-name \"eln-cache/\" user-emacs-directory)))" -f batch-byte+native-compile init.el

install gcc by HomeBrew

Just run the following two commands.

# setup grew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
# install gcc
brew install gcc

disable NativeComp

The following code will disable NativeComp module in each emacs session. So, no need to install GCC via Homebrew. Put the following code to early-init.el or beginning of init.el.

(setq native-comp-jit-compilation nil
      native-comp-enable-subr-trampolines nil)

Integrated dynamic libraries:

  • libgmp.10.dylib
  • libgnutls.30.dylib
  • libhogweed.7.dylib
  • libidn2.0.dylib
  • libintl.8.dylib
  • libnettle.9.dylib
  • libp11-kit.0.dylib
  • libtasn1.6.dylib
  • libtree-sitter.0.26.dylib
  • libunistring.5.dylib

Additionally for NativeComp:

  • libgccjit.0.dylib
  • libisl.23.dylib
  • libmpc.3.dylib
  • libmpfr.6.dylib
  • libzstd.1.dylib

The system-configuration-features is:

ACL GNUTLS LIBXML2 MODULES NOTIFY KQUEUE NS PDUMPER SQLITE3 THREADS TOOLKIT_SCROLL_BARS TREE_SITTER ZLIB, and NATIVE_COMP for some packages.

Enjoy!

About

An enhanced inline patch for GNU Emacs (nextstep)

Resources

Stars

55 stars

Watchers

3 watching

Forks

Releases

Sponsor this project

Packages

Used by

Contributors

Languages