GNU bug report logs - #15155
24.3; wrap-prefix in adaptive-wrap-prefix-mode with variable-pitch has wrong face

Previous Next

Package: emacs;

Reported by: Frank Fischer <frank.fischer <at> mathematik.tu-chemnitz.de>

Date: Wed, 21 Aug 2013 20:23:01 UTC

Severity: normal

Found in version 24.3

Fixed in version 24.4

Done: Glenn Morris <rgm <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #11 received at 15155 <at> debbugs.gnu.org (full text, mbox):

From: Frank Fischer <frank.fischer <at> mathematik.tu-chemnitz.de>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 15155 <at> debbugs.gnu.org
Subject: Re: bug#15155: 24.3; wrap-prefix in adaptive-wrap-prefix-mode with
 variable-pitch has wrong face
Date: Thu, 22 Aug 2013 09:04:12 +0200
Am 08/22/2013 03:33 AM, schrieb Stefan Monnier:


> I have the vague impression of having already seen such a bug-report,
> except the other way around (where the user complained that the
> wrap-prefix was displayed in the font that happened to be active where
> the line got truncated), so we "fixed" it for Emacs-24.

Ah, I see (just add some additional !!! before the first line in
*scratch* and see that the exclamation marks in the wrapped lines have
comment face (but they should be black) in Emacs 23).

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?).


Many thanks for your comments, they already helped me a lot :)

Frank





This bug report was last modified 11 years and 324 days ago.

Previous Next


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