branch: elpa/pacmacs
commit 19ffa64f7e4c850c84ddfcd70c5bf644a8d52a20
Merge: 0546e964b1 98599015bb
Author: rexim <[email protected]>
Commit: rexim <[email protected]>
Merge branch 'master' into connecte-walls
We need the xbm flip bits hack from the master
---
pacmacs-image.el | 14 +++++++++++---
test/pacmacs-image-test.el | 18 +++++++++++++-----
2 files changed, 24 insertions(+), 8 deletions(-)
diff --git a/pacmacs-image.el b/pacmacs-image.el
index cfcb568712..ca67c29157 100644
--- a/pacmacs-image.el
+++ b/pacmacs-image.el
@@ -32,6 +32,8 @@
;;; Code:
+(defconst pacmacs--flip-xbm-bits (eq system-type 'windows-nt))
+
(defun pacmacs-load-image (filename)
(create-image filename 'xpm nil :heuristic-mask t))
@@ -39,12 +41,18 @@
(insert-image resource " " nil resource-vector))
(defun pacmacs-create-color-block (width height color)
- (create-image
+ (apply
+ #'create-image
(make-vector
width (make-bool-vector height t))
'xbm t :width width :height height
- :foreground color
- :background color))
+ (if (not pacmacs--flip-xbm-bits)
+ (list
+ :foreground color
+ :background nil)
+ (list
+ :foreground nil
+ :background color))))
(defun pacmacs--create-wall-block (width height color bottom right top left)
(let ((wall-block (make-vector
diff --git a/test/pacmacs-image-test.el b/test/pacmacs-image-test.el
index a66a00d23c..ae5461e277 100644
--- a/test/pacmacs-image-test.el
+++ b/test/pacmacs-image-test.el
@@ -20,11 +20,19 @@
(with-mock
(mock (make-bool-vector height t) => bool-vector-result :times 1)
(mock (make-vector width bool-vector-result) => make-vector-result :times
1)
- (mock (create-image make-vector-result
- 'xbm t
- :width width :height height
- :foreground color
- :background color) => create-image-result :times 1)
+
+ (if (not pacmacs--flip-xbm-bits)
+ (mock (create-image make-vector-result
+ 'xbm t
+ :width width :height height
+ :foreground color
+ :background nil) => create-image-result :times 1)
+ (mock (create-image make-vector-result
+ 'xbm t
+ :width width :height height
+ :foreground nil
+ :background color) => create-image-result :times 1))
+
(should (equal create-image-result
(pacmacs-create-color-block width height color))))))