From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.devel Subject: Re: master 7362554: Widen around c-font-lock-fontify-region. This fixes bug #38049. Date: Thu, 14 Nov 2019 23:07:53 +0200 Message-ID: References: <20191109144026.20810.76129@vcs0.savannah.gnu.org> <20191109144027.DDC3720927@vcs0.savannah.gnu.org> <38328d99-23c8-7ba7-a23d-e70ac0aab67a@yandex.ru> <20191111203445.GA5135@ACM> <7497e71d-bab6-fa04-bbc4-f52fadeda16d@yandex.ru> <20191113211936.GB4942@ACM> <6fc930a1-eb47-9e54-8752-8cf7ff041586@yandex.ru> <81e61ed6-27a3-dbdd-34fa-fda779d3e991@yandex.ru> <83blte5y61.fsf@gnu.org> <9eff0b15-b8d0-5340-230e-47eed7cf63cb@yandex.ru> <835zjm5xam.fsf@gnu.org> <1324bf6c-074e-0a8f-0406-64ba5537bed0@yandex.ru> <83y2wi4f0d.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="112331"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 Cc: acm@muc.de, monnier@iro.umontreal.ca, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Nov 14 22:08:59 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 1iVMMM-000T2i-Lk for ged-emacs-devel@m.gmane.org; Thu, 14 Nov 2019 22:08:58 +0100 Original-Received: from localhost ([::1]:33722 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iVMML-0000V3-Fa for ged-emacs-devel@m.gmane.org; Thu, 14 Nov 2019 16:08:57 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:45432) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iVMLZ-0000St-59 for emacs-devel@gnu.org; Thu, 14 Nov 2019 16:08:10 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iVMLW-0007ld-UT for emacs-devel@gnu.org; Thu, 14 Nov 2019 16:08:08 -0500 Original-Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]:36408) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iVMLW-0007lC-OQ; Thu, 14 Nov 2019 16:08:06 -0500 Original-Received: by mail-wm1-x332.google.com with SMTP id c22so7819062wmd.1; Thu, 14 Nov 2019 13:08:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=vsVercB4bvQG5NWtetxJfab2w0Oq2EpqofAmopL7z4w=; b=IAXTCJaLBvkTTyAXrhiKyzepfUNanvmpQhKZUvc8fkL19Ybj2ZjB1CgTfF233EZgEU lyrUJyzfpGNPB9IPy0Uo8KmIg/QeAj7xa7+NLqJ4HRCZy7XLiBluGjAymxXb4VaVrwhL ZTY6pkZsD17/3nVV/k9n6yM75exDOhtcXCYolCDOwXW29pmeOz9S3tHwKZgagA+kvD5V BAJMqtXy+ZNN6N1I2oygUkJ03MMtY7cLWvm8aXt8ehrSCBxCFJzHSMieuk8cUPrMpFuc R1Al19+jFO8pnJdSkJTBMndVtmecg8I6AsiKdV6YROSoG1T006b/NNgEfjQvZ3x/uO3+ Y02A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=vsVercB4bvQG5NWtetxJfab2w0Oq2EpqofAmopL7z4w=; b=oYcVFe1dCrOUGnugqBHewHw/WTjXb5uLS7BPm7byXc+YAT19YFiny8ongzQVosA3t8 dXoetElBN0Jn4mC1zaZcVlHmTywCPbbQQ/PPLp8Qx07DbFciGcutBdPtxxHFmLe4ckF9 s7Odl/WgW/4vdJQndU3MrS+4HrRlhzOyBHPR2IRoVc3eLQ6VsoOaONGtAw6q1c34EwYj CwQJPU3Vdp3h8yIj5gJjX9HjzcYg/IQXf+yocsCZ1kxKWmWvqqnZzvqMLYVr7jvYn60C U2y1an3QS9QtDi+FbGBwRaLdiQ8QoLRgfIKwmZNfg9Wp/J5gPXMnnAWWWFl6gru7ut5E pGaw== X-Gm-Message-State: APjAAAWwHaOt3vGAUX20LhGENMX3DunYhWh5M+31F/+UHutiBPl+zRqy UrucR0FlK/IylDo37deDxeQXJwTm97I= X-Google-Smtp-Source: APXvYqykAfxP3D9U+/m4Cym8atqwUoZKwubC1fFVbBDGx0OI+O1fBVuXYoO5/vnzf3hrFXFGftF/tg== X-Received: by 2002:a1c:9c82:: with SMTP id f124mr11209150wme.25.1573765685335; Thu, 14 Nov 2019 13:08:05 -0800 (PST) Original-Received: from [192.168.0.5] ([212.50.117.215]) by smtp.googlemail.com with ESMTPSA id t1sm9696579wrn.81.2019.11.14.13.08.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 Nov 2019 13:08:04 -0800 (PST) In-Reply-To: <83y2wi4f0d.fsf@gnu.org> Content-Language: en-US X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::332 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:242202 Archived-At: On 14.11.2019 18:08, Eli Zaretskii wrote: >> Cc: monnier@iro.umontreal.ca, acm@muc.de, emacs-devel@gnu.org >> From: Dmitry Gutov >> Date: Thu, 14 Nov 2019 16:50:14 +0200 >> >> On 14.11.2019 16:48, Eli Zaretskii wrote: >>>>> The reality could be different, >>>>> and I'd like us to support those different conditions. It doesn't >>>>> sound like it's much harder. >>>> There are options, sure. But I think all of them will require explicit >>>> support from major modes. >>> I don't think so. All we need to make sure is that the narrowing >>> doesn't conceal portions of the embedded fragment. >> >> I would very much like to read your idea in more detail. > > I'm not sure what else is there to say. Really. Can you ask specific > questions? Question one is: do you still stand by that earlier assessment? > My point was that Alan wanted not to start fontification from a random > place determined by blindly narrowing to some arbitrary chunk. But in > mmm-mode the code fragment is present in the narrowed portion in its > entirety, so it doesn't sound like we have a real problem here. It's what I was hoping would work, but apparently font-lock rules are inevitably called from different narrowings (at least in some, edge-case scenarios). So to be ironclad, CC Mode has to call 'widen' its some of its font-lock-keywords matchers. But that breaks the narrowing applied by mmm-mode in its aggregated fontification function.