]> code.delx.au - gnu-emacs-elpa/blobdiff - packages/adaptive-wrap/adaptive-wrap.el
Merge commit '5d576aed8ee0f1ee29c2d1ca597301bdcff5597e' from hydra
[gnu-emacs-elpa] / packages / adaptive-wrap / adaptive-wrap.el
index 3787a992dedccabda449eb13767b68c36ab1e834..9455789d69f0e28acb815ec3c26ae5e2431d58fe 100644 (file)
@@ -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