From 3d1c9876ab4afbde2f73819269c157389563fb0f Mon Sep 17 00:00:00 2001 From: Mario Lang Date: Sun, 30 Mar 2014 20:08:21 +0200 Subject: Try to fix 045a93cb98dfd320e756ea9d9799ea92f0900bc6 a different way. Restore the old behaviour (run game hooks before painting move), but move the post-move hook from chess-game-move to chess-display-move. This fixes the reentrancy bug while preserving error checks being done in the game hooks. Maybe rename post-move to post-display-move? --- chess-display.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'chess-display.el') diff --git a/chess-display.el b/chess-display.el index 6bf03df..6f832da 100644 --- a/chess-display.el +++ b/chess-display.el @@ -376,9 +376,10 @@ If only START is given, it must be in algebraic move notation." (chess-error 'game-is-over))) (if (= chess-display-index (chess-game-index chess-module-game)) (let ((chess-display-handling-event t)) - (chess-display-paint-move nil ply) (chess-game-move chess-module-game ply) - (chess-display-set-index* nil (chess-game-index chess-module-game))) + (chess-display-paint-move nil ply) + (chess-display-set-index* nil (chess-game-index chess-module-game)) + (chess-game-run-hooks chess-module-game 'post-move)) ;; jww (2002-03-28): This should beget a variation within the ;; game, or alter the game, just as SCID allows (chess-error 'cannot-yet-add)))) -- cgit v1.2.3