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 #56 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:39:44 -0400
> don't know. If my guess is correct, is it possible to run the
> appropriate hooks (I think adaptive-wrap uses
> `jit-lock-register`) *after* font-lock changed the face? Or is there
> another, better way to detect the correct face?

Oops, sorry, here's the patch,


        Stefan


diff --git a/packages/adaptive-wrap/adaptive-wrap.el b/packages/adaptive-wrap/adaptive-wrap.el
index 3787a99..9455789 100644
--- a/packages/adaptive-wrap/adaptive-wrap.el
+++ b/packages/adaptive-wrap/adaptive-wrap.el
@@ -96,7 +96,13 @@ extra indent = 2
   :lighter ""
   :group 'visual-line
   (if adaptive-wrap-prefix-mode
-      (jit-lock-register #'adaptive-wrap-prefix-function)
+      (progn
+        ;; HACK ATTACK!  We need to run after font-lock, but jit-lock-register
+        ;; doesn't accept an `append' argument, so we add ourselves beforehand,
+        ;; to make sure we're at the end of the hook (bug#15155).
+        (add-hook 'jit-lock-functions
+                  #'adaptive-wrap-prefix-function 'append t)
+        (jit-lock-register #'adaptive-wrap-prefix-function))
     (jit-lock-unregister #'adaptive-wrap-prefix-function)
     (with-silent-modifications
       (save-restriction
Date: Fri, 23 Aug 2013 11:39:05 -0400




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.