|
From: | Richard Hansen |
Subject: | bug#37467: [PATCH] whitespace: Redo BoB/EoB empty line highlighting |
Date: | Wed, 29 Jun 2022 17:28:16 -0400 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 |
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
Description: Text Data
0002-whitespace-Delete-unused-whitespace-font-lock-refont.patch
Description: Text Data
0003-whitespace-Use-defvar-local-for-buffer-local-vars.patch
Description: Text Data
0004-whitespace-Fix-indentation.patch
Description: Text Data
0005-whitespace-Reset-whitespace-buffer-changed-when-refo.patch
Description: Text Data
0006-whitespace-Include-empty-final-line-in-BoB-empty-mat.patch
Description: Text Data
0007-whitespace-Redo-BoB-EoB-empty-line-highlighting.patch
Description: Text Data
OpenPGP_signature
Description: OpenPGP digital signature
[Prev in Thread] | Current Thread | [Next in Thread] |