emacs-devel
[Top][All Lists]
Advanced

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

Re: EOL: unix/dos/mac


From: Eli Zaretskii
Subject: Re: EOL: unix/dos/mac
Date: Tue, 26 Mar 2013 19:47:16 +0200

> From: Stefan Monnier <address@hidden>
> Cc: address@hidden, address@hidden, address@hidden
> Date: Tue, 26 Mar 2013 13:16:00 -0400
> 
> >> But when saving the file, which line ends would we use?
> >> For pre-existing line-ends, we could reproduce what was there before,
> >> but what about new lines?
> > User preference and some heuristics, I guess, as always.  E.g., if all
> > the lines used the same NLF, use that for new lines; otherwise look at
> > some user option for guidance.
> 
> So for files that use a consistent style, that means same behavior as
> what we now have.

The suggestion was to support _all_ Unicode NLFs, which are more than
the 3 EOL formats we support now.  Other than that, yes, for
consistent style the behavior visible to user will be the same.

Note that my take on this is that if we extend EOL format to all the
Unicode NLFs, we should not convert them to newline and back on I/O,
but rather keep them verbatim in the buffers and strings (Stephen
disagrees).  If we go that way, there will be another user-visible
change: the character position could jump by more than one when you
move into the next line.

> The only difference is for mixed-style files, and
> AFAIK the only mixed-style files that occur often enough to care are of
> the LF-vs-CRLF kind, where I think the most important thing is to make
> ti clear that the extra CRs displayed are due to the presence of this
> mixed-style (so maybe we should check which style is more prominent and
> either highlight the few extra CRs or on the contrary hide the CRs and
> highlight the few missing CRs).

If we want to continue with a clear indication of mixed style, then
perhaps no changes are needed at all, as we do that now.  The only
change in that case might be a mode-line indication of the mixed
style, since the offending CR characters might not be visible in the
displayed portion of the file.

I rather thought the suggestion was to stop paying attention to what
exactly is used as EOL, including if they are mixed-style.



reply via email to

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