help-gnu-emacs
[Top][All Lists]
Advanced

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

RE: end of line symbol


From: Drew Adams
Subject: RE: end of line symbol
Date: Sat, 3 Dec 2005 07:17:35 -0800

    >   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 via email to

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