From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: etags test is broken on MS-Windows Date: Thu, 21 May 2015 19:31:34 +0300 Message-ID: <83pp5t6gex.fsf@gnu.org> References: <83y4kmdjmj.fsf@gnu.org> <555A8E62.7060700@cs.ucla.edu> <83h9r8egen.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE X-Trace: ger.gmane.org 1432225984 4633 80.91.229.3 (21 May 2015 16:33:04 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 21 May 2015 16:33:04 +0000 (UTC) Cc: eggert@cs.ucla.edu, emacs-devel@gnu.org To: Francesco =?iso-8859-1?Q?Potort=EC?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu May 21 18:32:54 2015 Return-path: Envelope-to: ged-emacs-devel@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 1YvTNu-00078x-Bg for ged-emacs-devel@m.gmane.org; Thu, 21 May 2015 18:31:50 +0200 Original-Received: from localhost ([::1]:58574 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YvTNt-00059M-Hj for ged-emacs-devel@m.gmane.org; Thu, 21 May 2015 12:31:49 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33783) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YvTNm-000594-VK for emacs-devel@gnu.org; Thu, 21 May 2015 12:31:46 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YvTNj-0008GF-Mj for emacs-devel@gnu.org; Thu, 21 May 2015 12:31:42 -0400 Original-Received: from mtaout22.012.net.il ([80.179.55.172]:46634) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YvTNj-0008EY-DJ; Thu, 21 May 2015 12:31:39 -0400 Original-Received: from conversion-daemon.a-mtaout22.012.net.il by a-mtaout22.012.net.il (HyperSendmail v2007.08) id <0NOP00800KF71300@a-mtaout22.012.net.il>; Thu, 21 May 2015 19:31:37 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout22.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NOP007H0KKPVF30@a-mtaout22.012.net.il>; Thu, 21 May 2015 19:31:37 +0300 (IDT) In-reply-to: X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: Solaris 10 X-Received-From: 80.179.55.172 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:186709 Archived-At: > Date: Thu, 21 May 2015 15:16:01 +0200 > From: Francesco Potort=EC > Cc: emacs-devel@gnu.org, Paul Eggert >=20 > >I think it's due to DOS CR-LF EOL format of some files in the test > >suite. For example, the first file whose tags were different in y= our > >testing is dostorture.c, which has DOS EOLs, the second file, c.C,= has > >a lone ^M character at the end of one of its lines, and so on. > > > >Could you please verify that this is indeed the source of the prob= lem? >=20 > Those files were put there to test the behaviour of etags with diff= erent > EOL styles. However, few tests were in fact done for etags running = on > DOS systems, so in fact there may be undetected regressions on etag= s for > DOS. There's no problem with etags on DOS and Windows, it behaves exactly as designed and implemented. The problem is on Unix: because etags o= n Unix does not strip the CR characters, its character counts are wrong= , because Emacs will strip them when it reads the source file. IOW, what was at some point only done by Emacs on DOS and Windows, is now done by default on all platforms. So I think etags should use te= h same code in Unix as well. I mean this fragment: =09if (c =3D=3D '\n') =09 { =09 if (p > buffer && p[-1] =3D=3D '\r') =09 { =09=09p -=3D 1; #ifdef DOS_NT =09 /* Assume CRLF->LF translation will be performed by Emacs =09=09 when loading this file, so CRs won't appear in the buffer. =09=09 It would be cleaner to compensate within Emacs; =09=09 however, Emacs does not know how many CRs were deleted =09=09 before any given point in the file. */ =09=09chars_deleted =3D 1; #else =09=09chars_deleted =3D 2; #endif =09 }