The patches (referred to below) were created by @lawlist from select portions of the Aquamacs:
https://github.com/davidswelt/aquamacs-emacs
To enable native spellchecking on OSX in the vanilla/generic version of Emacs, it is necessary to patch the C-source-code prior building, and a few lisp files also need to be modified. The patch is too big to post in an answer on stackexchange.com.
The following procedure assumes the necessary tools have already been installed on OSX to build and patch, etc. -- e.g., git, recent versions of automake
and autoconf
, xcode, etc.
EMACS-25 BRANCH -- NOVEMBER 1, 2016:
The following patch and minimal testing was performed on the emacs-25 branch built --with-ns
as of commit dated November 1, 2016: 5043e0a7e06dbf6507a59736e55bdde69d9a2a4e
From a terminal, type: git clone -b emacs-25 git://git.sv.gnu.org/emacs.git
Visit: https://gist.github.com/lawlist/dfc75240cc06c66f19f48eaa3e570d7c
Click the "Download ZIP" button, and save the zipped patch file somewhere on your computer.
Extract the ZIP archive you just downloaded and save nsspellchecker_emacs25.diff
to the .../emacs
root source-code directory that was cloned in the first step above.
From a terminal, cd
over to the root .../emacs
source-code directory.
;; The patch may become outdated, so this example includes a hard reset to go back to November 1, 2016. [Certain bug fixes are still being made to Emacs 25 by the development team, which may cause the patch to become outdated.]
From a terminal, type: git reset --hard 5043e0a7e06dbf6507a59736e55bdde69d9a2a4e
;; After performing a hard reset successfully, the message in the terminal will say: "HEAD is now at 5043e0a Fix documentation for 'eudc-options-file'"
From a terminal, type: git apply nsspellchecker_emacs25.diff
From a terminal, type: ./autogen.sh
From a terminal, type: ./configure --with-ns
From a terminal, type: make
From a terminal, type: make install
;; With Finder.app, navigate over to .../emacs/nextstep
and try out your new Emacs.app
;; Open your new Emacs.app and type M-x eval-expression RET (require 'flyspell) RET
;; In a *scratch*
buffer, type something spelled correctly and something spelled wrong.
;; Type: M-x ns-start-spellchecker
or M-x ispell-buffer
;; Play a little with the pop-up spellchecker and have fun.
;; Custom words are saved to: ~/Library/Spelling/LocalDictionary
Previous answer that applies to the master
branch as of May 29, 2016:
The following patch and minimal testing was performed on master branch built --with-ns
as of commit dated May 29, 2016: 76fb19b359dec8556dc66dbac3ad3d333feea3c3
From a terminal, type: git clone -b master git://git.sv.gnu.org/emacs.git
Visit: https://gist.github.com/lawlist/6a9b281870fcc114ad3c6c1dca121f95
Click the "Download ZIP" button, and save the zipped patch file somewhere on your computer.
Extract the ZIP archive you just downloaded and save nsspellchecker.diff
to the .../emacs
root source-code directory that was cloned in the first step above.
From a terminal, cd
over to the root .../emacs
source-code directory.
;; The patch will soon become outdated, so this example includes a hard reset to go back to May 29, 2016. [I will not be updating/maintaining the patch as Emacs master branch changes several times each day.]
From a terminal, type: git reset --hard 76fb19b359dec8556dc66dbac3ad3d333feea3c3
;; After performing a hard reset successfully, the message in the terminal will say: "HEAD is now at 76fb19b * lisp/wid-edit.el (link): Remove :follow-link property (bug#22434)"
From a terminal, type: git apply nsspellchecker.diff