GNU bug report logs - #42110
Whitespace Newline Face Doesn't Disappear

Previous Next

Package: emacs;

Reported by: Robin <robin_choudhury1 <at> protonmail.com>

Date: Sun, 28 Jun 2020 15:51:02 UTC

Severity: normal

Tags: patch

Merged with 37467

Found in versions 25.3, 26.3

Fixed in version 29.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 42110 in the body.
You can then email your comments to 42110 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#42110; Package emacs. (Sun, 28 Jun 2020 15:51:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Robin <robin_choudhury1 <at> protonmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sun, 28 Jun 2020 15:51:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Robin <robin_choudhury1 <at> protonmail.com>
To: "bug-gnu-emacs <at> gnu.org" <bug-gnu-emacs <at> gnu.org>
Subject: Whitespace Newline Face Doesn't Disappear
Date: Sun, 28 Jun 2020 15:37:01 +0000
[Message part 1 (text/plain, inline)]
From: Robin Choudhury <robin_choudhury1 <at> protonmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 26.3; Whitespace Newline Face Doesn't Disappear
-----

When typing at the bottom of a document, a newline is inserted. An
additional newline is then inserted. Upon insertion, a face higlights
the first newline's emptiness. Typing in the second newline should make
this face disappear. However, it remains.

The whitespace configuration (13.2.2):
(use-package whitespace
:ensure t
:init
(setq prelude-whitespace nil)
(setq whitespace-line-column 80)
;; Highlight trailing whitespace
(setq whitespace-style
;; There's a bug in empty where the face doesn't go away after
;; typing below the newline.
'(face trailing lines-tail indentation::space tab-mark empty))
:config
(global-whitespace-mode t))

-----

In GNU Emacs 26.3 (build 1, x86_64-apple-darwin19.5.0, NS appkit-1894.50 Version 10.15.5 (Build 19F101))
of 2020-06-27 built on jupiter.local
Windowing system distributor 'Apple', version 10.3.1894
Recent messages:
Checking for load-path shadows...done
Auto-saving...done
Saving file /Users/robin/*message*-20200628-083045...
Wrote /Users/robin/*message*-20200628-083045
Auto-saving...done
Quit [2 times]
Mark saved where search started [2 times]
Saving file /Users/robin/*message*-20200628-083045...
Wrote /Users/robin/*message*-20200628-083045
Mark saved where search started [2 times]

Configured using:
'configure --disable-dependency-tracking --disable-silent-rules
--enable-locallisppath=/usr/local/share/emacs/site-lisp
--infodir=/usr/local/Cellar/emacs-plus <at> 26/26.3/share/info/emacs
--prefix=/usr/local/Cellar/emacs-plus <at> 26/26.3 --with-xml2 --with-gnutls
--with-imagemagick --with-modules --with-rsvg --with-ns
--disable-ns-self-contained'

Configured features:
JPEG RSVG IMAGEMAGICK GLIB NOTIFY ACL GNUTLS LIBXML2 ZLIB
TOOLKIT_SCROLL_BARS NS MODULES THREADS LCMS2

Important settings:
value of $LANG: en_US.UTF-8
locale-coding-system: utf-8-unix

Major mode: Help

Minor modes in effect:
projectile-mode: t
doom-modeline-mode: t
helm-mode: t
helm--remap-mouse-mode: t
evil-leader-mode: t
global-magit-file-mode: t
diff-auto-refine-mode: t
magit-auto-revert-mode: t
global-git-commit-mode: t
async-bytecomp-package-mode: t
global-undo-tree-mode: t
undo-tree-mode: t
shell-dirtrack-mode: t
evil-mode: t
evil-local-mode: t
global-whitespace-mode: t
show-paren-mode: t
mode-icons-mode: t
global-hl-line-mode: t
global-hl-todo-mode: t
display-time-mode: t
global-linum-mode: t
linum-mode: t
override-global-mode: t
tooltip-mode: t
global-eldoc-mode: t
electric-indent-mode: t
mouse-wheel-mode: t
file-name-shadow-mode: t
global-font-lock-mode: t
font-lock-mode: t
auto-composition-mode: t
auto-encryption-mode: t
auto-compression-mode: t
buffer-read-only: t
column-number-mode: t
line-number-mode: t
transient-mark-mode: t

Load-path shadows:
None found.

Features:
(misearch multi-isearch pp shadow sort mail-extr emacsbug sendmail
winner helm-command helm-elisp helm-eval edebug helm-info face-remap
org-rmail org-mhe org-irc org-info org-gnus nnir gnus-sum gnus-group
gnus-undo gnus-start gnus-cloud nnimap nnmail mail-source tls gnutls
utf7 netrc nnoo parse-time gnus-spec gnus-int gnus-range gnus-win gnus
nnheader wid-edit org-docview doc-view jka-compr image-mode org-bibtex
bibtex org-bbdb org-w3m vc-git vc-bzr vc-src vc-sccs vc-svn vc-cvs
vc-rcs vc vc-dispatcher project ido projectile grep compile ibuf-ext
ibuffer ibuffer-loaddefs rainbow-delimiters elec-pair doom-modeline
doom-modeline-segments doom-modeline-env doom-modeline-core shrink-path
rx f s all-the-icons all-the-icons-faces data-material data-weathericons
data-octicons data-fileicons data-faicons data-alltheicons memoize
exec-path-from-shell diminish helm-mode helm-files helm-buffers
helm-occur helm-tags helm-locate helm-grep helm-regexp helm-utils
helm-help helm-types helm helm-source eieio-compat helm-multi-match
helm-lib org-bullets org-element avl-tree generator org org-macro
org-footnote org-pcomplete org-list org-faces org-entities noutline
outline org-version ob-emacs-lisp ob ob-tangle org-src ob-ref ob-lob
ob-table ob-keys ob-exp ob-comint ob-core ob-eval org-compat org-macs
org-loaddefs find-func cal-menu calendar cal-loaddefs evil-leader
evil-magit magit-submodule magit-obsolete magit-blame magit-stash
magit-reflog magit-bisect magit-push magit-pull magit-fetch magit-clone
magit-remote magit-commit magit-sequence magit-notes magit-worktree
magit-tag magit-merge magit-branch magit-reset magit-files magit-refs
magit-status magit magit-repos magit-apply magit-wip magit-log
which-func imenu magit-diff smerge-mode diff-mode magit-core
magit-autorevert autorevert filenotify magit-margin magit-transient
magit-process magit-mode git-commit transient magit-git magit-section
magit-utils crm log-edit message rmc puny dired dired-loaddefs
format-spec rfc822 mml mml-sec epa derived epg gnus-util rmail
rmail-loaddefs mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047
rfc2045 mm-util ietf-drums mail-prsvr mailabbrev mail-utils gmm-utils
mailheader pcvs-util add-log with-editor async-bytecomp async server
subr-x dash evil evil-keybindings evil-integration undo-tree diff
evil-maps evil-commands reveal flyspell ispell evil-jumps
evil-command-window evil-types evil-search evil-ex shell pcomplete
comint ansi-color evil-macros evil-repeat evil-states evil-core
evil-common windmove thingatpt rect evil-digraphs evil-vars ring edmacro
kmacro doom-oceanic-next-theme doom-themes doom-themes-base disp-table
whitespace paren time-date warnings mode-icons advice color hl-line
hl-todo cl-extra help-mode time linum use-package use-package-ensure
use-package-delight use-package-diminish use-package-bind-key bind-key
easy-mmode use-package-core finder-inf info package easymenu epg-config
url-handlers url-parse auth-source cl-seq eieio eieio-core cl-macs
eieio-loaddefs password-cache url-vars seq byte-opt gv bytecomp
byte-compile cconv cl-loaddefs cl-lib tooltip eldoc electric uniquify
ediff-hook vc-hooks lisp-float-type mwheel term/ns-win ns-win
ucs-normalize mule-util term/common-win tool-bar dnd fontset image
regexp-opt fringe tabulated-list replace newcomment text-mode elisp-mode
lisp-mode prog-mode register page menu-bar rfn-eshadow isearch timer
select scroll-bar mouse jit-lock font-lock syntax facemenu font-core
term/tty-colors frame cl-generic cham georgian utf-8-lang misc-lang
vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932
hebrew greek romanian slovak czech european ethiopic indian cyrillic
chinese composite charscript charprop case-table epa-hook jka-cmpr-hook
help simple abbrev obarray minibuffer cl-preloaded nadvice loaddefs
button faces cus-face macroexp files text-properties overlay sha1 md5
base64 format env code-pages mule custom widget hashtable-print-readable
backquote threads kqueue cocoa ns lcms2 multi-tty make-network-process
emacs)

Memory information:
((conses 16 738153 45480)
(symbols 48 51716 2)
(miscs 40 668 440)
(strings 32 190321 8761)
(string-bytes 1 5406976)
(vectors 16 84206)
(vector-slots 8 1287169 41462)
(floats 8 980 400)
(intervals 56 2014 1003)
(buffers 992 20))
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#42110; Package emacs. (Sun, 28 Jun 2020 16:29:02 GMT) Full text and rfc822 format available.

Message #8 received at 42110 <at> debbugs.gnu.org (full text, mbox):

From: "Basil L. Contovounesios" <contovob <at> tcd.ie>
To: 42110 <at> debbugs.gnu.org
Cc: Robin <robin_choudhury1 <at> protonmail.com>, Reuben Thomas <rrt <at> sc3d.org>
Subject: Re: bug#42110: Whitespace Newline Face Doesn't Disappear
Date: Sun, 28 Jun 2020 17:28:20 +0100
found 37467 25.3
forcemerge 37467 42110
quit

> From: Robin Choudhury <robin_choudhury1 <at> protonmail.com>
> To: bug-gnu-emacs <at> gnu.org
> Subject: 26.3; Whitespace Newline Face Doesn't Disappear
> -----
>
> When typing at the bottom of a document, a newline is inserted. An
> additional newline is then inserted. Upon insertion, a face higlights
> the first newline's emptiness. Typing in the second newline should make
> this face disappear. However, it remains.

Thanks, I can reproduce this in Emacs versions 25.3-28 inclusive, but
not in 24.5.  I think this is a duplicate of bug#37467, and sounds like
it might be related/due to bug#24745; CCing Reuben.

Some minor notes on your configuration:

> The whitespace configuration (13.2.2):
> (use-package whitespace
>   :ensure t
    ^^^^^^^^^
No need for this, lisp/whitespace.el is built-in.

>   :init
>   (setq prelude-whitespace nil)
>   (setq whitespace-line-column 80)
>   ;; Highlight trailing whitespace
>   (setq whitespace-style
>         ;; There's a bug in empty where the face doesn't go away after
>         ;; typing below the newline.
>         '(face trailing lines-tail indentation::space tab-mark empty))
>   :config
>   (global-whitespace-mode t))
                           ^^^
No well behaved mode function documents t as a valid argument for
enabling it.  Instead, you should write one of the following or
equivalent:

  (global-whitespace-mode)
  (global-whitespace-mode 1)

Here's a simpler reproduction recipe:

0. emacs -Q
1. C-o
2. (progn (setq whitespace-style '(face empty))
          (whitespace-mode))
3. C-x C-e
4. C-m C-m
5. asd

Expected: the yellow highlight on the empty line 6 disappears, since
line 6 is not at EOB any longer.

Observed: the empty line 6 is still highlighted with the
whitespace-empty face.

Thanks,

-- 
Basil




Forcibly Merged 37467 42110. Request was from "Basil L. Contovounesios" <contovob <at> tcd.ie> to control <at> debbugs.gnu.org. (Sun, 28 Jun 2020 16:29:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#42110; Package emacs. (Sun, 28 Jun 2020 17:22:02 GMT) Full text and rfc822 format available.

Message #13 received at 42110 <at> debbugs.gnu.org (full text, mbox):

From: "Basil L. Contovounesios" <contovob <at> tcd.ie>
To: Robin <robin_choudhury1 <at> protonmail.com>
Cc: 42110 <at> debbugs.gnu.org
Subject: Re: bug#42110: Whitespace Newline Face Doesn't Disappear
Date: Sun, 28 Jun 2020 18:21:42 +0100
Robin <robin_choudhury1 <at> protonmail.com> writes:

>> 0. emacs -Q
>> 1. C-o
>> 2. (progn (setq whitespace-style '(face empty))
>>           (whitespace-mode))
>> 3. C-x C-e
>> 4. C-m C-m
>> 5. asd
>
> I was able to reproduce it (screenshot attached).

Thanks for confirming.

[ In general, please keep the bug address <42110 <at> debbugs.gnu.org> CCed
  (e.g. via "Reply to All") so that all relevant parts of the discussion
  are archived by the bug tracker.  Thanks.  ]

-- 
Basil




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#42110; Package emacs. (Sun, 28 Jun 2020 18:10:01 GMT) Full text and rfc822 format available.

Message #16 received at 42110 <at> debbugs.gnu.org (full text, mbox):

From: Reuben Thomas <rrt <at> sc3d.org>
To: "Basil L. Contovounesios" <contovob <at> tcd.ie>
Cc: Robin <robin_choudhury1 <at> protonmail.com>, 42110 <at> debbugs.gnu.org
Subject: Re: bug#42110: Whitespace Newline Face Doesn't Disappear
Date: Sun, 28 Jun 2020 19:08:58 +0100
[Message part 1 (text/plain, inline)]
On Sun, 28 Jun 2020 at 17:28, Basil L. Contovounesios <contovob <at> tcd.ie>
wrote:

> found 37467 25.3
> forcemerge 37467 42110
> quit
>
> > From: Robin Choudhury <robin_choudhury1 <at> protonmail.com>
> > To: bug-gnu-emacs <at> gnu.org
> > Subject: 26.3; Whitespace Newline Face Doesn't Disappear
> > -----
> >
> > When typing at the bottom of a document, a newline is inserted. An
> > additional newline is then inserted. Upon insertion, a face higlights
> > the first newline's emptiness. Typing in the second newline should make
> > this face disappear. However, it remains.
>
> Thanks, I can reproduce this in Emacs versions 25.3-28 inclusive, but
> not in 24.5.  I think this is a duplicate of bug#37467, and sounds like
> it might be related/due to bug#24745; CCing Reuben.
>

Sorry, I had a look at this and can see how it is related to the bug I
fixed, but can't see how, before the fix, the unhighlighting would have
happened, i.e. how space highlighted at the end of the document would have
been unhighlighted after inserting characters at EOB.

I suppose that would be the logic in the function
whitespace-empty-at-eob-regexp? I don't understand how regions are
un-highlighted in this mode/in font-lock, though.

-- 
https://rrt.sc3d.org
[Message part 2 (text/html, inline)]

Added tag(s) patch. Request was from Richard Hansen <rhansen <at> rhansen.org> to control <at> debbugs.gnu.org. (Sun, 17 Jul 2022 05:42:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#42110; Package emacs. (Sun, 11 Sep 2022 11:47:02 GMT) Full text and rfc822 format available.

Message #21 received at 42110 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Richard Hansen <rhansen <at> rhansen.org>
Cc: 37467 <at> debbugs.gnu.org, 42110 <at> debbugs.gnu.org
Subject: Re: bug#42110: Whitespace Newline Face Doesn't Disappear
Date: Sun, 11 Sep 2022 13:46:14 +0200
Richard Hansen <rhansen <at> rhansen.org> writes:

> The attached patch series should fix this bug.

Thanks.  I've now tested the patch series, and it seems to fix the
reported problems, so I've now pushed it to Emacs 29.




bug marked as fixed in version 29.1, send any further explanations to 42110 <at> debbugs.gnu.org and Robin <robin_choudhury1 <at> protonmail.com> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sun, 11 Sep 2022 11:47:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 10 Oct 2022 11:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 171 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.