unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* mode line eol char indication
@ 2008-12-31 22:50 Drew Adams
  2009-01-01  1:20 ` Jason Rumney
  0 siblings, 1 reply; 12+ messages in thread
From: Drew Adams @ 2008-12-31 22:50 UTC (permalink / raw)
  To: emacs-devel

The Emacs manual, node Mode Line, explains the eol character
indication this way:

 The character after CS is usually a colon.  However, under some
 circumstances a different string is displayed, which indicates a
 nontrivial end-of-line convention.  Usually, lines of text are
 separated by "newline characters", but two other conventions are
 sometimes used.  The MS-DOS convention is to use a
 "carriage-return" character followed by a "linefeed" character;
 when editing such files, the colon changes to either a backslash
 (`\') or `(DOS)', depending on the operating system.  The
 Macintosh end-of-line convention is to use a "carriage-return"
 character instead of a newline; when editing such files, the
 colon indicator changes to either a forward slash (`/') or
 `(Mac)'.  On some systems, Emacs displays `(Unix)' instead of
 the colon for files that use newline as the line separator.

That's quite a mouthful.  I wonder now about this convention,
which I've lived with for decades without wondering ;-).

* The non-"nontrivial" eol convention, represented by `:', is
  presumably what is meant by "usually", that is, a newline char.
  But a newline eol is also sometimes represented by `(Unix)'.
  Why?  And why is this called "nontrivial" - why is it more
  nontrivial and more usual than the other possibilities?

* `\' is used sometimes to represent carriage return (C-m)
  followed by newline (C-j), but sometimes `(DOS)' is used to
  represent the same eol chars.

* `/' is used sometimes to represent C-m, but sometimes `(Mac)'
  is used to represent the same same eol char.

Why `:'?  Why `\' (is there some relation to the DOS directory
separator?)?  Why `/'?

Why so many variations - both `:' and `(Unix)'; both `\' and
`(DOS)'; both `/' and `(Mac)'?

None of those labels are particularly helpful, IMO. And there's
no telling when one or the other of the equivalent alternatives
will be used, apparently.

Why not (always) use the Emacs standard representation of the
actual eol chars?  IOW:

* \n instead of : and (Unix)

* \r instead of / and (Mac)

* \n\r instead of \ and (DOS)

That's 4 chars max instead of 6 chars max, and it's more
explicit.

We might even want to move this end-of-line indication to, well,
the end of the mode line (far right).  That would be a little
mnemonic: what you see at the end of the line is what is used at
the buffer's line endings.

Unless I'm missing something, the current system is not too
systematic and not too obvious.  \n, \r, or \n\r is clear.  It
even lets you know, for MS DOS/Windows, that the newline comes
before the carriage return, not the reverse (though you probably
don't care).





^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2009-01-02  3:44 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-31 22:50 mode line eol char indication Drew Adams
2009-01-01  1:20 ` Jason Rumney
2009-01-01  5:44   ` Drew Adams
2009-01-01  8:33     ` Stephen J. Turnbull
2009-01-01  8:39       ` Jason Rumney
2009-01-01 18:11         ` Drew Adams
2009-01-01 18:17           ` Juanma Barranquero
2009-01-01 19:14             ` David De La Harpe Golden
2009-01-01 19:25               ` Drew Adams
2009-01-02  3:44                 ` Stefan Monnier
2009-01-01 19:15             ` Drew Adams
2009-01-01 18:11       ` Drew Adams

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).