emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master a0df490 2/2: Fix when calling prettify-symbols-mode


From: Lars Ingebrigtsen
Subject: [Emacs-diffs] master a0df490 2/2: Fix when calling prettify-symbols-mode more than once
Date: Sun, 28 Jul 2019 16:14:44 -0400 (EDT)

branch: master
commit a0df4900552c49f1bfc2f94176089875c41307a6
Author: Lars Ingebrigtsen <address@hidden>
Commit: Lars Ingebrigtsen <address@hidden>

    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).
---
 lisp/progmodes/prog-mode.el | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/lisp/progmodes/prog-mode.el b/lisp/progmodes/prog-mode.el
index 2b05735..79fe56a 100644
--- a/lisp/progmodes/prog-mode.el
+++ b/lisp/progmodes/prog-mode.el
@@ -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))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]