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 #20 received at 15155 <at> debbugs.gnu.org (full text, mbox):

From: Frank Fischer <frank.fischer <at> mathematik.tu-chemnitz.de>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Frank Fischer <frank.fischer <at> mathematik.tu-chemnitz.de>,
 monnier <at> iro.umontreal.ca, 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 17:26:50 +0200
Am 08/22/2013 04:54 PM, schrieb Eli Zaretskii:
>> (setq adaptive-fill-function
>>   (lambda ()
>>     (and adaptive-fill-prefix
>>          (looking-at adaptive-fill-prefix)
>>          (propertize (match-string-no-properties 0) 'face 'default))))
> 
> How about using the face returned by face-at-point, instead of
> 'default'?

I'm not sure. In my tests (adding several % comment marker before a line
in a LaTeX document) I got strange results. Sometimes the wrap prefix
had the correct color, sometimes not. But in no case it had the correct
(variable-width) font. I used the following code (of course the correct
name of the variable is `adaptive-fill-regexp` not `adaptive-fill-prefix`):

(setq adaptive-fill-function
  (lambda ()
    (and adaptive-fill-regexp
         (looking-at adaptive-fill-regexp)
         (propertize (match-string-no-properties 0) 'face
		     (face-at-point)))))


But I suppose that using `match-string` instead of
`match-string-no-properties` should preserve the correct face, right?
But this did not work, too.





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

Previous Next


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