]> code.delx.au - gnu-emacs-elpa/commitdiff
Make ivy-display-style more compatible with 24.3
authorOleh Krehel <ohwoeowho@gmail.com>
Sat, 26 Sep 2015 11:28:46 +0000 (13:28 +0200)
committerOleh Krehel <ohwoeowho@gmail.com>
Sat, 26 Sep 2015 11:28:46 +0000 (13:28 +0200)
* ivy.el (ivy--format-minibuffer-line): Use
  `font-lock-append-text-property' instead of
  `add-face-text-property'. It's not optimal, since the new face needs
  to be put in front, but at least it doesn't error out.

ivy.el

diff --git a/ivy.el b/ivy.el
index c5aeb9b57d1d147113ee05b9b571636deb62dd75..bfec0fe27b6101413b4d0756d17ca4025dcd4510 100644 (file)
--- a/ivy.el
+++ b/ivy.el
@@ -1560,12 +1560,19 @@ This string will be inserted into the minibuffer.")
                          (t
                           (nth (1+ (mod (+ i 2) (1- (length swiper-minibuffer-faces))))
                                swiper-minibuffer-faces)))))
-              (add-face-text-property
-               (match-beginning i)
-               (match-end i)
-               face
-               nil
-               str))
+              (if (fboundp 'add-face-text-property)
+                  (add-face-text-property
+                   (match-beginning i)
+                   (match-end i)
+                   face
+                   nil
+                   str)
+                (font-lock-append-text-property
+                 (match-beginning i)
+                 (match-end i)
+                 'face
+                 face
+                 str)))
             (cl-incf i)))))
     str))