diff options
| author | Vincent Belaïche | 2011-05-24 15:22:09 -0300 |
|---|---|---|
| committer | Stefan Monnier | 2011-05-24 15:22:09 -0300 |
| commit | 91513f63c626f3ae01476a76115bf0099f472de9 (patch) | |
| tree | 4f32c7d947a12a21ba959d0be9300abc11fd7b95 | |
| parent | 4d90d6d07885c641d9e4c4458345107c0ef602c3 (diff) | |
| download | emacs-91513f63c626f3ae01476a76115bf0099f472de9.tar.gz emacs-91513f63c626f3ae01476a76115bf0099f472de9.zip | |
* 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.
| -rw-r--r-- | lisp/ChangeLog | 7 | ||||
| -rw-r--r-- | lisp/play/5x5.el | 13 |
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 @@ | |||
| 1 | 2011-05-24 Vincent Belaïche <vincentb1@users.sourceforge.net> | ||
| 2 | |||
| 3 | * play/5x5.el (5x5-new-game, 5x5-randomize): | ||
| 4 | Reset 5x5-solver-output to nil when a new grid is cast. | ||
| 5 | (5x5-log-init, 5x5-log): Use defsubst instead of defmacro to shunt | ||
| 6 | these debugging traces, as defmacro breaks the compiled code. | ||
| 7 | |||
| 1 | 2011-05-24 Dmitry Kurochkin <dmitry.kurochkin@gmail.com> (tiny change) | 8 | 2011-05-24 Dmitry Kurochkin <dmitry.kurochkin@gmail.com> (tiny change) |
| 2 | 9 | ||
| 3 | * isearch.el (isearch-range-invisible): Use invisible-p (bug#8721). | 10 | * 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]" | |||
| 239 | (setq 5x5-x-pos (/ 5x5-grid-size 2) | 239 | (setq 5x5-x-pos (/ 5x5-grid-size 2) |
| 240 | 5x5-y-pos (/ 5x5-grid-size 2) | 240 | 5x5-y-pos (/ 5x5-grid-size 2) |
| 241 | 5x5-moves 0 | 241 | 5x5-moves 0 |
| 242 | 5x5-grid (5x5-make-move (5x5-make-new-grid) 5x5-y-pos 5x5-x-pos)) | 242 | 5x5-grid (5x5-make-move (5x5-make-new-grid) 5x5-y-pos 5x5-x-pos) |
| 243 | 5x5-solver-output nil) | ||
| 243 | (5x5-draw-grid (list 5x5-grid)) | 244 | (5x5-draw-grid (list 5x5-grid)) |
| 244 | (5x5-position-cursor))) | 245 | (5x5-position-cursor))) |
| 245 | 246 | ||
| @@ -492,6 +493,9 @@ position." | |||
| 492 | 493 | ||
| 493 | (eval-and-compile | 494 | (eval-and-compile |
| 494 | (if nil; set to t to enable solver logging | 495 | (if nil; set to t to enable solver logging |
| 496 | ;; Note these logging facilities were not cleaned out as the arithmetic | ||
| 497 | ;; solver is not yet complete --- it works only for grid size = 5. | ||
| 498 | ;; So they may be useful again to design a more generic solution. | ||
| 495 | (progn | 499 | (progn |
| 496 | (defvar 5x5-log-buffer nil) | 500 | (defvar 5x5-log-buffer nil) |
| 497 | (defun 5x5-log-init () | 501 | (defun 5x5-log-init () |
| @@ -516,8 +520,8 @@ easy to log a value with minimal rewrite of code." | |||
| 516 | (with-current-buffer 5x5-log-buffer | 520 | (with-current-buffer 5x5-log-buffer |
| 517 | (insert name ?= value-to-log ?\n)))) | 521 | (insert name ?= value-to-log ?\n)))) |
| 518 | value)) | 522 | value)) |
| 519 | (defmacro 5x5-log-init ()) | 523 | (defsubst 5x5-log-init ()) |
| 520 | (defmacro 5x5-log (name value) value))) | 524 | (defsubst 5x5-log (name value) value))) |
| 521 | 525 | ||
| 522 | (declare-function math-map-vec "calc-vec" (f a)) | 526 | (declare-function math-map-vec "calc-vec" (f a)) |
| 523 | (declare-function math-sub "calc" (a b)) | 527 | (declare-function math-sub "calc" (a b)) |
| @@ -861,7 +865,8 @@ Argument N is ignored." | |||
| 861 | (setq 5x5-x-pos (/ 5x5-grid-size 2) | 865 | (setq 5x5-x-pos (/ 5x5-grid-size 2) |
| 862 | 5x5-y-pos (/ 5x5-grid-size 2) | 866 | 5x5-y-pos (/ 5x5-grid-size 2) |
| 863 | 5x5-moves 0 | 867 | 5x5-moves 0 |
| 864 | 5x5-grid (5x5-make-random-grid (symbol-function '5x5-make-move))) | 868 | 5x5-grid (5x5-make-random-grid (symbol-function '5x5-make-move)) |
| 869 | 5x5-solver-output nil) | ||
| 865 | (unless 5x5-cracking | 870 | (unless 5x5-cracking |
| 866 | (5x5-draw-grid (list 5x5-grid))) | 871 | (5x5-draw-grid (list 5x5-grid))) |
| 867 | (5x5-position-cursor))) | 872 | (5x5-position-cursor))) |