From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Yuri Khan Newsgroups: gmane.emacs.help Subject: Re: Highlighting a missing final newline? Date: Tue, 22 Mar 2016 17:50:25 +0600 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: ger.gmane.org 1458647481 5148 80.91.229.3 (22 Mar 2016 11:51:21 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 22 Mar 2016 11:51:21 +0000 (UTC) Cc: "help-gnu-emacs@gnu.org" To: egarrulo Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Mar 22 12:51:13 2016 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1aiKpv-00028Y-Bw for geh-help-gnu-emacs@m.gmane.org; Tue, 22 Mar 2016 12:50:59 +0100 Original-Received: from localhost ([::1]:35505 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aiKpu-0004P0-Qy for geh-help-gnu-emacs@m.gmane.org; Tue, 22 Mar 2016 07:50:58 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44350) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aiKpk-0004Ou-Af for help-gnu-emacs@gnu.org; Tue, 22 Mar 2016 07:50:49 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aiKpj-0006Q1-G2 for help-gnu-emacs@gnu.org; Tue, 22 Mar 2016 07:50:48 -0400 Original-Received: from mail-lb0-x22f.google.com ([2a00:1450:4010:c04::22f]:33939) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aiKpj-0006Pk-7s for help-gnu-emacs@gnu.org; Tue, 22 Mar 2016 07:50:47 -0400 Original-Received: by mail-lb0-x22f.google.com with SMTP id k12so157642849lbb.1 for ; Tue, 22 Mar 2016 04:50:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=a1oY8AtX1V1Zy5cOyTWWfQLHyQrRNnoZj/hs94LEIhE=; b=MP58EIsFFlHMO7DaglfGmjSeRpmHM+OaeInNSZR2q0nzbvkEoT20V+GT0u/rdJ6jiw FMPdlFu0fGfbppQNq4/52s6kHaECxh9T+FaOHje6jqZ0YFBLtFkEA415Hi960N3/5b4/ k9kerZfOSH0hcqrjSY5HQsHXVBtmveCbxXURpSRPz2ITIdPea5tTlYoW4mvCFqYBXbAa FNBJ6jTDiZ9bQ0lfotW/CBInc2D2bgxFkZFnQdY7g11BiJtLILnG2OkM0vk1m35LHAd5 UEI/uywZa+tyDIfB4ve1xyEzGd7CyEw+q+pCfYQ4XGQ3aNIPUnjEhz8Gk/JK+EnurmX2 5tiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=a1oY8AtX1V1Zy5cOyTWWfQLHyQrRNnoZj/hs94LEIhE=; b=hO6pb9quGuVKR2T3UP6nZ1bZsL60KB0wP0WBFYDLxwsmAVZX9Ho9TmO3TTBz22+jFK wd1p9sF0F0QeDRJYNil0pJs94soHeYVxn+GKXofZgOkWNAN/oUpxF5sjmtykUVNq39sb Gu6SNApqc6JJ/mOM8d40fPtDjm6CYJdKMLDI6+Jzz/l0E3LIeHENB/JfOpcaCKIRv5Z2 YjBOtmT4LDgeVZpn5kefL4QaiW/Yfonaa5hDParH7Hm15H01zmomAlNahRYoiSDhOayi jYB2JgmnQpXlVYidJw9jFnbZyq5Dxe3YZx2Fv7rVS1OAOWww3WoBNyxTLY4tpeWNUdi1 cpGQ== X-Gm-Message-State: AD7BkJJhFmVMtbU2YO47tLhzENLgmCLoN3Ku/RuAFJWZKki2C556Y+2ZNEYrw2SDlUEDtNud9zM+AYiRWA/UgA== X-Received: by 10.112.157.234 with SMTP id wp10mr13585592lbb.56.1458647445733; Tue, 22 Mar 2016 04:50:45 -0700 (PDT) Original-Received: by 10.112.254.164 with HTTP; Tue, 22 Mar 2016 04:50:25 -0700 (PDT) In-Reply-To: X-Google-Sender-Auth: FvlJIirDnckWS-NT4b3tHc3ADvA X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:4010:c04::22f X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:109650 Archived-At: On Tue, Mar 22, 2016 at 5:30 PM, egarrulo 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 ".\'"?