unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: "Óscar Fuentes" <ofv@wanadoo.es>
To: help-gnu-emacs@gnu.org
Subject: Re: Highlighting a missing final newline?
Date: Tue, 22 Mar 2016 14:57:11 +0100	[thread overview]
Message-ID: <87wpouehu0.fsf@wanadoo.es> (raw)
In-Reply-To: dlcon6FtmquU1@mid.individual.net

egarrulo <egarrulo@gmail.com> writes:

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

If your problem consists on editing files that require to end with a
newline, set `require-final-newline' on the mode hook and forget about
that.




  parent reply	other threads:[~2016-03-22 13:57 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-22 11:30 Highlighting a missing final newline? egarrulo
2016-03-22 11:50 ` Yuri Khan
2016-03-22 13:37   ` egarrulo
2016-03-22 13:49 ` Drew Adams
     [not found] ` <mailman.8110.1458654604.843.help-gnu-emacs@gnu.org>
2016-03-22 13:54   ` egarrulo
2016-03-22 13:57 ` Óscar Fuentes [this message]
2016-03-22 16:21 ` Eli Zaretskii
     [not found] ` <mailman.8133.1458663736.843.help-gnu-emacs@gnu.org>
2016-03-22 16:42   ` egarrulo

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=87wpouehu0.fsf@wanadoo.es \
    --to=ofv@wanadoo.es \
    --cc=help-gnu-emacs@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.
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).