all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Drew Adams" <drew.adams@oracle.com>
To: <emacs-devel@gnu.org>
Subject: mode line eol char indication
Date: Wed, 31 Dec 2008 14:50:12 -0800	[thread overview]
Message-ID: <005701c96b9a$243839d0$c2b22382@us.oracle.com> (raw)

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).





             reply	other threads:[~2008-12-31 22:50 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-31 22:50 Drew Adams [this message]
2009-01-01  1:20 ` mode line eol char indication 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='005701c96b9a$243839d0$c2b22382@us.oracle.com' \
    --to=drew.adams@oracle.com \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.