emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#41810: Tweaking adaptive-wrap


From: Kévin Le Gouguec
Subject: bug#41810: Tweaking adaptive-wrap
Date: Fri, 14 Aug 2020 23:15:09 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Hello Emacs,

adaptive-wrap is a GNU ELPA package that adds a wrap-prefix property to
continuation lines to make them look like they have been filled with
M-q.  For example, it makes this…

    ; Here is a long Elisp comment
    with its continuation line.

… look like this:

    ; Here is a long Elisp comment
    ; with its continuation line.

The second "; " is not part of the buffer text: it is the wrap-prefix
computed by adaptive-wrap.  This prefix can be customized with the
integer variable adaptive-wrap-extra-indent, which adds (if positive) or
takes off (if negative) some extra padding.

In bug#41810, I tried to tackle the following issues:

1. The extra-indent character is not fontified:
<https://debbugs.gnu.org/cgi/bugreport.cgi?att=1;bug=41810;filename=1-extra-indent.png;msg=5>

2. The prefix has no background, which makes lines with :extend'ed
   backgrounds visually jarring:
<https://debbugs.gnu.org/cgi/bugreport.cgi?msg=5;filename=2-extend-t-current.png;bug=41810;att=3>

I proposed (and Stefan and Basil kindly reviewed) two patches:

1. One to fix those two bugs:

Attachment: patch1.patch
Description: Text Data

Screenshots:
<https://debbugs.gnu.org/cgi/bugreport.cgi?att=3;bug=41810;filename=patch1-diff-1.png;msg=20>
<https://debbugs.gnu.org/cgi/bugreport.cgi?att=4;bug=41810;filename=patch1-diff-2.png;msg=20>
<https://debbugs.gnu.org/cgi/bugreport.cgi?att=5;bug=41810;filename=patch1-nospace-1.png;msg=20>
<https://debbugs.gnu.org/cgi/bugreport.cgi?att=6;bug=41810;filename=patch1-nospace-2.png;msg=20>

2. One to only ever use spaces for positive extra-indentation:

Attachment: patch2.patch
Description: Text Data

Screenshots:
<https://debbugs.gnu.org/cgi/bugreport.cgi?msg=20;bug=41810;filename=patch2-nospace-1.png;att=13>
<https://debbugs.gnu.org/cgi/bugreport.cgi?msg=20;bug=41810;filename=patch2-nospace-2.png;att=14>


Lars squashed those two patches and applied them to elpa.git.  Before
bumping the version number (and therefore releasing a new version), it'd
be great if people could either

1. review the patches some more: e.g. does the logic in
   adaptive-wrap--prefix-face sound OK, or is it completely bonkers?

2. try the changes and tell us if something broke horribly; if you don't
   have elpa.git cloned, you can get the latest adaptive-wrap.el here:

   
https://git.savannah.gnu.org/cgit/emacs/elpa.git/plain/packages/adaptive-wrap/adaptive-wrap.el

   Then run emacs -L /path/to/adaptive-wrap-dir.


Thanks in advance for your help.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]