unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: "Drew Adams" <drew.adams@oracle.com>
Subject: RE: end of line symbol
Date: Sat, 3 Dec 2005 07:17:35 -0800	[thread overview]
Message-ID: <DNEMKBNJBGPAOPIJOOICAEKECPAA.drew.adams@oracle.com> (raw)
In-Reply-To: <umzjisfrm.fsf@gnu.org>

    >   I would like to see where the end of line
    > characters are. That is, at the end of lines
    > a pilcrow sign (\P in TeX) would be nice.
    >
    >   How can it be done?

    I don't think there is such a feature, because Emacs solves this the
    other way around: it can show you the trailing whitespace, so that you
    know where the last non-whitespace character of a line is NOT the end
    of the line.  The feature that shows trailing whitespace is optional;
    you can turn it on by setting the variable show-trailing-whitespace to
    non-nil value in the buffers you want to see that.

Let us know about your use case - why do you want to see the newline
character?

Perhaps you are used to word-processing applications where text is not
divided into lines but into paragraphs, and the pilcrow tells you where the
paragraph ends. In such apps, you often must make sure to select the pilcrow
along with the paragraph text, in order to be sure to have selected the
paragraph entity (structure).

In Emacs, text is usually divided by newline characters - it doesn't need to
be, but it often is. That is, it is divided into lines - the newline
characters (Control-J) separate the lines. The same principle is in effect:
you can select the text in a line with or without the newline character at
its end. Commands like `kill-line' (bound to `C-k') normally include the
newline in the selection, but there are sometimes user options for
controlling this.

If you want to _see_ the newline characters, just look at them: whenever you
see a visible line break, there is a (single) newline character. (In some
modes, such as longlines, some of those newline characters might be
temporary, for display and editing purposes, and be removed upon saving to a
file.) If you drag your mouse across a line, that selects the line text. If
you continue to drag the mouse down slightly and toward the beginning of the
next line, you'll select the newline also - and you will see that the region
highlighting extends from the end of the line text to the edge of the
window.

If you want to search for a newline character, use `C-s C-q C-j'. If you
want to highlight trailing whitespace _besides_ the newline character, do as
Eli suggested above.

In sum, a visible line break shows you a newline character. You can select
it or not, when you select line text.

There is, as far as I know, no out-of-the-box way to show newlines with a
special symbol (as opposed to showing them as line breaks), but that could
easily be written. It hasn't been done, probably, because it's not that
useful in Emacs - Emacs is different from paragraph-oriented word
processors, as mentioned above.

HTH.

  reply	other threads:[~2005-12-03 15:17 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-03  6:35 end of line symbol Emabela
2005-12-03  9:15 ` Eli Zaretskii
2005-12-03 15:17   ` Drew Adams [this message]
     [not found] <mailman.17741.1133591721.20277.help-gnu-emacs@gnu.org>
2005-12-03 15:53 ` Johan Bockgård
2005-12-03 20:48   ` Johan Bockgård
  -- strict thread matches above, loose matches on Subject: below --
2005-12-03 20:27 Emabela

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=DNEMKBNJBGPAOPIJOOICAEKECPAA.drew.adams@oracle.com \
    --to=drew.adams@oracle.com \
    /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.
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).