emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: etags test is broken on MS-Windows


From: Eli Zaretskii
Subject: Re: etags test is broken on MS-Windows
Date: Thu, 21 May 2015 19:55:29 +0300

> Date: Thu, 21 May 2015 09:37:02 -0700
> From: Paul Eggert <address@hidden>
> CC: address@hidden
> 
> >     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?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]