I have a simple text file which has contents from the web copied into it and today I found a line where there was something like a red underline character (_) at some location. I guess it shows an undisplayable whitespace or other character. Is that right?

I wanted to go back to fix that line later, but I forgot to note down the location and now I cannot find it in the big text file.

What do those red underline characters mean and how can I find those locations in a big text file?

  • Maybe helpful: emacswiki.org/emacs/FindingNonAsciiCharacters
    – Tyler
    Jan 7 at 15:22
  • 2
    A character with a red underline could be due to any number of things. It's likely a buffer character with a text property that specifies a red underline attribute. What such "highlighting" actually means, and what causes it, depends on the context. You've specified nothing about the context, so the question is unclear. The question should be closed, unless you can provide more context. Even with an accepted answer, the question isn't useful to others, as it stands now.
    – Drew
    Jan 7 at 15:47
  • @Drew it's a simple text file, I added it to the question text. So there were no additional syntax rules for this file and it was obvious that that read underline character was indication of some unusual thing.
    – Tom
    Jan 7 at 17:56

2 Answers 2


Maybe, these characters are non breakable characters :


You can do a search on it. C-s , C-x 8 <space> .

  • That looks like it. Your search did find them. Thanks!
    – Tom
    Jan 7 at 15:44

[Not a direct answer to your question - but a useful technique nevertheless]

If you place your cursor on any character (including such "invisible characters") and do C-u C-x = (i.e. call the command what-cursor-position with a prefix argument, you get a help page that gives you most (all?) the information that emacs knows about the character at that position:

             position: 24 of 29 (79%), column: 23
            character:   (displayed as  ) (codepoint 160, #o240, #xa0)
              charset: unicode-bmp (Unicode Basic Multilingual Plane (U+0000..U+FFFF))
code point in charset: 0xA0
               script: latin
               syntax:      which means: whitespace
             category: .:Base, b:Arabic, j:Japanese, l:Latin
             to input: type "C-x 8 RET a0" or "C-x 8 RET NO-BREAK SPACE"
          buffer code: #xC2 #xA0
            file code: #xC2 #xA0 (encoded by coding system utf-8-unix)
              display: by this font (glyph code):
    x:-misc-fixed-medium-r-normal--15-140-75-75-c-90-iso8859-1 (#xA0)
       hardcoded face: nobreak-space

Character code properties: customize what to show
  general-category: Zs (Separator, Space)
  decomposition: (noBreak 32) (noBreak ' ')

You should probably add C-u C-x = to your tool arsenal: it comes in handy very often, particularly when you are scratching your head about something weird happening and you want to dig in a bit deeper.

  • Thanks, it's useful. But the problem was I forgot the location in the file and I wanted to find it again to take a look at it when I had the time, but I couldn't find it again, so that was the main problem.
    – Tom
    Jan 7 at 17:57
  • 1
    Yes, I saw that. This is to be used on first encounter since you need access to the character. It will not help you find it in the buffer later unless you know what it is.
    – NickD
    Jan 7 at 18:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.