|
From: | Kévin Le Gouguec |
Subject: | bug#41810: [PATCH][ELPA] adaptive-wrap: Fontify wrap-prefix |
Date: | Sun, 21 Jun 2020 17:34:35 +0200 |
User-agent: | Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
OK, here is a patch that I think should be good to push, tested against Emacs 28 and 26.3.
patch1.patch
Description: Text Data
Some before/after screenshots: - patch1-diff-1.png: regular diff, - patch1-diff-2.png: diff with background-less indicator faces, - patch1-nospace-1.png: when (substring fcp -1) is not a space, - patch1-nospace-2.png: likewise.
patch1-diff-1.png
Description: PNG image
patch1-diff-2.png
Description: PNG image
patch1-nospace-1.png
Description: PNG image
patch1-nospace-2.png
Description: PNG image
Screenshots generated with the following scripts:
repro.el
Description: Text Data
repro.sh
Description: application/shellscript
Open questions: - Since "check that a face spans the whole line" is neither straightforward nor sufficient (cf. diff-mode), I went with a fairly naive heuristic. If anyone wants to describe a more sensible algorithm, or point out counter-examples where this logic breaks down, I'm all ears! - The (or … (when … (let … (when (and …))))) chain looks clumsy but I don't really know how to improve it off the top of my head. Maybe a when-let or two would help? That'd mean requiring Emacs 25.1 though. - (More of a nerd-snipe than an actual question, and definitely not related to this bug report, but if any expert on redisplay can look at bug41810-teardown in repro.el and tell me what is up with those pesky scroll bars, I'd be very grateful.) Finally, I'd like to suggest this second patch to apply on top of the first one. I know there is no consensus that spaces are better than (substring fcp -1), but I still can't think of a situation were the latter looks better.
patch2.patch
Description: Text Data
Screenshots:
patch2-nospace-1.png
Description: PNG image
patch2-nospace-2.png
Description: PNG image
Thank you for your patience.
[Prev in Thread] | Current Thread | [Next in Thread] |