Commit a0df4900 authored by Lars Ingebrigtsen's avatar Lars Ingebrigtsen
Browse files

Fix when calling prettify-symbols-mode more than once

* lisp/progmodes/prog-mode.el (prettify-symbols-mode): Allow
calling this mode several times without the earlier symbol alist
shadowing the newer (bug#23255).
parent 0c5f436d
Pipeline #2634 passed with stage
in 53 minutes and 6 seconds
......@@ -211,6 +211,9 @@ You can enable this mode locally in desired buffers, or use
`global-prettify-symbols-mode' to enable it for all modes that
support it."
:init-value nil
(when prettify-symbols--keywords
(font-lock-remove-keywords nil prettify-symbols--keywords)
(setq prettify-symbols--keywords nil))
(if prettify-symbols-mode
;; Turn on
(when (setq prettify-symbols--keywords (prettify-symbols--make-keywords))
......@@ -226,9 +229,6 @@ support it."
(font-lock-flush))
;; Turn off
(remove-hook 'post-command-hook #'prettify-symbols--post-command-hook t)
(when prettify-symbols--keywords
(font-lock-remove-keywords nil prettify-symbols--keywords)
(setq prettify-symbols--keywords nil))
(when (memq 'composition font-lock-extra-managed-props)
(setq font-lock-extra-managed-props (delq 'composition
font-lock-extra-managed-props))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment