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:55:29 +0300 Message-ID: <83lhgh6fb2.fsf@gnu.org> References: <83y4kmdjmj.fsf@gnu.org> <555A8E62.7060700@cs.ucla.edu> <83h9r8egen.fsf@gnu.org> <83pp5t6gex.fsf@gnu.org> <555E09AE.9070208@cs.ucla.edu> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1432227354 30973 80.91.229.3 (21 May 2015 16:55:54 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 21 May 2015 16:55:54 +0000 (UTC) Cc: pot@gnu.org, emacs-devel@gnu.org To: Paul Eggert Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu May 21 18:55:45 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 1YvTl3-0005xE-J0 for ged-emacs-devel@m.gmane.org; Thu, 21 May 2015 18:55:45 +0200 Original-Received: from localhost ([::1]:58664 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YvTl3-0004qh-4o for ged-emacs-devel@m.gmane.org; Thu, 21 May 2015 12:55:45 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39809) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YvTkw-0004op-De for emacs-devel@gnu.org; Thu, 21 May 2015 12:55:39 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YvTkt-0008Ae-D5 for emacs-devel@gnu.org; Thu, 21 May 2015 12:55:38 -0400 Original-Received: from mtaout25.012.net.il ([80.179.55.181]:42282) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YvTkt-0008AU-4k; Thu, 21 May 2015 12:55:35 -0400 Original-Received: from conversion-daemon.mtaout25.012.net.il by mtaout25.012.net.il (HyperSendmail v2007.08) id <0NOP00P00L6I5U00@mtaout25.012.net.il>; Thu, 21 May 2015 19:51:22 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout25.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NOP00HH7LHMWU70@mtaout25.012.net.il>; Thu, 21 May 2015 19:51:22 +0300 (IDT) In-reply-to: <555E09AE.9070208@cs.ucla.edu> X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 80.179.55.181 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:186712 Archived-At: > Date: Thu, 21 May 2015 09:37:02 -0700 > From: Paul Eggert > CC: emacs-devel@gnu.org > > > if (c == '\n') > > { > > if (p > buffer && p[-1] == '\r') > > { > > p -= 1; > > #ifdef DOS_NT > > /* Assume CRLF->LF translation will be performed by Emacs > > when loading this file, so CRs won't appear in the buffer. > > It would be cleaner to compensate within Emacs; > > however, Emacs does not know how many CRs were deleted > > before any given point in the file. */ > > chars_deleted = 1; > > #else > > chars_deleted = 2; > > #endif > > } > > Sorry, I'm a little lost. Would it actually work with an Emacs on a > GNUish host if we simply set chars_deleted = 1 here? I think it will, and that's what I was suggesting: remove the #ifdef and use the code currently conditioned by DOS_NT. > If etags is locale-agnostic, its output files must contain byte counts > and not character counts. Yes, they are called "character counts", but are actually byte counts. > And if the output files contain byte counts, surely they need to > count the CR bytes as well as the LF bytes, at least on a GNU or > POSIXish host. I think CRs don't need to be counted, because they will not be in the Emacs buffer when a DOS-ish file is visited, due to EOL decoding. IOW, the "CRLF->LF translation" that the comment mentions is done on all platforms. Or am I missing something?