unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@IRO.UMontreal.CA>
To: Frank Fischer <frank.fischer@mathematik.tu-chemnitz.de>
Cc: 15155@debbugs.gnu.org
Subject: 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	[thread overview]
Message-ID: <jwv7gfca02o.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <20130823151758.4b4c3f8a@mawo> (Frank Fischer's message of "Fri,  23 Aug 2013 15:17:58 +0200")

> 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





  parent reply	other threads:[~2013-08-23 15:39 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-21 19:54 bug#15155: 24.3; wrap-prefix in adaptive-wrap-prefix-mode with variable-pitch has wrong face Frank Fischer
2013-08-22  1:33 ` Stefan Monnier
2013-08-22  7:04   ` Frank Fischer
2013-08-22 14:54     ` Eli Zaretskii
2013-08-22 15:26       ` Frank Fischer
2013-08-22 16:03         ` Eli Zaretskii
2013-08-22 16:15           ` Frank Fischer
2013-08-22 16:56             ` Eli Zaretskii
2013-08-22 20:32               ` Frank Fischer
2013-08-23  6:41                 ` Eli Zaretskii
2013-08-23 13:17                   ` Frank Fischer
2013-08-23 14:29                     ` Eli Zaretskii
2013-08-23 15:17                       ` Frank Fischer
2013-08-23 15:38                     ` Stefan Monnier
2013-08-24  9:58                       ` Frank Fischer
2013-08-26  4:14                         ` Stefan Monnier
2013-08-23 15:39                     ` Stefan Monnier [this message]
2013-08-22 18:15       ` Stefan Monnier
2013-08-22 18:49         ` Eli Zaretskii
2013-08-22 14:50   ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwv7gfca02o.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=15155@debbugs.gnu.org \
    --cc=frank.fischer@mathematik.tu-chemnitz.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).