[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#28599: 26.0.50; font-lock-ensure changes the face of text buttons
From: |
Lars Ingebrigtsen |
Subject: |
bug#28599: 26.0.50; font-lock-ensure changes the face of text buttons |
Date: |
Wed, 30 Oct 2019 19:48:18 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) |
Alexander Miller <alexanderm@web.de> writes:
> Steps to reproduce:
>
> * emacs -q
> * switch to a text-mode buffer
> * Run (insert-text-button "AAAAAAAAAAA" 'face 'font-lock-constant-face)
> * Run (font-lock-ensure)
>
> The button's face will now have changed from font-lock-constant to button.
> This only happens once, a second call to font-lock-ensure makes no such
> changes.
> Overlay buttons don't seem to be affected.
>
> I also tested this on a self-compiled emacs 25.2.1, with the same result.
I'm unable to reproduce this exactly -- when I try this in Emacs 27, the
face property is just cleared, and no new face is applied. And it
happens on all calls to font-lock-ensure.
This happens because that function calls,
font-lock-default-fontify-region, which calls
font-lock-default-unfontify-region is called, and it just does
(defun font-lock-default-unfontify-region (beg end)
"Unfontify the text between BEG and END.
This function is the default `font-lock-unfontify-region-function'."
(remove-list-of-text-properties
beg end (append
font-lock-extra-managed-props
(if font-lock-syntactic-keywords
'(syntax-table face font-lock-multiline)
'(face font-lock-multiline)))))
So if you want to have both your own faces and use font-lock, too, you
have to use font-lock-face instead of face, according to "Precalculated
Fontification".
So there doesn't seem to be a bug here.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- bug#28599: 26.0.50; font-lock-ensure changes the face of text buttons,
Lars Ingebrigtsen <=