Anonymous avatar Anonymous committed 2e0aaef

Added ms-windows compatibility fix from Adrian Aichner

Comments (0)

Files changed (2)

 			    (setq max-height height)))))))
 	   (if max-height
 	       (while (and (> (font-height font-spec) max-height)
-			   (setq name (x-find-smaller-font name)))
+			   (setq name
+				 (cond
+				  ((eq window-system 'x)
+				   (x-find-smaller-font name))
+				  ((eq window-system 'mswindows)
+				   (mswindows-find-smaller-font name)))))
 		 (add-spec-to-specifier font-spec name (current-buffer))))))))
 
 (defun gamegrid-initialize-display ()
 	    (fmt (format "%%-%ds" sokoban-width))
 	    start end)
 	(loop for y from 0 to (1- sokoban-height) do
-	      (cond ((or (eq (point) (point-max))
-			 (looking-at sokoban-comment-regexp))
-		     (aset data y (format fmt "")))
-		    (t
-		     (setq start (point))
-		     (end-of-line)
-		     (setq end (point))
-		     (aset data
-			   y
-			   (format fmt (buffer-substring start end)))
-		     (forward-char))))
+	  (cond ((or (eq (point) (point-max))
+		     (looking-at sokoban-comment-regexp))
+		 (aset data y (format fmt "")))
+		(t
+		 (setq start (point))
+		 (end-of-line)
+		 (setq end (point))
+		 (aset data
+		       y
+		       (format fmt (buffer-substring start end)))
+		 (forward-char))))
 	(setq sokoban-level-data
 	      (cons data sokoban-level-data))))
     (kill-buffer (current-buffer))
   (setq sokoban-level-map (nth (1- sokoban-level) sokoban-level-data)
 	sokoban-targets 0)
   (loop for y from 0 to (1- sokoban-height) do
-	(loop for x from 0 to (1- sokoban-width) do
-	      (let ((c (aref (aref sokoban-level-map y) x)))
-		(cond
-		 ((= c sokoban-target)
-		  (incf sokoban-targets))
-		 ((= c ?\040)
-		  (aset (aref sokoban-level-map y) x sokoban-floor)))))))
+    (loop for x from 0 to (1- sokoban-width) do
+      (let ((c (aref (aref sokoban-level-map y) x)))
+	(cond
+	 ((= c sokoban-target)
+	  (incf sokoban-targets))
+	 ((= c ?\040)
+	  (aset (aref sokoban-level-map y) x sokoban-floor)))))))
 
 (defun sokoban-get-floor (x y)
   (let ((c (aref (aref sokoban-level-map y) x)))
 			sokoban-buffer-height
 			?\040)
   (loop for y from 0 to (1- sokoban-height) do
-	(loop for x from 0 to (1- sokoban-width) do
-	      (let ((c (aref (aref sokoban-level-map y) x)))
-		(if (= c sokoban-player)
-		    (setq sokoban-x x
-			  sokoban-y y))
-		(gamegrid-set-cell x y c)))))
+    (loop for x from 0 to (1- sokoban-width) do
+      (let ((c (aref (aref sokoban-level-map y) x)))
+	(if (= c sokoban-player)
+	    (setq sokoban-x x
+		  sokoban-y y))
+	(gamegrid-set-cell x y c)))))
 
 (defun sokoban-draw-score ()
   (let ((strings (vector (format "Moves:  %05d" sokoban-moves)
 				 sokoban-done
 				 sokoban-targets))))
     (loop for y from 0 to 1 do
-	  (let* ((string (aref strings y))
-		 (len (length string)))
-	    (loop for x from 0 to (1- len) do
-		  (gamegrid-set-cell (+ sokoban-score-x x)
-				     (+ sokoban-score-y y)
-				     (aref string x))))))
+      (let* ((string (aref strings y))
+	     (len (length string)))
+	(loop for x from 0 to (1- len) do
+	  (gamegrid-set-cell (+ sokoban-score-x x)
+			     (+ sokoban-score-y y)
+			     (aref string x))))))
   (setq mode-line-format
 	(format "Sokoban:   Level: %3d   Moves: %05d   Pushes: %05d   Done: %d/%d"
 		sokoban-level sokoban-moves sokoban-pushes
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.