[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#25362: 26.0.50; comment-region goes into an infinite loop

From: Alan Mackenzie
Subject: bug#25362: 26.0.50; comment-region goes into an infinite loop
Date: Thu, 5 Jan 2017 20:54:52 +0000
User-agent: Mutt/1.5.24 (2015-08-30)

Hello, Dima.

On Wed, Jan 04, 2017 at 03:37:25PM -0800, Dima Kogan wrote:
> Hi. I'm using a very recent emacs built from master:

>   eb3416016b4

> I'm observing (comment-region) go into an infinite loop when presented
> with particular data. I'm attaching a small source file that
> demonstrates the issue. To see it break, run this:

>     emacs --eval '(add-hook (quote c-mode-common-hook) (lambda () (setq 
> comment-start "//" comment-end "")))'  \
>           --eval '(global-set-key (kbd "<f5>") (lambda () (interactive) 
> (comment-region 16 45)))'              \
>           -Q tst6.c

> This loads the demo file with a clean configuration, and runs two bits
> of lisp:

> 1. Sets up a c++ commenting style. This is required for the issue to
>    present itself

> 2. Binds f5 to run the problematic (comment-region)

> On my machine, invoking emacs that way, and then hitting f5 shows the problem.

Just as an aside, this bug happens even in Emacs 25.1 without any of the
settings you call it with.  Just visit the file, mark that region and do
C-c C-c.

The hang happens in comment-region-internal on attempting to insert "//
" to the first non-empty line in the range.  Something funny is
happening in a before/after-change-function or a font-lock function in
CC Mode.  I'll be looking into it.


> void f(void)
> {
>     g( // output
>       s );
> }

Alan Mackenzie (Nuremberg, Germany).

reply via email to

[Prev in Thread] Current Thread [Next in Thread]