From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: contextual refontification (was: [PATCH] Re: Algorithm in electric-pair--unbalanced-strings-p unsuitable for CC Mode) Date: Tue, 09 Jul 2019 11:40:09 -0400 Message-ID: References: <20190708100539.GD4529@ACM> <20190708164501.GB5244@ACM> <20190708180551.GD5244@ACM> <20190709095222.GA5230@ACM> <81716eae-14f1-a427-b6e0-46e861adc93a@yandex.ru> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="134852"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: Alan Mackenzie , =?windows-1252?Q?Cl=E9ment?= Pit-Claudel , =?windows-1252?B?Sm/jbyBU4XZvcmE=?= , emacs-devel To: Dmitry Gutov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Jul 09 17:52:28 2019 Return-path: Envelope-to: ged-emacs-devel@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 1hksPr-000YtN-Cc for ged-emacs-devel@m.gmane.org; Tue, 09 Jul 2019 17:52:27 +0200 Original-Received: from localhost ([::1]:51214 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hksEA-0004YU-6j for ged-emacs-devel@m.gmane.org; Tue, 09 Jul 2019 11:40:22 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:48312) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hksE2-0004Qs-Pf for emacs-devel@gnu.org; Tue, 09 Jul 2019 11:40:15 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hksE1-0008Qz-PH for emacs-devel@gnu.org; Tue, 09 Jul 2019 11:40:14 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:7522) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hksE1-0008PX-HZ for emacs-devel@gnu.org; Tue, 09 Jul 2019 11:40:13 -0400 Original-Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id CD6031008A7; Tue, 9 Jul 2019 11:40:11 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 8BB0C10067D; Tue, 9 Jul 2019 11:40:10 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1562686810; bh=nuyMzaAIgAyW8C6qn15Z3894KwGpk8Jg4IWDTuEFvYo=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=F20Zer0mCQFprduqmYFMg3s/0fPziNLpw5n5hh9OuIz/gDdFujztHvcHondAWFeO/ eo8qmVYevJrwzqiyVeZ+FLqEi89jWp5iB9BAhybelVfXLhRtoeOLYw412dcz69XbPM V67DKdbkcoq98V+2spb/NSboFHviVaZanLBLppFJpXfwE5Chmt+ZGvi2CP15TiZ6zX +chzKifInN2jvAdQ51rHLuKJ8OaSllqIrIFz0ch1Ht9ptN2TYsSL+kvFUcvoHTB0J2 ZT4u5mE91YFa91IgVesDaKwmJL2g8UF8JZCbC05g+S5KKjrBTpko6P6OkgUutrNYcn t2MU87fPLNvKw== Original-Received: from alfajor (76-10-138-228.dsl.teksavvy.com [76.10.138.228]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 47770120B82; Tue, 9 Jul 2019 11:40:10 -0400 (EDT) In-Reply-To: <81716eae-14f1-a427-b6e0-46e861adc93a@yandex.ru> (Dmitry Gutov's message of "Tue, 9 Jul 2019 18:18:59 +0300") X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 132.204.25.50 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.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:238456 Archived-At: > * Fontifying "broken" strings only until EOL might be beneficial, at least > in certain languages, where it's consistent with the syntax. The result will > be less "blinking". This problem is not specific to strings: it also affects comments. BTW, the current default behavior delays re-fontifying the rest of the buffer (so called "contextual refontification") by jit-lock-context-time (by default 0.5s) which can sometimes avoid the flashing. It was not implemented specifically for that purpose, but it does sometimes have that effect. Maybe we could develop a hack for font-lock which would do it in a less "accidental" way. IOW make it so that font-lock: - delays refontification after the current line if the end of line is now within a string/comment (and wasn't before). - "un-delays" this fontification if the end of line is now outside of any string/comment (but was within it before). - of course, with some kind of timeout, but one longer than 0.5s. Or something like that. Stefan