bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#15155: 24.3; wrap-prefix in adaptive-wrap-prefix-mode with variable-


From: Eli Zaretskii
Subject: bug#15155: 24.3; wrap-prefix in adaptive-wrap-prefix-mode with variable-pitch has wrong face
Date: Thu, 22 Aug 2013 17:54:23 +0300

> Date: Thu, 22 Aug 2013 09:04:12 +0200
> From: Frank Fischer <frank.fischer@mathematik.tu-chemnitz.de>
> Cc: 15155@debbugs.gnu.org
> 
> Taking your hint, I have tried the following `adaptive-fill-function`
> 
> (setq adaptive-fill-function
>   (lambda ()
>     (and adaptive-fill-prefix
>          (looking-at adaptive-fill-prefix)
>          (match-string 0))))
> 
> This is exactly what `fill-adaptive-match-prefix' does except the latter
> uses `match-string-no-properties`.
> 
> This seems to work fine for the color of the prefix but not for its font
> (when using variable-pitch-mode). So a second try was
> 
> 
> (setq adaptive-fill-function
>   (lambda ()
>     (and adaptive-fill-prefix
>          (looking-at adaptive-fill-prefix)
>          (propertize (match-string-no-properties 0) 'face 'default))))
> 
> Now the wrap-prefix has the correct font but the wrong color (but this
> variant seems to work reasonably well for LaTeX and variable-pitch).
> 
> I think, the wrap-prefix should at least have the default face (which
> may be modified by variable-pitch-mode) in any case. I'm not sure about
> the other properties like color, but may adaptive-wrap-mode should
> (optionally?) use something like the adaptive-fill-function above to
> assign the wrap-prefix the same face as the original prefix (in contrast
> to the one that happened to be active where the line got truncated).
> 
> Though, I have no idea what to about the color vs. font problem (how to
> get both?).

How about using the face returned by face-at-point, instead of
'default'?





reply via email to

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