From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.devel Subject: Re: master 7362554: Widen around c-font-lock-fontify-region. This fixes bug #38049. Date: Mon, 11 Nov 2019 20:34:45 +0000 Message-ID: <20191111203445.GA5135@ACM> References: <20191109144026.20810.76129@vcs0.savannah.gnu.org> <20191109144027.DDC3720927@vcs0.savannah.gnu.org> <38328d99-23c8-7ba7-a23d-e70ac0aab67a@yandex.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="117813"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mutt/1.10.1 (2018-07-13) Cc: emacs-devel@gnu.org To: Dmitry Gutov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Nov 11 21:35:00 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 1iUGOp-000US2-L8 for ged-emacs-devel@m.gmane.org; Mon, 11 Nov 2019 21:34:59 +0100 Original-Received: from localhost ([::1]:57008 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iUGOn-00008S-TG for ged-emacs-devel@m.gmane.org; Mon, 11 Nov 2019 15:34:57 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:49743) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iUGOh-000087-FU for emacs-devel@gnu.org; Mon, 11 Nov 2019 15:34:52 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iUGOg-0002HH-CY for emacs-devel@gnu.org; Mon, 11 Nov 2019 15:34:51 -0500 Original-Received: from colin.muc.de ([193.149.48.1]:60938 helo=mail.muc.de) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1iUGOg-0002GY-27 for emacs-devel@gnu.org; Mon, 11 Nov 2019 15:34:50 -0500 Original-Received: (qmail 93614 invoked by uid 3782); 11 Nov 2019 20:34:47 -0000 Original-Received: from acm.muc.de (p4FE15B13.dip0.t-ipconnect.de [79.225.91.19]) by colin.muc.de (tmda-ofmipd) with ESMTP; Mon, 11 Nov 2019 21:34:45 +0100 Original-Received: (qmail 5145 invoked by uid 1000); 11 Nov 2019 20:34:45 -0000 Content-Disposition: inline In-Reply-To: <38328d99-23c8-7ba7-a23d-e70ac0aab67a@yandex.ru> X-Delivery-Agent: TMDA/1.1.12 (Macallan) X-Primary-Address: acm@muc.de X-detected-operating-system: by eggs.gnu.org: FreeBSD 9.x [fuzzy] X-Received-From: 193.149.48.1 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:242093 Archived-At: Hello, Dmitry. On Mon, Nov 11, 2019 at 18:52:34 +0200, Dmitry Gutov wrote: > On 09.11.2019 16:40, Alan Mackenzie wrote: > > + (widen) > Could you try and honor font-lock-dont-widen here? Difficult. In CC Mode it is sometimes necessary to enlarge a font lock region so as to get the context needed to parse some element of the buffer. This was what gave rise to the bug. In all of Emacs, there's just one use of font-lock-dont-widen, in rmail.el, and that is almost certainly for a different reason than your use of it (which is, I believe, having several major modes in a single buffer). Could you, perhaps, suggest some alternative to using widen in c-font-lock-fontify-region? Some way which would still work for CC Mode (including the just fixed bug), but wouldn't adversely affect the several major mode code you're maintaining? Would it be possible to widen "a bit" rather than widening to the whole buffer? If so, how would I determine the bit to widen to? -- Alan Mackenzie (Nuremberg, Germany).