From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.bugs Subject: bug#25362: 26.0.50; comment-region goes into an infinite loop Date: Thu, 5 Jan 2017 20:54:52 +0000 Message-ID: <20170105205452.GA808@acm.fritz.box> References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: blaine.gmane.org 1483649778 9777 195.159.176.226 (5 Jan 2017 20:56:18 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 5 Jan 2017 20:56:18 +0000 (UTC) User-Agent: Mutt/1.5.24 (2015-08-30) Cc: 25362@debbugs.gnu.org To: Dima Kogan Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Jan 05 21:56:14 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cPF50-0001T8-43 for geb-bug-gnu-emacs@m.gmane.org; Thu, 05 Jan 2017 21:56:10 +0100 Original-Received: from localhost ([::1]:48628 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cPF52-0001R0-Tw for geb-bug-gnu-emacs@m.gmane.org; Thu, 05 Jan 2017 15:56:12 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45311) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cPF4x-0001Qv-MA for bug-gnu-emacs@gnu.org; Thu, 05 Jan 2017 15:56:08 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cPF4s-0002Px-Ry for bug-gnu-emacs@gnu.org; Thu, 05 Jan 2017 15:56:07 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:56893) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cPF4s-0002Pp-PO for bug-gnu-emacs@gnu.org; Thu, 05 Jan 2017 15:56:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1cPF4s-0008Q1-GD for bug-gnu-emacs@gnu.org; Thu, 05 Jan 2017 15:56:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 05 Jan 2017 20:56:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25362 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 25362-submit@debbugs.gnu.org id=B25362.148364971032297 (code B ref 25362); Thu, 05 Jan 2017 20:56:02 +0000 Original-Received: (at 25362) by debbugs.gnu.org; 5 Jan 2017 20:55:10 +0000 Original-Received: from localhost ([127.0.0.1]:44059 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cPF42-0008Op-GF for submit@debbugs.gnu.org; Thu, 05 Jan 2017 15:55:10 -0500 Original-Received: from ocolin.muc.de ([193.149.48.4]:13913 helo=mail.muc.de) by debbugs.gnu.org with smtp (Exim 4.84_2) (envelope-from ) id 1cPF40-0008Og-HV for 25362@debbugs.gnu.org; Thu, 05 Jan 2017 15:55:09 -0500 Original-Received: (qmail 85749 invoked by uid 3782); 5 Jan 2017 20:55:06 -0000 Original-Received: from acm.muc.de (p548C6DF0.dip0.t-ipconnect.de [84.140.109.240]) by colin.muc.de (tmda-ofmipd) with ESMTP; Thu, 05 Jan 2017 21:55:05 +0100 Original-Received: (qmail 1095 invoked by uid 1000); 5 Jan 2017 20:54:52 -0000 Content-Disposition: inline In-Reply-To: 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.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.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" Xref: news.gmane.org gmane.emacs.bugs:127792 Archived-At: 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 "") (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).