From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Paul Eggert Newsgroups: gmane.emacs.devel Subject: Re: etags test is broken on MS-Windows Date: Thu, 21 May 2015 16:28:21 -0700 Organization: UCLA Computer Science Department Message-ID: <555E6A15.8010404@cs.ucla.edu> References: <83y4kmdjmj.fsf@gnu.org> <555A8E62.7060700@cs.ucla.edu> <83h9r8egen.fsf@gnu.org> <83pp5t6gex.fsf@gnu.org> <555E09AE.9070208@cs.ucla.edu> <83lhgh6fb2.fsf@gnu.org> <555E2C10.4010501@cs.ucla.edu> <83h9r5670s.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1432250934 28620 80.91.229.3 (21 May 2015 23:28:54 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 21 May 2015 23:28:54 +0000 (UTC) Cc: pot@gnu.org, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri May 22 01:28:42 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 1YvZtJ-0001TT-DJ for ged-emacs-devel@m.gmane.org; Fri, 22 May 2015 01:28:41 +0200 Original-Received: from localhost ([::1]:59805 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YvZtI-0002hc-UV for ged-emacs-devel@m.gmane.org; Thu, 21 May 2015 19:28:40 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46892) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YvZt8-0002hW-6b for emacs-devel@gnu.org; Thu, 21 May 2015 19:28:31 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YvZt5-0005tb-PX for emacs-devel@gnu.org; Thu, 21 May 2015 19:28:30 -0400 Original-Received: from smtp.cs.ucla.edu ([131.179.128.62]:45670) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YvZt1-0005sd-N8; Thu, 21 May 2015 19:28:23 -0400 Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id CCFE2A60010; Thu, 21 May 2015 16:28:22 -0700 (PDT) X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu Original-Received: from smtp.cs.ucla.edu ([127.0.0.1]) by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id w54y49PNI62f; Thu, 21 May 2015 16:28:22 -0700 (PDT) Original-Received: from Penguin.CS.UCLA.EDU (Penguin.CS.UCLA.EDU [131.179.64.200]) by smtp.cs.ucla.edu (Postfix) with ESMTPSA id 093DFA60009; Thu, 21 May 2015 16:28:22 -0700 (PDT) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 In-Reply-To: <83h9r5670s.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 131.179.128.62 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:186729 Archived-At: On 05/21/2015 12:54 PM, Eli Zaretskii wrote: > Yes, they would, but it's not fatal, since etags.el searches around > the position for the pattern stated on the tag line. > > And of course, in the case you present, the byte counts will be > slightly off on Windows as well. > > But the way etags works currently, a file with all of its lines ending > in CRLF will_always_ have all of its byte counts messed up. Not a > catastrophe, either, but still worse than under my suggestion. I don't see why it's worth our trouble to substitute one incorrect solution for another, if it's OK that the solutions are approximate. If it's important to fix this, how about the following idea instead. Have etags always compute byte offsets the POSIX way, counting any CRs, and put POSIX-oriented byte counts into the TAGS file (the way it already does on GNU hosts). When Emacs starts up, if the source file is in DOS mode (with CRLF replaced by LF internally), Emacs subtracts the line count from the POSIX byte count, and uses the resulting byte count instead. That way, we don't need to change how etags works on GNU platforms, nor do we need to tell GNU users to regenerate their TAGS files.