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

From: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
To: Frank Fischer <frank.fischer <at> mathematik.tu-chemnitz.de>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 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: Fri, 23 Aug 2013 11:38:05 -0400
> (setq adaptive-fill-function
>   (lambda ()
>     (and adaptive-fill-regexp
>          (looking-at adaptive-fill-regexp)
>          (match-string 0))))

W.r.t the above change, I installed the patch below which should make
it unnecessary:

--- lisp/textmodes/fill.el	2013-01-02 16:13:04 +0000
+++ lisp/textmodes/fill.el	2013-08-23 15:25:50 +0000
@@ -220,7 +220,7 @@
   (let ((str (or
               (and adaptive-fill-function (funcall adaptive-fill-function))
               (and adaptive-fill-regexp (looking-at adaptive-fill-regexp)
-                   (match-string-no-properties 0)))))
+                   (match-string 0)))))
     (if (>= (+ (current-left-margin) (length str)) (current-fill-column))
         ;; Death to insanely long prefixes.
         nil

> hoping that (match-string 0) returns the whole prefix with the correct
> fontification. However, there are situations where this does not work:
> for example if one has a (very long) wrapped line without comment and
> then inserts a semicolon (only one) at the beginning of that line to
> comment it out, then the wrap-prefix does not get comment face (to be
> precise, it has the correct font, thus your patch works, but not the
> correct color). But if one inserts a second semicolon then the
> wrap-prefix gets the correct color. I assume this happens because the
> wrap-prefix is set before font-lock changed the face of inserted
> semicolon.

Indeed.  It probably depends on whether adaptive-mode-mode was enabled
before or after font-lock.  Can you try the patch below to see if it
fixes this problem for you?


        Stefan




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.