GNU bug report logs - #41810
28.0.50; [ELPA] adaptive-wrap: Fontify wrap-prefix

Previous Next

Package: emacs;

Reported by: Kévin Le Gouguec <kevin.legouguec <at> gmail.com>

Date: Thu, 11 Jun 2020 16:18:01 UTC

Severity: normal

Tags: fixed, patch

Found in version 28.0.50

Fixed in version 28.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: Kévin Le Gouguec <kevin.legouguec <at> gmail.com>
To: 41810 <at> debbugs.gnu.org
Cc: Stephen Berman <stephen.berman <at> gmx.net>, Stefan Monnier <monnier <at> iro.umontreal.ca>
Subject: bug#41810: [PATCH][ELPA] adaptive-wrap: Fontify wrap-prefix
Date: Sun, 21 Jun 2020 17:34:35 +0200
[Message part 1 (text/plain, inline)]
OK, here is a patch that I think should be good to push, tested against
Emacs 28 and 26.3.

[patch1.patch (text/x-patch, attachment)]
[Message part 3 (text/plain, inline)]
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 (image/png, attachment)]
[patch1-diff-2.png (image/png, attachment)]
[patch1-nospace-1.png (image/png, attachment)]
[patch1-nospace-2.png (image/png, attachment)]
[Message part 8 (text/plain, inline)]
Screenshots generated with the following scripts:

[repro.el (text/x-emacs-lisp, attachment)]
[repro.sh (application/x-shellscript, attachment)]
[Message part 11 (text/plain, inline)]
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 (text/x-patch, attachment)]
[Message part 13 (text/plain, inline)]
Screenshots:

[patch2-nospace-1.png (image/png, attachment)]
[patch2-nospace-2.png (image/png, attachment)]
[Message part 16 (text/plain, inline)]
Thank you for your patience.

This bug report was last modified 4 years and 278 days ago.

Previous Next


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