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#11841: 24.1; emacs hangs when opening cpp file with mixed eol styles Date: Sun, 8 Jul 2012 15:34:13 +0000 Message-ID: <20120708153413.GA3416@acm.acm> References: <83lij25d3w.fsf@gnu.org> <20120707211010.GA13024@acm.acm> <83vchzklgc.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1341761882 32333 80.91.229.3 (8 Jul 2012 15:38:02 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 8 Jul 2012 15:38:02 +0000 (UTC) Cc: 11841@debbugs.gnu.org, vadimsks@gmail.com To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Jul 08 17:38:01 2012 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 1SntYd-0004uL-88 for geb-bug-gnu-emacs@m.gmane.org; Sun, 08 Jul 2012 17:37:59 +0200 Original-Received: from localhost ([::1]:59196 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SntYc-0005DU-AX for geb-bug-gnu-emacs@m.gmane.org; Sun, 08 Jul 2012 11:37:58 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:35973) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SntYa-0005D3-75 for bug-gnu-emacs@gnu.org; Sun, 08 Jul 2012 11:37:57 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SntYY-00042d-PS for bug-gnu-emacs@gnu.org; Sun, 08 Jul 2012 11:37:55 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:47281) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SntYW-00042P-2L; Sun, 08 Jul 2012 11:37:52 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1SntdV-0003zr-Jz; Sun, 08 Jul 2012 11:43:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alan Mackenzie Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org, bug-cc-mode@gnu.org Resent-Date: Sun, 08 Jul 2012 15:43:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 11841 X-GNU-PR-Package: emacs,cc-mode X-GNU-PR-Keywords: Original-Received: via spool by 11841-submit@debbugs.gnu.org id=B11841.134176217015344 (code B ref 11841); Sun, 08 Jul 2012 15:43:01 +0000 Original-Received: (at 11841) by debbugs.gnu.org; 8 Jul 2012 15:42:50 +0000 Original-Received: from localhost ([127.0.0.1]:56827 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SntdK-0003zR-8B for submit@debbugs.gnu.org; Sun, 08 Jul 2012 11:42:50 -0400 Original-Received: from colin.muc.de ([193.149.48.1]:49854 helo=mail.muc.de) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SntdH-0003zJ-Uo for 11841@debbugs.gnu.org; Sun, 08 Jul 2012 11:42:49 -0400 Original-Received: (qmail 11747 invoked by uid 3782); 8 Jul 2012 15:37:36 -0000 Original-Received: from acm.muc.de (pD955727C.dip.t-dialin.net [217.85.114.124]) by colin.muc.de (tmda-ofmipd) with ESMTP; Sun, 08 Jul 2012 17:37:34 +0200 Original-Received: (qmail 4011 invoked by uid 1000); 8 Jul 2012 15:34:13 -0000 Content-Disposition: inline In-Reply-To: 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.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) 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:61723 Archived-At: Hello, Stefan. On Sun, Jul 08, 2012 at 10:50:03AM -0400, Stefan Monnier wrote: > >> > Just as an observation, (forward-comment -1) doesn't move back over a ^M. > >> Why should it? It's not a whitespace, and while it has "comment end" > >> syntax, it does not have a matching comment-start. > >> I think you should give it whitespace syntax. > >> Currently "foo // bar ^M baz ^J" is treated in CC-mode as "foo > >> baz", which I think is wrong. I've tried setting ^M's syntax to WS. The code no longer loops. However, ^M is syntactically a comment ender so that it can end a comment when selective-display is active. > > Perhaps so, but in the file in question you have ^M^J with northing > > between them. So a lone ^M is not an issue here. > Yes it is: without a "//" in front of it, a ^M is not a comment-ender > and syntax.c then treats it as a "strange char" (for \n used as comment > ender, syntax.c knows to treat it as whitespace when there's no > matching comment-starter, but that's a special case, for other chars > this is not so, e.g. for pascal's } it would be wrong to treat it as > whitespace). Would it not be better for ^M to be treated as WS by syntax.c? The current problem isn't really a CC Mode one; mixed line enders could happen in a file of any major mode. Emacs really ought to treat all line endings the same. > Stefan -- Alan Mackenzie (Nuremberg, Germany).