mickeynp / ligature.el

Display typographical ligatures in Emacs
GNU General Public License v3.0
379 stars 28 forks source link

Comment on macOS usage in README.rst #29

Open cmconnelly opened 3 years ago

cmconnelly commented 3 years ago

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

mickeynp commented 3 years ago

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.

aclarknexient commented 7 months ago

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

mickeynp commented 7 months ago

Improvements to MacOS install instructions are welcome!

aclarknexient commented 7 months ago

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.

mickeynp commented 7 months ago

No rush! Thanks for your help.