[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Highlighting a missing final newline?
From: |
Yuri Khan |
Subject: |
Re: Highlighting a missing final newline? |
Date: |
Tue, 22 Mar 2016 17:50:25 +0600 |
On Tue, Mar 22, 2016 at 5:30 PM, egarrulo <egarrulo@gmail.com> wrote:
> How would you highlight a missing final newline? I mean: if a buffer lacks
> a final newline, then you would see a (customizable) character at the end of
> the buffer; otherwise, you would see nothing.
>
> AFAIK, `font-lock-add-keywords' can't help here because there is no
> character to highlight. I have looked into `whitespace-mode' for
> inspiration, but the code is too complex for me.
>
> Thank you.
Maybe highlight the last character which is not newline and is
immediately followed by the end of buffer, by regexp ".\'"?