unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: brubar.cs@gmail.com
Cc: 21615-done@debbugs.gnu.org
Subject: bug#21615: 24.5; font-lock-extend-region-wholelines' infinite loop
Date: Fri, 09 Oct 2015 11:14:15 +0300	[thread overview]
Message-ID: <83h9m0cvc8.fsf@gnu.org> (raw)
In-Reply-To: <87a8ryczcg.fsf@tosh-laptop.i-did-not-set--mail-host-address--so-tickle-me>

> From: brubar.cs@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.





      reply	other threads:[~2015-10-09  8:14 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-04 17:34 bug#21615: 24.5; font-lock-extend-region-wholelines' infinite loop brubar.cs
2015-10-09  8:14 ` Eli Zaretskii [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83h9m0cvc8.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=21615-done@debbugs.gnu.org \
    --cc=brubar.cs@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).