GNU bug report logs - #21615
24.5; font-lock-extend-region-wholelines' infinite loop

Previous Next

Package: emacs;

Reported by: brubar.cs <at> gmail.com

Date: Sun, 4 Oct 2015 17:18:02 UTC

Severity: normal

Found in version 24.5

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #10 received at 21615-done <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: brubar.cs <at> gmail.com
Cc: 21615-done <at> debbugs.gnu.org
Subject: Re: bug#21615: 24.5; font-lock-extend-region-wholelines' infinite loop
Date: Fri, 09 Oct 2015 11:14:15 +0300
> From: brubar.cs <at> gmail.com
> Date: Sun, 04 Oct 2015 19:34:07 +0200
> 
> 
> The function `font-lock-extend-region-wholelines' uses `bolp' to check
> if point is at the beginning of the line, and, if not, it calls
> `line-beginning-position' to move to the beginning of the line.
> 
> Here is the code from `font-lock-extend-region-wholelines':
> 
> ,----
> | (goto-char font-lock-beg)
> | (unless (bolp)
> |   (setq changed t font-lock-beg (line-beginning-position)))
> `----
> 
> 
> But, `line-beginning-position' moves to the beginning of the line *OR*
> to the beginning of a *field*. Thus, if point is at the beginning of a
> field that is not at the beginning of a line, `changed' is set to t but
> the region is not changed. As `font-lock-extend-region-wholelines' is
> called again until it doesn't signal a change, we end up in an infinite
> loop.
> 
> 
> 
> To reproduce, use the attached file and run it like that:
> 
> 
> ,----
> | emacs -Q --file test-font-lock-infloop.el --eval '(progn (eval-buffer) (DO-NOT-EVAL-ME))'
> `----

Thanks, I fixed that in the development sources.




This bug report was last modified 9 years and 254 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.