unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#34764: prettify-symbols-mode pollutes font-lock-extra-keywords
@ 2019-03-05 22:15 Clément Pit-Claudel
  2019-03-05 23:54 ` Drew Adams
  0 siblings, 1 reply; 8+ messages in thread
From: Clément Pit-Claudel @ 2019-03-05 22:15 UTC (permalink / raw)
  To: 34764

Hi all,

When turned off, prettify-symbols-mode removes 'composition' from font-lock-extra-keywords, but not prettify-symbols-start or prettify-symbols-end; as a result, every time prettify-symbols-mode is turned on, it adds two new elements to font-lock-extra-keywords.

(I ran into this issue because I added a watcher on font-lock-extra-keywords to debug an intermittent font-lock problem, and the increasingly long lists of prettify-symbol-* entries made things harder to read).

I'm happy to provide a patch, but I'm a bit puzzled by the implementation:

    (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))
      (with-silent-modifications
        (remove-text-properties (point-min) (point-max) '(composition nil))))))

Would it be simpler to just call font-lock-unfontify-region-function and remove all three properties from font-lock-extra-managed-props?

Cheers,
Clément.

In GNU Emacs 27.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.22.30)
 of 2019-02-28 built on clem-w50-mint
Repository revision: 5d60229bf1a9a496102fc2a3ef9e57dcce7bef10
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.11906000
System Description: Linux Mint 19.1





^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2019-10-30 20:57 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-03-05 22:15 bug#34764: prettify-symbols-mode pollutes font-lock-extra-keywords Clément Pit-Claudel
2019-03-05 23:54 ` Drew Adams
2019-03-06  3:50   ` Clément Pit-Claudel
2019-03-06  6:23     ` Drew Adams
2019-03-06  6:50       ` Clément Pit-Claudel
2019-03-06 15:37         ` Drew Adams
2019-10-30 19:30         ` Lars Ingebrigtsen
2019-10-30 20:57           ` Clément Pit-Claudel

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).