From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.bugs Subject: bug#18022: 24.3; Emacs hard locks when attempting to do a replacement with ^M in it. Date: Wed, 23 Jul 2014 18:41:46 +0000 Message-ID: <20140723184146.GA2969__10694.3049272106$1406141260$gmane$org@acm.acm> References: <83ha2i901p.fsf@gnu.org> <8338e28t9r.fsf@gnu.org> <20140716214144.GA4052@acm.acm> <20140719203310.GA12706@acm.acm> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1406141260 31602 80.91.229.3 (23 Jul 2014 18:47:40 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 23 Jul 2014 18:47:40 +0000 (UTC) Cc: Marty Rosenberg , 18022@debbugs.gnu.org To: Stefan Monnier , Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Jul 23 20:47:33 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XA1Zc-0001Sx-MJ for geb-bug-gnu-emacs@m.gmane.org; Wed, 23 Jul 2014 20:47:32 +0200 Original-Received: from localhost ([::1]:46509 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XA1Zc-0006hJ-91 for geb-bug-gnu-emacs@m.gmane.org; Wed, 23 Jul 2014 14:47:32 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58620) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XA1ZR-0006h6-4M for bug-gnu-emacs@gnu.org; Wed, 23 Jul 2014 14:47:29 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XA1ZI-0006PA-9G for bug-gnu-emacs@gnu.org; Wed, 23 Jul 2014 14:47:21 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:40599) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XA1Z9-0006FY-0F; Wed, 23 Jul 2014 14:47:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1XA1Z8-00060l-D8; Wed, 23 Jul 2014 14:47:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org, bug-cc-mode@gnu.org Resent-Date: Wed, 23 Jul 2014 18:47:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 18022 X-GNU-PR-Package: emacs,cc-mode X-GNU-PR-Keywords: Original-Received: via spool by 18022-submit@debbugs.gnu.org id=B18022.140614121323080 (code B ref 18022); Wed, 23 Jul 2014 18:47:02 +0000 Original-Received: (at 18022) by debbugs.gnu.org; 23 Jul 2014 18:46:53 +0000 Original-Received: from localhost ([127.0.0.1]:35865 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XA1Yt-000601-TY for submit@debbugs.gnu.org; Wed, 23 Jul 2014 14:46:52 -0400 Original-Received: from colin.muc.de ([193.149.48.1]:32797 helo=mail.muc.de) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XA1Yl-0005za-2R for 18022@debbugs.gnu.org; Wed, 23 Jul 2014 14:46:43 -0400 Original-Received: (qmail 58050 invoked by uid 3782); 23 Jul 2014 18:46:37 -0000 Original-Received: from acm.muc.de (pD9518F0B.dip0.t-ipconnect.de [217.81.143.11]) by colin.muc.de (tmda-ofmipd) with ESMTP; Wed, 23 Jul 2014 20:46:36 +0200 Original-Received: (qmail 3352 invoked by uid 1000); 23 Jul 2014 18:41:46 -0000 Content-Disposition: inline In-Reply-To: <20140719203310.GA12706@acm.acm> User-Agent: Mutt/1.5.21 (2010-09-15) 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.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.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-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:91761 Archived-At: Hi, everybody! On Sat, Jul 19, 2014 at 08:33:10PM +0000, Alan Mackenzie wrote: > Hello, Stefan, Marty and Eli. > Looking at back_comment, just after the main loop at L+205, we have the > code which restores point and the current syntax table: > if (comstart_pos == 0) > { > from = comment_end; > from_byte = comment_end_byte; > => UPDATE_SYNTAX_TABLE_FORWARD (comment_end - 1); > } > It seems to me that that " - 1" is what is causing the syntax table to be > restored to the value for ">", and shouldn't be there. Stefan, am I > right? I should have included a patch. Sorry! Here it is, in case anybody didn't feel like working through the textual description. I think this fixes the bug, if it's correct. === modified file 'src/syntax.c' *** src/syntax.c 2014-07-09 23:39:58 +0000 --- src/syntax.c 2014-07-23 18:26:45 +0000 *************** *** 825,831 **** { from = comment_end; from_byte = comment_end_byte; ! UPDATE_SYNTAX_TABLE_FORWARD (comment_end - 1); } /* If comstart_pos is set and we get here (ie. didn't jump to `lossage' or `done'), then we've found the beginning of the non-nested comment. */ --- 825,831 ---- { from = comment_end; from_byte = comment_end_byte; ! UPDATE_SYNTAX_TABLE_FORWARD (comment_end); } /* If comstart_pos is set and we get here (ie. didn't jump to `lossage' or `done'), then we've found the beginning of the non-nested comment. */ -- Alan Mackenzie (Nuremberg, Germany).