ligature.el
ligature.el copied to clipboard
Comment on macOS usage in README.rst
The README file says
Your Emacs must be built with Harfbuzz enabled -- this is the default as of Emacs 27.1, but obscure platforms may not support it; You can check by typing C-h v system-configuration-features. Search for the word HARFBUZZ.
but that doesn't seem to apply on the Mac, where Emacs's configure script happily refuses to use HarfBuzz, libotf or libxft, and ignores the use of –with-harfbuzz
and –with-cairo
, but ligatures seem to work fine (built from master; currently released Emacs locks up with a screaming fit). Presumably Emacs is just using macOS's native font library.
(It might be possible to make Emacs build as an X application rather than using the macOS window manager, and in that case you might be able to use Cairo, HarfBuzz, and friends, but I'm happy with the Mac version on my Mac.)
Hm. I'm not a Mac person, so I can't explain why it works. Can you create a PR that amends the README to include the part about Macs?
As for the hanging: that is unfortunately an issue with Emacs 27.1 and the upcoming 27.2 that is only resolved in master.
In Emacs 30 from homebrew + d12frosted/emacs-plus on macOS, I did this to activate ligatures (Assuming the font Iosevka which is great!)
-
package-install
ligatures - Grab the correct config for Iosevka from the wiki
- Add the config to your init.el or equivalent, since I installed via package-install I removed the line
:load-path "path-to-ligature-repo"
(use-package ligature
:ensure t
:config
;; Enable all Iosevka ligatures in programming modes
(ligature-set-ligatures 'prog-mode '("<---" "<--" "<<-" "<-" "->" "-->" "--->" "<->" "<-->" "<--->" "<---->" "<!--"
"<==" "<===" "<=" "=>" "=>>" "==>" "===>" ">=" "<=>" "<==>" "<===>" "<====>" "<!---"
"<~~" "<~" "~>" "~~>" "::" ":::" "==" "!=" "===" "!=="
":=" ":-" ":+" "<*" "<*>" "*>" "<|" "<|>" "|>" "+:" "-:" "=:" "<******>" "++" "+++"))
;; Enables ligature checks globally in all buffers. You can also do it
;; per mode with `ligature-mode'.
(global-ligature-mode t))
- Restart Emacs
My system-configuration-features
value is:
"ACL GIF GLIB GMP GNUTLS IMAGEMAGICK JPEG JSON
LCMS2 LIBXML2 MODULES NATIVE_COMP NOTIFY KQUEUE
NS PDUMPER PNG RSVG SQLITE3 THREADS TIFF
TOOLKIT_SCROLL_BARS TREE_SITTER WEBP XIM ZLIB"
The above emacs-lisp looks like:
I can submit a PR if you'd like. Least I can do after your wonderful book and site :)
Improvements to MacOS install instructions are welcome!
Cool, I'll test in 28 and 29 too, then submit a PR. Expect it probably towards the end of this week or this weekend.
No rush! Thanks for your help.