From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.bugs Subject: bug#28599: 26.0.50; font-lock-ensure changes the face of text buttons Date: Wed, 30 Oct 2019 19:48:18 +0100 Message-ID: <87a79iqdcd.fsf@gnus.org> References: <89bbbfb8-efe5-edca-a571-ca73267cb498@web.de> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="178680"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: 28599@debbugs.gnu.org To: Alexander Miller Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Oct 30 19:50:06 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iPt2j-000kMC-JX for geb-bug-gnu-emacs@m.gmane.org; Wed, 30 Oct 2019 19:50:05 +0100 Original-Received: from localhost ([::1]:43406 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iPt2h-0004B9-9v for geb-bug-gnu-emacs@m.gmane.org; Wed, 30 Oct 2019 14:50:03 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56599) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iPt1p-0003bJ-Ty for bug-gnu-emacs@gnu.org; Wed, 30 Oct 2019 14:49:12 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iPt1o-0003RP-Js for bug-gnu-emacs@gnu.org; Wed, 30 Oct 2019 14:49:09 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:42631) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iPt1i-0003Mm-Cd for bug-gnu-emacs@gnu.org; Wed, 30 Oct 2019 14:49:05 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iPt1i-0002Lz-25 for bug-gnu-emacs@gnu.org; Wed, 30 Oct 2019 14:49:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 30 Oct 2019 18:49:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 28599 X-GNU-PR-Package: emacs Original-Received: via spool by 28599-submit@debbugs.gnu.org id=B28599.15724613058965 (code B ref 28599); Wed, 30 Oct 2019 18:49:02 +0000 Original-Received: (at 28599) by debbugs.gnu.org; 30 Oct 2019 18:48:25 +0000 Original-Received: from localhost ([127.0.0.1]:51447 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iPt17-0002KW-9n for submit@debbugs.gnu.org; Wed, 30 Oct 2019 14:48:25 -0400 Original-Received: from quimby.gnus.org ([80.91.231.51]:32798) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iPt15-0002KL-Lt for 28599@debbugs.gnu.org; Wed, 30 Oct 2019 14:48:24 -0400 Original-Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=marnie) by quimby.gnus.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iPt11-00024F-GE; Wed, 30 Oct 2019 19:48:21 +0100 In-Reply-To: <89bbbfb8-efe5-edca-a571-ca73267cb498@web.de> (Alexander Miller's message of "Mon, 25 Sep 2017 21:47:53 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:170434 Archived-At: Alexander Miller 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