summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog7
-rw-r--r--lisp/play/5x5.el13
2 files changed, 16 insertions, 4 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 975ddde8bcc..4af052c84e0 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,10 @@
+2011-05-24 Vincent Belaïche <vincentb1@users.sourceforge.net>
+
+ * play/5x5.el (5x5-new-game, 5x5-randomize):
+ Reset 5x5-solver-output to nil when a new grid is cast.
+ (5x5-log-init, 5x5-log): Use defsubst instead of defmacro to shunt
+ these debugging traces, as defmacro breaks the compiled code.
+
2011-05-24 Dmitry Kurochkin <dmitry.kurochkin@gmail.com> (tiny change)
* isearch.el (isearch-range-invisible): Use invisible-p (bug#8721).
diff --git a/lisp/play/5x5.el b/lisp/play/5x5.el
index 75f7c2df009..5a8ff9d0f32 100644
--- a/lisp/play/5x5.el
+++ b/lisp/play/5x5.el
@@ -239,7 +239,8 @@ Quit current game \\[5x5-quit-game]"
(setq 5x5-x-pos (/ 5x5-grid-size 2)
5x5-y-pos (/ 5x5-grid-size 2)
5x5-moves 0
- 5x5-grid (5x5-make-move (5x5-make-new-grid) 5x5-y-pos 5x5-x-pos))
+ 5x5-grid (5x5-make-move (5x5-make-new-grid) 5x5-y-pos 5x5-x-pos)
+ 5x5-solver-output nil)
(5x5-draw-grid (list 5x5-grid))
(5x5-position-cursor)))
@@ -492,6 +493,9 @@ position."
(eval-and-compile
(if nil; set to t to enable solver logging
+ ;; Note these logging facilities were not cleaned out as the arithmetic
+ ;; solver is not yet complete --- it works only for grid size = 5.
+ ;; So they may be useful again to design a more generic solution.
(progn
(defvar 5x5-log-buffer nil)
(defun 5x5-log-init ()
@@ -516,8 +520,8 @@ easy to log a value with minimal rewrite of code."
(with-current-buffer 5x5-log-buffer
(insert name ?= value-to-log ?\n))))
value))
- (defmacro 5x5-log-init ())
- (defmacro 5x5-log (name value) value)))
+ (defsubst 5x5-log-init ())
+ (defsubst 5x5-log (name value) value)))
(declare-function math-map-vec "calc-vec" (f a))
(declare-function math-sub "calc" (a b))
@@ -861,7 +865,8 @@ Argument N is ignored."
(setq 5x5-x-pos (/ 5x5-grid-size 2)
5x5-y-pos (/ 5x5-grid-size 2)
5x5-moves 0
- 5x5-grid (5x5-make-random-grid (symbol-function '5x5-make-move)))
+ 5x5-grid (5x5-make-random-grid (symbol-function '5x5-make-move))
+ 5x5-solver-output nil)
(unless 5x5-cracking
(5x5-draw-grid (list 5x5-grid)))
(5x5-position-cursor)))