fix(ligatures): activate prettify-symbols-mode conditionally

With +extra enabled, this module would activate `prettify-symbols-mode`
in any buffer where `prettify-symbols-alist` is non-nil, whether or not
`+ligatures-extra-alist` has an entry for the current major mode (or a
parent thereof). This behavior is poor UX, since the user may be
expecting that a empty entry for some `X-mode` in
`+ligatures-extra-alist` should mean *no` prettify-symbols-mode` at all
in `X-mode`.

With this, `+ligatures-extra-alist` is now the authority. An empty entry
for `X-mode` will result in `prettify-symbols-mode` *not* being
activated there. If that entry *isn't* empty, it will be combined only
with the global default value of `prettify-symbols-alist`, not any
pre-existing buffer-local value, to make the end result deterministic,
because some modes have their own defaults for it (like
`lisp-prettify-symbols-alist`, `js--prettify-symbols-alist`, and
`rust-prettify-symbols-alist`).

Fix: #7440
This commit is contained in:
Henrik Lissner 2024-09-12 23:18:08 -04:00
parent 59de0ec15e
commit c07f359d64
No known key found for this signature in database
GPG key ID: B60957CA074D39A3
2 changed files with 18 additions and 21 deletions

View file

@ -42,9 +42,6 @@
(setq rustic-indent-method-chain t)
;; Conflicts with (and is redundant with) :ui ligatures
(setq rust-prettify-symbols-alist nil)
;; Leave automatic reformatting to the :editor format module.
(setq rustic-babel-format-src-block nil
rustic-format-trigger nil)