ns-inline-patch icon indicating copy to clipboard operation
ns-inline-patch copied to clipboard

An enhanced inline patch for GNU Emacs (nextstep)

#+title: An enhanced inline patch for GNU Emacs

[[https://github.com/takaxp/ns-inline-patch/actions?query=workflow%3A%22Build+NS+with+inline-patch+%28HEAD%29%22][https://github.com/takaxp/ns-inline-patch/workflows/Build%20NS%20with%20inline-patch%20(HEAD)/badge.svg]] [[https://github.com/takaxp/ns-inline-patch/actions?query=workflow%3A%22Build+NS+with+inline-patch+%28emacs-29%29%22][https://github.com/takaxp/ns-inline-patch/workflows/Build%20NS%20with%20inline-patch%20(emacs-29)/badge.svg]] [[https://github.com/takaxp/ns-inline-patch/actions?query=workflow%3A%22Build+NS+with+inline-patch+%28emacs-28%29%22][https://github.com/takaxp/ns-inline-patch/workflows/Build%20NS%20with%20inline-patch%20(emacs-28)/badge.svg]] [[https://github.com/takaxp/ns-inline-patch/actions?query=workflow%3A%22Build+NS+with+inline-patch+%28emacs-27%29%22][https://github.com/takaxp/ns-inline-patch/workflows/Build%20NS%20with%20inline-patch%20(emacs-27)/badge.svg]] [[https://github.com/takaxp/ns-inline-patch/actions?query=workflow%3A%22Build+NS+with+inline-patch+%28emacs-26%29%22][https://github.com/takaxp/ns-inline-patch/workflows/Build%20NS%20with%20inline-patch%20(emacs-26)/badge.svg]]

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

Note: Version 29.3 has been released. The inline patch (emacs-29.1-inline.patch) is applicable to Emacs 29.3. Installer packages for Intel-based Mac and Apple Silicon Mac are also available. You may install them in macOS Catalina or later.

** 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 29.1, 29.2, 29.3 (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

  • M-x mac-build-info

Note: This function is not valid in pre-built packages described in later section.

** How to use?

Add the following code to your init.el.

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

** Build scripts

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

#+begin_src sh sh ./build/setup.sh sh ./build/emacs-29.sh #+end_src

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-29.sh= if needed.

** Pre-built distribution package :PROPERTIES: :ID: 3A8A27A7-93D9-4F4E-A621-042FC4521D14 :END:

You can download my pre-built Emacs 26.3, 27.1, 27.2, 28.1, 28.2, 29.1, 29.2, =29.3= and HEAD with ns-inline patch. =Emacs.app= will be installed under =/Applications/Emacs-takaxp= in your macOS. The pkg contains =GnuTLS= and =jansson=. These packages are signed and notarized with my Apple developer ID: =H2PH8KNN3H=.

*** Emacs 30x (with inline patch) !unstable! :PROPERTIES: :ID: 9B7E9F4F-E5C7-4A09-A06B-7E1E58ADBDB9 :END:

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

#+caption: HEAD(master) | Chip | Version | Download | macOS | md5 | |-------+---------+------------------+---------+----------------------------------| | Apple | 30.0.50 | [[https://pxaka.tokyo/emacs/pkg/emacs-head_apple.pkg][⬇pkg]] (25MAY2024) | Sonoma | [[https://pxaka.tokyo/emacs/pkg/emacs-head_apple.md5][ca429a16808a7072e4fa37c010010bee]] | | Intel | 30.0.50 | [[https://pxaka.tokyo/emacs/pkg/emacs-head_intel.pkg][⬇pkg]] (25MAY2024) | Ventura | [[https://pxaka.tokyo/emacs/pkg/emacs-head_intel.md5][75077b4a9d4639e07bc6fc44f2796f72]] |

You can also try to use an Emacs supporting =NativeComp= by downloading pkg from the following links. 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.

#+caption: HEAD(master) build with Native Comp | Chip | Version | Download | macOS | md5 | |-------+---------+----------------------+---------+----------------------------------| | Apple | 30.0.50 | [[https://pxaka.tokyo/emacs/pkg/emacs-head_apple_nc.pkg][⬇pkg(NC)]] (01JUN2024) | Sonoma | [[https://pxaka.tokyo/emacs/pkg/emacs-head_apple_nc.md5][382fd7a8debd8834150fd792d501a781]] | | Intel | 30.0.50 | [[https://pxaka.tokyo/emacs/pkg/emacs-head_intel_nc.pkg][⬇pkg(NC)]] (01JUN2024) | Ventura | [[https://pxaka.tokyo/emacs/pkg/emacs-head_intel_nc.md5][78842809129c219955443bab600af815]] |

#+begin_src emacs-lisp (setenv "LIBRARY_PATH" (string-join '("/opt/homebrew/opt/gcc/lib/gcc/13" "/opt/homebrew/opt/libgccjit/lib/gcc/13" "/opt/homebrew/opt/gcc/lib/gcc/13/gcc/aarch64-apple-darwin23/13") ":")) #+end_src

**** install gcc by grew

#+begin_src sh

setup grew

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

install gcc

brew install gcc #+end_src

*** Emacs 29 (with inline patch) :PROPERTIES: :ID: 439F2090-DF77-4228-AAE1-54B97AD67C3E :END:

Note: Before installing the pre-built package, please remove previous Emacs.app from the installed directory if you have installed Emacs 29x. If the previously installed Emacs.app is not removed, the installation may fail.

| Chip | Version | Download | macOS | [MB] | md5 | |-------+---------+-------------------+---------+------+----------------------------------| | Apple | 29.3 | [[https://pxaka.tokyo/emacs/pkg/emacs-29.3_apple.pkg][⬇pkg]] (2024-03-26) | Sonoma | 59.3 | [[https://pxaka.tokyo/emacs/pkg/emacs-29.3_apple.md5][00e6c45e8ca4701a2c14c68fcee3ac63]] | | Intel | 29.3 | [[https://pxaka.tokyo/emacs/pkg/emacs-29.3_intel.pkg][⬇pkg]] (2024-03-26) | Ventura | 59.7 | [[https://pxaka.tokyo/emacs/pkg/emacs-29.3_intel.md5][309c842fa1b4f9be822e2fb20433716b]] | |-------+---------+-------------------+---------+------+----------------------------------| | Apple | 29.2 | [[https://pxaka.tokyo/emacs/pkg/emacs-29.2_apple.pkg][⬇pkg]] (2024-01-21) | Sonoma | 59.6 | [[https://pxaka.tokyo/emacs/pkg/emacs-29.2_apple.md5][45db9d15059eec40a32a6570aae79200]] | | Intel | 29.2 | [[https://pxaka.tokyo/emacs/pkg/emacs-29.2_intel.pkg][⬇pkg]] (2024-01-21) | Sonoma | 59.7 | [[https://pxaka.tokyo/emacs/pkg/emacs-29.2_intel.md5][8b7bbe04fe87b586bc6848eb588bb005]] | |-------+---------+-------------------+---------+------+----------------------------------| | Apple | 29.1 | [[https://pxaka.tokyo/emacs/pkg/emacs-29.1_apple.pkg][⬇pkg]] (2023-08-05) | Ventura | 59.5 | [[https://pxaka.tokyo/emacs/pkg/emacs-29.1_apple.md5][d90aef769e18390247aa715bef781677]] | | Intel | 29.1 | [[https://pxaka.tokyo/emacs/pkg/emacs-29.1_intel.pkg][⬇pkg]] (2023-08-05) | Ventura | 59.6 | [[https://pxaka.tokyo/emacs/pkg/emacs-29.1_intel.md5][c47cf4e373d97e6ccbbe0775aa007a2c]] |

Note - Not tested in previous versions, but it probably be installed.

*** Emacs 28 (with inline patch)

Note: Before installing the pre-built package, please remove previous Emacs.app from the installed directory if you have installed Emacs 28x. If the previously installed Emacs.app is not removed, the installation may fail.

| Chip | Version | Download | macOS | [MB] | md5 | |-------+---------+-------------------+-------------------+------+----------------------------------| | Apple | 28.2 | [[https://pxaka.tokyo/emacs/pkg/emacs-28.2_apple.pkg][⬇pkg]] (2022-09-13) | Big Sur[*1] | 55.1 | [[https://pxaka.tokyo/emacs/pkg/emacs-28.2_apple.md5][ea4f7556fbbd971af50b1671e1daf586]] | | Intel | 28.2 | [[https://pxaka.tokyo/emacs/pkg/emacs-28.2_intel.pkg][⬇pkg]] (2022-09-13) | Monterey | 55.5 | [[https://pxaka.tokyo/emacs/pkg/emacs-28.2_intel.md5][8e7ed5945fcdb2c8cad2e663e96c569b]] | |-------+---------+-------------------+-------------------+------+----------------------------------| | Apple | 28.1 | [[https://pxaka.tokyo/emacs/pkg/emacs-28.1_apple.pkg][⬇pkg]] (2022-05-09) | Big Sur[*1] | 55.0 | [[https://pxaka.tokyo/emacs/pkg/emacs-28.1_apple.md5][29589057e1911dfec50b7a6c8fae890f]] | | Intel | 28.1 | [[https://pxaka.tokyo/emacs/pkg/emacs-28.1_intel.pkg][⬇pkg]] (2022-05-09) | Big Sur, Monterey | 55.4 | [[https://pxaka.tokyo/emacs/pkg/emacs-28.1_intel.md5][a2823a3e929bcf90e67b144dd1db220d]] |

[*1] Not tested in Monterey but it probably be installed.

*** Emacs 27 (with inline patch) | Chip | Version | Download | macOS | [MB] | md5 | |-------+---------+------------------+-------------------+------+----------------------------------| | Apple | 27.2 | [[https://pxaka.tokyo/emacs/pkg/emacs-27.2_apple.pkg][⬇pkg]] (2022-05-09) | Big Sur[*1] | 51.4 | [[https://pxaka.tokyo/emacs/pkg/emacs-27.2_apple.md5][52fda7e597430ae86997555317ff11b2]] | | Intel | 27.2 | [[https://pxaka.tokyo/emacs/pkg/emacs-27.2_intel.pkg][⬇pkg]] (2022-05-09) | Big Sur, Monterey | 51.8 | [[https://pxaka.tokyo/emacs/pkg/emacs-27.2_intel.md5][58f315e392a9fa893d3260eaf7424fe1]] | | Intel | 27.1 | [[https://pxaka.tokyo/emacs/pkg/emacs-27.1.pkg][⬇pkg]] | Catalina | 51.3 | 0c7048d147dea6fcdda638a25b161af8 |

[*1] Not tested in Monterey but it probably be installed.

(previous built) | Chip | Version | Download | macOS | [MB] | md5 | |-------+---------+-----------+---------+------+----------------------------------| | Apple | 27.2 | [[https://pxaka.tokyo/emacs/pkg/previous/emacs-27.2_apple.pkg][⬇pkg]] (old) | Big Sur | 51.2 | 2cc963b00c0d41c038941ebb35e18446 | | Intel | 27.2 | [[https://pxaka.tokyo/emacs/pkg/previous/emacs-27.2_intel.pkg][⬇pkg]] (old) | [*2] | 51.8 | 74e06cb24c8898a261d5778892355d3a |

[*2] Mojave / Catalina / Big Sur

*** Emacs 26 (with inline patch) | Chip | Version | Download | macOS | [MB] | md5 | |-------+---------+----------+----------+------+----------------------------------| | Intel | 26.3 | [[https://pxaka.tokyo/emacs/pkg/emacs-26.3.pkg][⬇pkg]] | Catalina | 52.9 | 1868c787177f515f18f500ce6b898b05 |

*** without inline (pure) :PROPERTIES: :ID: A7862584-8CBB-434B-86D1-8990D6D47C0D :END:

Additionally, the following package is "WITHOUT" inline-patch NS build. In this case, =Emacs.app= will be installed under =/Applications/Emacs-takaxp/pure=.

#+caption: pure | Chip | Version | Download | macOS | [MB] | md5 | |-------+---------+------------------------+-------------------+------+----------------------------------| | Apple | 29.3 | [[https://pxaka.tokyo/emacs/pkg/emacs-29.3_apple_pure.pkg][⬇pure.pkg]] (2024-03-26) | Sonoma[*1] | 59.2 | [[https://pxaka.tokyo/emacs/pkg/emacs-29.3_apple_pure.md5][f526b3d89d192e3ecfb927deb3fd057a]] | | Intel | 29.3 | [[https://pxaka.tokyo/emacs/pkg/emacs-29.3_intel_pure.pkg][⬇pure.pkg]] (2024-03-26) | Ventura[*1] | 59.7 | [[https://pxaka.tokyo/emacs/pkg/emacs-29.3_intel_pure.md5][af8d8ef6881ff7f548afd7caa1e266bf]] | |-------+---------+------------------------+-------------------+------+----------------------------------| | Apple | 29.2 | [[https://pxaka.tokyo/emacs/pkg/emacs-29.2_apple_pure.pkg][⬇pure.pkg]] (2024-01-21) | Sonoma[*1] | 59.5 | [[https://pxaka.tokyo/emacs/pkg/emacs-29.2_apple_pure.md5][7eaeabb13aaf141203929fd9641c4189]] | | Intel | 29.2 | [[https://pxaka.tokyo/emacs/pkg/emacs-29.2_intel_pure.pkg][⬇pure.pkg]] (2024-01-21) | Sonoma[*1] | 59.7 | [[https://pxaka.tokyo/emacs/pkg/emacs-29.2_intel_pure.md5][709c2b95efe9a8fd5e45f916eaf54b00]] | |-------+---------+------------------------+-------------------+------+----------------------------------| | Apple | 29.1 | [[https://pxaka.tokyo/emacs/pkg/emacs-29.1_apple_pure.pkg][⬇pure.pkg]] (2023-08-05) | Ventura[*1] | 59.5 | [[https://pxaka.tokyo/emacs/pkg/emacs-29.1_apple_pure.md5][65ce179a76b34f529db93885b053c823]] | | Intel | 29.1 | [[https://pxaka.tokyo/emacs/pkg/emacs-29.1_intel_pure.pkg][⬇pure.pkg]] (2023-08-05) | Ventura[*1] | 59.6 | [[https://pxaka.tokyo/emacs/pkg/emacs-29.1_intel_pure.md5][7a6ee9639c673be6292d65dcdc681b27]] | |-------+---------+------------------------+-------------------+------+----------------------------------| | Apple | 28.2 | [[https://pxaka.tokyo/emacs/pkg/emacs-28.2_apple_pure.pkg][⬇pure.pkg]] (2022-09-13) | Big Sur[*1] | 55.1 | [[https://pxaka.tokyo/emacs/pkg/emacs-28.2_apple_pure.md5][de3d302f63bbc0d03a5b9c5b64d9f916]] | | Intel | 28.2 | [[https://pxaka.tokyo/emacs/pkg/emacs-28.2_intel_pure.pkg][⬇pure.pkg]] (2022-09-13) | Big Sur, Monterey | 55.5 | [[https://pxaka.tokyo/emacs/pkg/emacs-28.2_intel_pure.md5][b4475438d04c7b7601e61d18104bb0aa]] | |-------+---------+------------------------+-------------------+------+----------------------------------| | Apple | 28.1 | [[https://pxaka.tokyo/emacs/pkg/emacs-28.1_apple_pure.pkg][⬇pure.pkg]] (2022-05-09) | Big Sur[*1] | 55.0 | [[https://pxaka.tokyo/emacs/pkg/emacs-28.1_apple_pure.md5][e7fa6185f55d0578a236e35ee1dd0f12]] | | Intel | 28.1 | [[https://pxaka.tokyo/emacs/pkg/emacs-28.1_intel_pure.pkg][⬇pure.pkg]] (2022-05-09) | Big Sur, Monterey | 55.4 | [[https://pxaka.tokyo/emacs/pkg/emacs-28.1_intel_pure.md5][1f20caee450e46fb1afca50ffc6dfb22]] | |-------+---------+------------------------+-------------------+------+----------------------------------| | Apple | 27.2 | [[https://pxaka.tokyo/emacs/pkg/emacs-27.2_apple_pure.pkg][⬇pure.pkg]] | Big Sur | 51.2 | [[https://pxaka.tokyo/emacs/pkg/emacs-27.2_apple_pure.md5][64583b05ebf4d9aa89e8812af980b06f]] | | Intel | 27.2 | [[https://pxaka.tokyo/emacs/pkg/emacs-27.2_intel_pure.pkg][⬇pure.pkg]] | [*2] | 51.7 | [[https://pxaka.tokyo/emacs/pkg/emacs-27.2_intel_pure.md5][165fed95067d5b4b6d885bfacd1ff9fa]] | | Intel | 27.1 | [[https://pxaka.tokyo/emacs/pkg/emacs-27.1_pure.pkg][⬇pure.pkg]] | Catalina | 51.3 | [[https://pxaka.tokyo/emacs/pkg/emacs-27.1_pure.md5][fdd14baf87ed4f903b5b02c4e1dd022c]] |

[*1] Not tested in previous versions, but it probably be installed. [*2] Mojave / Catalina / Big Sur

*** Integrated dynamic libraries:

  • libffi.7.dylib (or libffi.8.dylib), libffi is NOT contained in HEAD pkg.
  • libgmp.10.dylib
  • libgnutls.30.dylib
  • libhogweed.6.dylib
  • libidn2.0.dylib
  • libintl.8.dylib
  • libjansson.4.dylib
  • libnettle.8.dylib
  • libp11-kit.0.dylib
  • libtasn1.6.dylib
  • libunistring.5.dylib

The =system-configuration-features= is:

=NOTIFY KQUEUE ACL GNUTLS LIBXML2 ZLIB TOOLKIT_SCROLL_BARS NS MODULES THREADS JSON PDUMPER=

Enjoy!