[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/gnugo 3f13bbf 168/357: [gnugo] Make ‘=’ also display m
From: |
Stefan Monnier |
Subject: |
[elpa] externals/gnugo 3f13bbf 168/357: [gnugo] Make ‘=’ also display move number. |
Date: |
Sun, 29 Nov 2020 14:51:14 -0500 (EST) |
branch: externals/gnugo
commit 3f13bbf59606076609d979b553af71c55b3edf0a
Author: Thien-Thi Nguyen <ttn@gnu.org>
Commit: Thien-Thi Nguyen <ttn@gnu.org>
[gnugo] Make ‘=’ also display move number.
* packages/gnugo/gnugo.el (gnugo-describe-position):
If there a stone at that position, also display its move number.
---
NEWS | 1 +
gnugo.el | 25 +++++++++++++++++++++++--
2 files changed, 24 insertions(+), 2 deletions(-)
diff --git a/NEWS b/NEWS
index f0148f6..99340b7 100644
--- a/NEWS
+++ b/NEWS
@@ -15,6 +15,7 @@ NB: "RCS: X..Y " means that the particular release includes
- avoid clobbering SGF property ‘EV’ on resignation
- follow main line in subtrees on read
- PASS for SZ <= 19 normalized to "" on read, written as ""
+ - ‘=’ also displays move number of the stone (if any) at that position
- new keybinding for ‘gnugo-undo-one-move’: M-u
- ‘gnugo-undo-one-move’ can optionally arrange for you to play next
- new command: ‘o’ (gnugo-oops)
diff --git a/gnugo.el b/gnugo.el
index 3b7b326..93ed2f3 100644
--- a/gnugo.el
+++ b/gnugo.el
@@ -2100,9 +2100,30 @@ which placed the stone at point."
(save-excursion (gnugo-refresh)))
(defun gnugo-describe-position ()
- "Display the board position under cursor in the echo area."
+ "Display the board position under cursor in the echo area.
+If there a stone at that position, also display its move number."
(interactive)
- (message "%s" (gnugo-position)))
+ (let ((pos (gnugo-position)) ; do first (can throw)
+ (color (case (following-char)
+ (?X :B)
+ (?O :W))))
+ (message
+ "%s%s" pos
+ (or (when color
+ (loop
+ with monkey = (gnugo-get :monkey)
+ with tree = (gnugo-get :sgf-gametree)
+ with mnum = (gnugo--tree-mnum tree)
+ with as-cc = (gnugo--as-cc-func)
+ with fruit = (cons color (funcall as-cc pos))
+ for node in (aref monkey 0)
+ if (member fruit node)
+ return
+ (format " (move %d)"
+ (gethash node mnum))
+ finally return
+ nil))
+ ""))))
(defun gnugo-switch-to-another ()
"Switch to another GNU Go game buffer (if any)."
- [elpa] externals/gnugo 13c8f82 149/357: [gnugo frolic] Doc fix., (continued)
- [elpa] externals/gnugo 13c8f82 149/357: [gnugo frolic] Doc fix., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo de40b22 152/357: [gnugo int] Move vectorization into ‘gnugo--set-tree-ends’., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo e8833a9 161/357: [gnugo int] Fix syntax error in ‘loop’ destructuring., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 3e3fbea 155/357: [gnugo sgf] Fix bug: Preserve whitespace for ‘text’ values., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 0f3f4b6 165/357: [gnugo int] Use ‘ignore’ to avoid byte-compiler warnings., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 082d56c 178/357: [gnugo int] Use ‘gnugo--decorate’ more., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo e382633 190/357: [gnugo] Drop var: gnugo-inhibit-refresh, Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo dd6b6f8 186/357: [gnugo] New command: ‘C’ (gnugo-comment), Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo cba406b 176/357: [gnugo] Include root node in :sgf-gametree description., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 1ac646f 172/357: [gnugo] New command: ‘O’ (gnugo-okay), Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 3f13bbf 168/357: [gnugo] Make ‘=’ also display move number.,
Stefan Monnier <=
- [elpa] externals/gnugo f3c90cd 187/357: [gnugo] Make ‘C-u F’ add the blurb as a comment to the last node., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo bcc912b 164/357: [gnugo frolic int] Add var selection to awakening parameterization., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 66c29d0 197/357: [gnugo int] Add abstraction: gnugo--gate-game-over, Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 5bbec0e 179/357: [gnugo int] Incorporate ‘gnugo-note’ into unique caller., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 82b6000 198/357: [gnugo] Mention ‘gnugo-frolic-mode-hook’., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 32e8547 199/357: [gnugo int] Add abstraction: gnugo--user-play, Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 001228c 205/357: [gnugo] Drop support for ‘(gnugo-move-history 'count)’., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 106a279 211/357: [gnugo int] Consolidate paren overlays access., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 17d907d 210/357: [gnugo int] Shave one ‘gnugo-other’ call., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 1d6b241 214/357: [gnugo] Use ‘define-derived-mode’ for GNUGO Board mode., Stefan Monnier, 2020/11/29