From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.bugs Subject: bug#20240: 25.0.50; CC Mode broken fontification and commenting Date: Sat, 4 Apr 2015 10:45:39 +0000 Message-ID: <20150404104539.GA4362@acm.fritz.box> References: <20150403205219.41891.qmail@mail.muc.de> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1428144386 22682 80.91.229.3 (4 Apr 2015 10:46:26 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 4 Apr 2015 10:46:26 +0000 (UTC) Cc: 20240@debbugs.gnu.org To: Stefan Monnier , Mark Oteiza Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Apr 04 12:46:15 2015 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YeLaf-0004cI-88 for geb-bug-gnu-emacs@m.gmane.org; Sat, 04 Apr 2015 12:46:13 +0200 Original-Received: from localhost ([::1]:36836 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YeLae-0003YP-Hi for geb-bug-gnu-emacs@m.gmane.org; Sat, 04 Apr 2015 06:46:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54077) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YeLab-0003YK-Hu for bug-gnu-emacs@gnu.org; Sat, 04 Apr 2015 06:46:10 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YeLaa-0000tZ-OR for bug-gnu-emacs@gnu.org; Sat, 04 Apr 2015 06:46:09 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:54583) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YeLaV-0000st-Ab; Sat, 04 Apr 2015 06:46:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1YeLaU-0007EF-IN; Sat, 04 Apr 2015 06:46:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org, bug-cc-mode@gnu.org Resent-Date: Sat, 04 Apr 2015 10:46:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 20240 X-GNU-PR-Package: emacs,cc-mode X-GNU-PR-Keywords: Original-Received: via spool by 20240-submit@debbugs.gnu.org id=B20240.142814435227757 (code B ref 20240); Sat, 04 Apr 2015 10:46:02 +0000 Original-Received: (at 20240) by debbugs.gnu.org; 4 Apr 2015 10:45:52 +0000 Original-Received: from localhost ([127.0.0.1]:44359 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YeLaJ-0007Dd-QY for submit@debbugs.gnu.org; Sat, 04 Apr 2015 06:45:52 -0400 Original-Received: from colin.muc.de ([193.149.48.1]:33994 helo=mail.muc.de) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YeLaH-0007DU-Mm for 20240@debbugs.gnu.org; Sat, 04 Apr 2015 06:45:50 -0400 Original-Received: (qmail 16722 invoked by uid 3782); 4 Apr 2015 10:45:48 -0000 Original-Received: from acm.muc.de (pD951883F.dip0.t-ipconnect.de [217.81.136.63]) by colin.muc.de (tmda-ofmipd) with ESMTP; Sat, 04 Apr 2015 12:45:47 +0200 Original-Received: (qmail 4683 invoked by uid 1000); 4 Apr 2015 10:45:39 -0000 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-Delivery-Agent: TMDA/1.1.12 (Macallan) X-Primary-Address: acm@muc.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:101179 Archived-At: Hello, Stefan and Mark. On Fri, Apr 03, 2015 at 06:09:12PM -0400, Stefan Monnier wrote: > > - (run-hook-with-args 'jit-lock-after-change-extend-region-functions > > - start end old-len) > > - ;; Make sure we change at least one char (in case of deletions). > > - (setq jit-lock-end (min (max jit-lock-end (1+ start)) (point-max))) > > - ;; Request refontification. > > - (put-text-property jit-lock-start jit-lock-end 'fontified nil)) > > + (save-restriction > > + (widen) > > + (run-hook-with-args 'jit-lock-after-change-extend-region-functions > > + start end old-len) > > + ;; Make sure we change at least one char (in case of deletions). > > + (setq jit-lock-end (min (max jit-lock-end (1+ start)) (point-max))) > > + ;; Request refontification. > > + (put-text-property jit-lock-start jit-lock-end 'fontified nil))) > Widening during the call to > jit-lock-after-change-extend-region-functions seems wrong. But I guess > there can be meaningful cases where > jit-lock-after-change-extend-region-functions could return positions > outside of the narrowed region, so I'd be OK with widening during the > subsequent `put-text-property'. Thanks. I've just committed that change. Mark, would you please update your Emacs and build it again, then test whether or not your bug has finally been fixed, then let us know. Then I can close the bug. Thanks! > Stefan -- Alan Mackenzie (Nuremberg, Germany).