From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: David Engster Newsgroups: gmane.emacs.devel Subject: Re: Font Locking issue: Need help/advice Date: Sat, 04 Apr 2020 00:36:57 +0200 Message-ID: <877dyw2o3a.fsf@randomsample> References: <25fe76a8-025a-be67-8a28-3ac711f07766@protonmail.ch> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="57772"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.90 (gnu/linux) Cc: GNU Emacs Developers To: Serghei Iakovlev Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Apr 04 00:38:45 2020 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jKUxY-000Ex4-PJ for ged-emacs-devel@m.gmane-mx.org; Sat, 04 Apr 2020 00:38:44 +0200 Original-Received: from localhost ([::1]:33332 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jKUxX-0000tK-QE for ged-emacs-devel@m.gmane-mx.org; Fri, 03 Apr 2020 18:38:43 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:37564) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jKUwE-0000DK-U8 for emacs-devel@gnu.org; Fri, 03 Apr 2020 18:37:24 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jKUwD-0004Vt-H8 for emacs-devel@gnu.org; Fri, 03 Apr 2020 18:37:22 -0400 Original-Received: from randomsample.de ([5.45.97.173]:50987) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jKUwD-00046X-1a for emacs-devel@gnu.org; Fri, 03 Apr 2020 18:37:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=randomsample.de; s=a; h=Content-Type:MIME-Version:Message-ID:Date:References:In-Reply-To:Subject:Cc:To:From; bh=ko1GBt6svaBKPs+WLS7W074q0cBkUDYS8eMq1wjiZ/U=; b=ULA1bTTjMqy2V81jOPgAerRS1d8UP3lqEqDTtNqtmb5vzbYmA+X4iE0epQpIdUXiIuNK85YORW+tf8QrmKEwTl70vhkx2uTLOx78NJ1PDaLwFu+ayyZ/yQlZi19EimFK; Original-Received: from ip5f5abaee.dynamic.kabel-deutschland.de ([95.90.186.238] helo=void) by randomsample.de with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1jKUw3-0003rD-JX; Sat, 04 Apr 2020 00:37:11 +0200 In-Reply-To: <25fe76a8-025a-be67-8a28-3ac711f07766@protonmail.ch> (Serghei Iakovlev's message of "Fri, 03 Apr 2020 12:29:47 +0000") X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 5.45.97.173 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:246363 Archived-At: > - What happens on the GIF? How I can fix this? How to avoid similar > in the future? What happens here is that the initial font-lock goes over the whole currently visible section, but as soon as you edit one line, font-lock will be called only for the part of the buffer that has changed, and it seems your font-lock rules work differently in this case because the context has changed. > - In fact, I would like to be able to independently receive the > answer to the question "Why did this happen?" so I'm interesting > on debugging practices. How to debug similar issues? For better understanding how font-lock actually works, I highly recommend using font-lock-studio https://github.com/Lindydancer/font-lock-studio Also, take a look at the other linked packages in the description. In your case, 'highlight-refontification' could be useful to see which parts of the buffer actually get refontified when you edit it. -David