emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/pacmacs 19ffa64f7e 230/472: Merge branch 'master' into con


From: ELPA Syncer
Subject: [nongnu] elpa/pacmacs 19ffa64f7e 230/472: Merge branch 'master' into connecte-walls
Date: Thu, 6 Jan 2022 21:59:27 -0500 (EST)

branch: elpa/pacmacs
commit 19ffa64f7e4c850c84ddfcd70c5bf644a8d52a20
Merge: 0546e964b1 98599015bb
Author: rexim <reximkut@gmail.com>
Commit: rexim <reximkut@gmail.com>

    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))))))
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]