[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] /srv/bzr/emacs/trunk r104357: * lisp/play/5x5.el (5x5-new-
From: |
Stefan Monnier |
Subject: |
[Emacs-diffs] /srv/bzr/emacs/trunk r104357: * lisp/play/5x5.el (5x5-new-game, 5x5-randomize): |
Date: |
Tue, 24 May 2011 15:22:09 -0300 |
User-agent: |
Bazaar (2.3.1) |
------------------------------------------------------------
revno: 104357
author: Vincent Belaïche <address@hidden>
committer: Stefan Monnier <address@hidden>
branch nick: trunk
timestamp: Tue 2011-05-24 15:22:09 -0300
message:
* lisp/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.
modified:
lisp/ChangeLog
lisp/play/5x5.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog 2011-05-24 18:15:07 +0000
+++ b/lisp/ChangeLog 2011-05-24 18:22:09 +0000
@@ -1,3 +1,10 @@
+2011-05-24 Vincent Belaïche <address@hidden>
+
+ * 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 <address@hidden> (tiny change)
* isearch.el (isearch-range-invisible): Use invisible-p (bug#8721).
=== modified file 'lisp/play/5x5.el'
--- a/lisp/play/5x5.el 2011-05-24 03:36:06 +0000
+++ b/lisp/play/5x5.el 2011-05-24 18:22:09 +0000
@@ -239,7 +239,8 @@
(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 @@
(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 @@
(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 @@
(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)))
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] /srv/bzr/emacs/trunk r104357: * lisp/play/5x5.el (5x5-new-game, 5x5-randomize):,
Stefan Monnier <=