GNU bug report logs - #37467
26.3; whitespace-mode doesn't update BOB/EOB highlights

Previous Next

Package: emacs;

Reported by: Dale Sedivec <dale <at> codefu.org>

Date: Fri, 20 Sep 2019 05:31:02 UTC

Severity: normal

Tags: patch

Merged with 42110

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.

Full log


View this message in rfc822 format

From: Richard Hansen <rhansen <at> rhansen.org>
To: 37467 <at> debbugs.gnu.org
Subject: bug#37467: [PATCH] whitespace: Redo BoB/EoB empty line highlighting
Date: Wed, 29 Jun 2022 17:28:16 -0400
[Message part 1 (text/plain, inline)]
The attached patch series should fix this bug.

Patch 1:

    ert-x: New `ert-with-test-buffer-selected' convenience macro

    * lisp/emacs-lisp/ert-x.el (ert-with-test-buffer-selected): New
    convenience macro that extends `ert-with-test-buffer' by displaying
    the test buffer in a temporary selected window.  This makes it easier
    to simulate user input in the body via `execute-kbd-macro'.
    * test/lisp/emacs-lisp/ert-x-tests.el
    (ert-test-test-buffer-selected/*): Add tests.

Patch 2:

    ; whitespace: Delete unused `whitespace-font-lock-refontify' var

Patch 3:

    ; whitespace: Use `defvar-local' for buffer-local vars

Patch 4:

    ; whitespace: Fix indentation

Patch 5:

    whitespace: Reset `whitespace-buffer-changed' when refontifying

    * lisp/whitespace.el (whitespace-post-command-hook): Add missing reset
    of `whitespace-buffer-changed' back to nil between commands.

Patch 6:

    whitespace: Include empty final line in BoB empty match

    * lisp/whitespace.el (whitespace-empty-at-bob-regexp): Include any
    last line trailing whitespace in the BoB empty line match to ensure
    that those characters get highlighted.

Patch 7:

    whitespace: Redo BoB/EoB empty line highlighting

    * lisp/whitespace.el (whitespace--empty-at-bob-matcher,
    whitespace--empty-at-eob-matcher, whitespace--update-bob-eob,
    whitespace-color-off, whitespace-color-on,
    whitespace-empty-at-bob-regexp, whitespace-empty-at-eob-regexp,
    whitespace-looking-back, whitespace-post-command-hook): Redo the
    `empty' line highlighting logic to ensure that a buffer change causes
    all affected `empty' lines to become (un)highlighted (bug#37467).
    Also, for improved UX, don't highlight BoB empty lines at or below
    point (not just when point is at 1), or EoB empty lines at or above
    point (not just when point is `eobp').
    (whitespace-bob-marker, whitespace-eob-marker): Clarify documentation.
    * test/lisp/whitespace-tests.el (whitespace--with-test-buffer,
    whitespace--fu, whitespace-tests--empty-bob,
    whitespace-tests--empty-eob): Add tests.
[0001-ert-x-New-ert-with-test-buffer-selected-convenience-.patch (text/x-patch, attachment)]
[0002-whitespace-Delete-unused-whitespace-font-lock-refont.patch (text/x-patch, attachment)]
[0003-whitespace-Use-defvar-local-for-buffer-local-vars.patch (text/x-patch, attachment)]
[0004-whitespace-Fix-indentation.patch (text/x-patch, attachment)]
[0005-whitespace-Reset-whitespace-buffer-changed-when-refo.patch (text/x-patch, attachment)]
[0006-whitespace-Include-empty-final-line-in-BoB-empty-mat.patch (text/x-patch, attachment)]
[0007-whitespace-Redo-BoB-EoB-empty-line-highlighting.patch (text/x-patch, attachment)]
[OpenPGP_signature (application/pgp-signature, attachment)]

This bug report was last modified 2 years and 248 days ago.

Previous Next


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