From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: "Basil L. Contovounesios" Newsgroups: gmane.emacs.bugs Subject: bug#34952: files with/out final newline look the same no matter what Date: Sun, 24 Mar 2019 01:07:26 +0000 Message-ID: <87zhpl13n5.fsf@tcd.ie> References: <87zhpm18ll.fsf@jidanni.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="246589"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: 34952@debbugs.gnu.org To: =?UTF-8?Q?=E7=A9=8D=E4=B8=B9=E5=B0=BC?= Dan Jacobson Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Mar 24 02:08:15 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h7rcS-00120d-DZ for geb-bug-gnu-emacs@m.gmane.org; Sun, 24 Mar 2019 02:08:12 +0100 Original-Received: from localhost ([127.0.0.1]:50089 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h7rcR-0006u2-7J for geb-bug-gnu-emacs@m.gmane.org; Sat, 23 Mar 2019 21:08:11 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:44863) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h7rcJ-0006tl-Kp for bug-gnu-emacs@gnu.org; Sat, 23 Mar 2019 21:08:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h7rcI-0005fj-Is for bug-gnu-emacs@gnu.org; Sat, 23 Mar 2019 21:08:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:42378) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h7rcI-0005fI-3p for bug-gnu-emacs@gnu.org; Sat, 23 Mar 2019 21:08:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1h7rcH-0003xn-Pr for bug-gnu-emacs@gnu.org; Sat, 23 Mar 2019 21:08:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: "Basil L. Contovounesios" Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 24 Mar 2019 01:08:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 34952 X-GNU-PR-Package: emacs Original-Received: via spool by 34952-submit@debbugs.gnu.org id=B34952.155338965815200 (code B ref 34952); Sun, 24 Mar 2019 01:08:01 +0000 Original-Received: (at 34952) by debbugs.gnu.org; 24 Mar 2019 01:07:38 +0000 Original-Received: from localhost ([127.0.0.1]:55922 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h7rbu-0003x6-18 for submit@debbugs.gnu.org; Sat, 23 Mar 2019 21:07:38 -0400 Original-Received: from mail-ed1-f44.google.com ([209.85.208.44]:43224) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h7rbr-0003ws-OT for 34952@debbugs.gnu.org; Sat, 23 Mar 2019 21:07:36 -0400 Original-Received: by mail-ed1-f44.google.com with SMTP id d26so4631554ede.10 for <34952@debbugs.gnu.org>; Sat, 23 Mar 2019 18:07:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tcd-ie.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=iGLegwU+PU0gbLw8bqWYShucadr7CL8bXlzQYWcRITY=; b=A0UYrtuLQ11cYCqOpTt75GHtL82YA9IclN59BdyC16RME/ANPYbcA/JtUmXgaTOwBu WxPZth/hECWpBHb+Ga1ib1NA6dhWjaW0HjrDUmrIo+d5EXrakX3aNI9ErzXqtCtMp0Nl YTo6tVzPkk0eXwWJ7CAO1hfGmdRqOYrOM40UvacUxIAALOYJCp4EnN21c8ALYdN5uFxC KsihJbV8HqZD5SjYUiGUZC8tnafh4bMUdbaUneZrWgq3QcsaDGfUxLEuSD5/qkaf3g+4 PqeCNrI8crDLk1PSsAiE3kPjCVJhWgcsyXZGe5rT21YtHpvt8rWInhs/2soXohJmLgtV 7PxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=iGLegwU+PU0gbLw8bqWYShucadr7CL8bXlzQYWcRITY=; b=csLRi7pZzD86cOGvEKiE4ODUnRlYzUFxQBIi4+xOdwKVYZslBqkbudgFkKZuABkmgm rxMHzCd+1FlD1pMRPs77hZRb/PVwPopoHrGegnnMG6ulCLExU0FBVbUxoqYK1L0+RxzT LUF2dnJMLh4elHrhfQhZgt5H6gSx2DSbottdS5buJNmkX3d4n8z7GmujhayqsE7mQH86 MYGSssVm79JzQ/p6alhEBLqFLzYixWZFN5IwdPiM8JMLOlCkEP0n5bNb4urUpnFZoZk0 qVAUP1Di6+IQLjPRSuqwBZKKW5vsENXYuM4NVEa5gfr72c97qORlFW74QmcE1NCHl9JT BfXQ== X-Gm-Message-State: APjAAAVIARW/TqotbCMexY37nJApwsRm2MZbHTp9zO4oZlArbuFqK8hW EWMNcUCbNTsZHzsM/uMrOjFiwDkwPcw= X-Google-Smtp-Source: APXvYqzSccG4dOWliW4Z2qgnyNSZd8R+2EauPWpkh5JnfqJoUKQD0zfBTqDK9E2z1vKZcbd5VPrJnw== X-Received: by 2002:a17:906:c9d0:: with SMTP id hk16mr9656141ejb.220.1553389649836; Sat, 23 Mar 2019 18:07:29 -0700 (PDT) Original-Received: from localhost ([2a02:8084:20e2:c380:20c2:134e:4f3a:683a]) by smtp.gmail.com with ESMTPSA id d37sm4168016ede.79.2019.03.23.18.07.28 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Sat, 23 Mar 2019 18:07:29 -0700 (PDT) In-Reply-To: <87zhpm18ll.fsf@jidanni.org> ("=?UTF-8?Q?=E7=A9=8D=E4=B8=B9=E5=B0=BC?= Dan Jacobson"'s message of "Sat, 23 Mar 2019 13:08:06 +0800") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:156682 Archived-At: =E7=A9=8D=E4=B8=B9=E5=B0=BC Dan Jacobson writes: > indicate-empty-lines is great, but still doesn't show the user the differ= ence between > $ echo abcd > fileA > $ echo -n abcd > fileB > $ emacs file* > Therefore some new variable is needed. > No I'm not talking about writing files, I'm just talking about how they > look when opened. I know and make use of two different customisations to indicate missing newlines at EOF. The first is built-in and (probably) more subtle/elegant/efficient, but relies on the fringe, so only works on graphical frames: (setq-default indicate-buffer-boundaries t) See (info "(emacs) Displaying Boundaries") and (info "(elisp) Fringe Indicators") for details and variations of this feature. The second uses font-lock-mode via hi-lock-mode. You can configure font-lock-mode to highlight missing EOF newlines directly, without relying on hi-lock-mode, but the latter conveniently provides the global minor mode global-hi-lock-mode and blacklist hi-lock-exclude-modes for easy customisation. Here are the incantations: (defun my-hi-lock-no-eof-nl () "Highlight missing trailing EOF newlines." (setf (alist-get "^.+\\'" hi-lock-interactive-patterns nil nil #'equal) '(0 'trailing-whitespace prepend))) (add-hook 'hi-lock-mode-hook #'my-hi-lock-no-eof-nl) (global-hi-lock-mode) You can, of course, change trailing-whitespace to a face of your choosing. See (info "(emacs) Highlight Interactively") for more information on hi-lock-mode. Having said all this, I still think it would be nice to add a whitespace-style setting which visualised missing EOF newlines. --=20 Basil