bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#39390: 28.0.50; prettify-symbols-mode confuses display when start/en


From: Raphael 'kena' Poss
Subject: bug#39390: 28.0.50; prettify-symbols-mode confuses display when start/end faces are different
Date: Sun, 2 Feb 2020 21:26:32 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1

All right, so I take from our conversation so far that I should add
font-lock rules that ensure that the symbols that I am substituting have
a common face as per font-lock before the substitution by
prettify-symbols-mode takes place.

I have tried this:

(font-lock-add-keywords
 'go-mode
 '(("func(" . font-lock-keyword-face)))

(add-hook
 'go-mode-hook
 (lambda ()
   (push '("func(" . "λ(") prettify-symbols-alist)))

I have checked manually (by first disabling my prettify-symbols-alist
customization) that the font-lock customization indeed applies the same
face to all occurences of "func(" in the source.

However once the prettify-symbols substitution is active, the display
becomes messed up again.

Is it possible that this occurs because go-mode already pre-defines a
rule to apply keyword-face to "func", before my additional rule kicks
in? Do you reckon there is a way to remove the native rule defined by
go-mode so that mine remains the only that parses "func"?

-- 
Raphael 'kena' Poss





reply via email to

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