I'm pretty new to emacs and giving it a shot because it seems to be much better integrated with the OCaml tool chain than any other editor.
Since OCaml uses a lot of symbols, I want to enable ligature support.
If it's relevant, I'm using spacemacs. Here's what I've added to my
(load "~/.emacs.d/private/local/pragmatapro-prettify-symbols-v0.828.el") (add-hook 'tuareg-mode-hook #'prettify-hook) (global-prettify-symbols-mode t)
.el file I'm using is available here for reference and defines
The strange thing is that after opening a
.ml file in Tuareg mode, I can see that prettify-symbols-mode is active, but none of the symbols are converted to ligatures. However, if I toggle prettify-symbols-mode off and then back on, the symbols render correctly.
Has anyone else had this issue or have any ideas how I can get it to work automatically upon opening a the file?
So, interestingly enough, after looking again it seems like some sort of symbol replacement is happening, but it isn't happening with the correct glyphs or for all of the patterns defined in the .el file. For example <= is replaced with a reasonable, but incorrect glyph; |> is not replaced at all. After toggling the mode I end up with the correct replacement glyphs.
See the answers section for the solution I came up with.