unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Alan Mackenzie <acm@muc.de>
To: Dima Kogan <dima@secretsauce.net>
Cc: 25362@debbugs.gnu.org
Subject: bug#25362: 26.0.50; comment-region goes into an infinite loop
Date: Thu, 5 Jan 2017 20:54:52 +0000	[thread overview]
Message-ID: <20170105205452.GA808@acm.fritz.box> (raw)
In-Reply-To: <ypoulguq8ki2.fsf@jpl.nasa.gov>

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.

Thanks.

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

-- 
Alan Mackenzie (Nuremberg, Germany).





  reply	other threads:[~2017-01-05 20:54 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-04 23:37 bug#25362: 26.0.50; comment-region goes into an infinite loop Dima Kogan
2017-01-05 20:54 ` Alan Mackenzie [this message]
2017-01-06  7:41   ` Eli Zaretskii
2017-01-06  9:32     ` Alan Mackenzie
2017-01-06  9:37       ` Eli Zaretskii
2017-01-06  9:41         ` Alan Mackenzie
2017-01-07  8:20         ` Alan Mackenzie
2017-01-07  9:44           ` Eli Zaretskii
2017-01-07 10:27             ` Alan Mackenzie
     [not found]             ` <20170107162907.GC3499@acm.fritz.box>
2017-01-07 16:31               ` Eli Zaretskii
2017-01-09 21:18 ` Alan Mackenzie
2017-01-09 21:46   ` Dima Kogan
2017-01-09 22:04     ` Alan Mackenzie
2017-01-11 18:32       ` Alan Mackenzie

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=20170105205452.GA808@acm.fritz.box \
    --to=acm@muc.de \
    --cc=25362@debbugs.gnu.org \
    --cc=dima@secretsauce.net \
    /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).