[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] 02/04: [gnugo] Add hook: gnugo-start-game-hook
From: |
Thien-Thi Nguyen |
Subject: |
[elpa] 02/04: [gnugo] Add hook: gnugo-start-game-hook |
Date: |
Wed, 16 Apr 2014 15:44:35 +0000 |
ttn pushed a commit to branch master
in repository elpa.
commit 5b8444815381d44890ce91abe8eaba576735a228
Author: Thien-Thi Nguyen <address@hidden>
Date: Wed Apr 16 11:51:12 2014 +0200
[gnugo] Add hook: gnugo-start-game-hook
* packages/gnugo/gnugo.el (gnugo-start-game-hook): New var.
(gnugo): Run ‘gnugo-start-game-hook’.
---
packages/gnugo/NEWS | 1 +
packages/gnugo/gnugo.el | 7 +++++++
2 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/packages/gnugo/NEWS b/packages/gnugo/NEWS
index 98ee291..99966a1 100644
--- a/packages/gnugo/NEWS
+++ b/packages/gnugo/NEWS
@@ -37,6 +37,7 @@ NB: "RCS: X..Y " means that the particular release includes
- ‘gnugo-magic-undo’ handles SPEC ‘0’
- dropped ‘(gnugo-move-history 'count)’ (BI)
- new func: ‘gnugo-current-player’
+ - new hook: ‘gnugo-start-game-hook’
- 2.3.1 | 2014-02-27
- portability fixes
diff --git a/packages/gnugo/gnugo.el b/packages/gnugo/gnugo.el
index 59db6dd..e7a3851 100644
--- a/packages/gnugo/gnugo.el
+++ b/packages/gnugo/gnugo.el
@@ -69,6 +69,7 @@
;; `gnugo-xpms'
;; normal hooks: `gnugo-board-mode-hook'
;; `gnugo-frolic-mode-hook'
+;; `gnugo-start-game-hook'
;; `gnugo-post-move-hook'
;; and the keymap: `gnugo-board-mode-map'
;;
@@ -111,6 +112,11 @@ http://www.gnu.org/software/gnugo")
(defvar gnugo-board-mode-hook nil
"Hook run when entering GNUGO Board mode.")
+(defvar gnugo-start-game-hook nil
+ "Normal hook run immediately before the first move of the game.
+To find out who is to move first, use `gnugo-current-player'.
+See also `gnugo-board-mode'.")
+
(defvar gnugo-post-move-hook nil
"Normal hook run after a move and before the board is refreshed.
Initially, when `run-hooks' is called, the current buffer is the GNUGO
@@ -2555,6 +2561,7 @@ starting a new one. See `gnugo-board-mode' documentation
for more info."
(and (gnugo--blackp g) (< n 2)))
u
g))
+ (run-hooks 'gnugo-start-game-hook)
(when (string= g (gnugo-current-player))
(gnugo-refresh t)
(gnugo-get-move g))))))