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: Re: master 7362554: Widen around c-font-lock-fontify-region. This fixes bug #38049. Date: Thu, 14 Nov 2019 08:42:17 -0500 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> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="52535"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: Alan Mackenzie , emacs-devel@gnu.org To: Dmitry Gutov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Nov 14 14:42:37 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 1iVFON-000DQy-47 for ged-emacs-devel@m.gmane.org; Thu, 14 Nov 2019 14:42:35 +0100 Original-Received: from localhost ([::1]:57688 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iVFOL-0004vK-Q0 for ged-emacs-devel@m.gmane.org; Thu, 14 Nov 2019 08:42:33 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:36081) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iVFOC-0004te-1e for emacs-devel@gnu.org; Thu, 14 Nov 2019 08:42:24 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iVFOA-0002XA-PC for emacs-devel@gnu.org; Thu, 14 Nov 2019 08:42:23 -0500 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:3797) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iVFOA-0002Wh-IS for emacs-devel@gnu.org; Thu, 14 Nov 2019 08:42:22 -0500 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 99423449CCE; Thu, 14 Nov 2019 08:42:21 -0500 (EST) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 79F0D449CCC; Thu, 14 Nov 2019 08:42:20 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1573738940; bh=LuYYRz5jiNRU6WPv1WMmkq3px/7TGsMHxqfikkd5v3A=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=o3GhFmc4VEkmB/zBiqlMzuVlpEoXqThhrUtWk5uAuayA/k8UgbFEv/uRWP6b1d9Kk d3Gmih9a3h1yY0ep4TFA/e6wbTqR2EYm23SC42C9iQT+Bl3wxonmPHhqDjPelBm1lS moW783iB/88Bmzb1AP+74pnaVxIU9E7KQQVSB0n7G90vYOJ6zv/fjzimJUl2Q4tDId bquNSnqoia4tfz+QNeL5ZHhrSxnzlsfR0R6x3RhkxkEIw56hzvr4G/PVUaEZld6rA0 9tE65qg550dJLGAXD/fzE2cHkCGAIkr1YgeRnPqoBJYGx8NrzEfgLF/nzis50AiHuS NQnqOeR6zkqtQ== Original-Received: from pastel (206-248-133-142.dsl.teksavvy.com [206.248.133.142]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 1A6FC120CD4; Thu, 14 Nov 2019 08:42:20 -0500 (EST) In-Reply-To: <6fc930a1-eb47-9e54-8752-8cf7ff041586@yandex.ru> (Dmitry Gutov's message of "Thu, 14 Nov 2019 00:33:33 +0200") X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] 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:242154 Archived-At: > ;; Return number of screen lines between START and END. > (defun repos-count-screen-lines (start end) > + ;; Make sure jit-lock doesn't have to run in a narrowed context. > + (font-lock-ensure start end) > (save-excursion > (save-restriction > (narrow-to-region start end) Hmm... the buffer might have font-lock disabled, in which case we'd be fontifying where the user didn't want fontification. But I haven't followed the thread enough to know what we're talking about, really. E.g. I have no idea what's the connection between CC-mode, font-lock-dont-widen, and the above hunk. More specifically, when looking at the above patch my first reaction is "if it's needed here, why isn't it needed almost everywhere else as well?" Stefan