ligature.el icon indicating copy to clipboard operation
ligature.el copied to clipboard

Comment on macOS usage in README.rst

Open cmconnelly opened this issue 3 years ago • 5 comments

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.)

cmconnelly avatar Mar 04 '21 00:03 cmconnelly

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.

mickeynp avatar Mar 04 '21 21:03 mickeynp

In Emacs 30 from homebrew + d12frosted/emacs-plus on macOS, I did this to activate ligatures (Assuming the font Iosevka which is great!)

  1. package-install ligatures
  2. Grab the correct config for Iosevka from the wiki
  3. 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))
  1. 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:

image

I can submit a PR if you'd like. Least I can do after your wonderful book and site :)

aclarknexient avatar Dec 04 '23 20:12 aclarknexient

Improvements to MacOS install instructions are welcome!

mickeynp avatar Dec 05 '23 09:12 mickeynp

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.

aclarknexient avatar Dec 05 '23 13:12 aclarknexient

No rush! Thanks for your help.

mickeynp avatar Dec 06 '23 13:12 mickeynp