[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/gnugo dd6b6f8 186/357: [gnugo] New command: ‘C’ (gnugo
From: |
Stefan Monnier |
Subject: |
[elpa] externals/gnugo dd6b6f8 186/357: [gnugo] New command: ‘C’ (gnugo-comment) |
Date: |
Sun, 29 Nov 2020 14:51:18 -0500 (EST) |
branch: externals/gnugo
commit dd6b6f82b28150a5414db185abb6919f6e123d5a
Author: Thien-Thi Nguyen <ttn@gnu.org>
Commit: Thien-Thi Nguyen <ttn@gnu.org>
[gnugo] New command: ‘C’ (gnugo-comment)
* packages/gnugo/gnugo.el (gnugo-comment): New command.
(gnugo-board-mode-map): Add binding for ‘C’.
---
HACKING | 1 -
NEWS | 1 +
gnugo.el | 20 ++++++++++++++++++++
3 files changed, 21 insertions(+), 1 deletion(-)
diff --git a/HACKING b/HACKING
index 9110ef0..0051b85 100644
--- a/HACKING
+++ b/HACKING
@@ -20,7 +20,6 @@ This file is both a guide for newcomers and a todo list for
oldstayers.
*** using assist minor mode, gnugo-v-gnugo (ibid)
*** make gnugo (the external program) support query (read-only) thread
*** extend GNUGO Board mode to manage another subprocess for analysis only
-*** command ‘C’ to add a comment to the SGF tree
*** command ‘C-u =’ to label a position
*** SGF tree traversal
*** "undo undo undoing"; integrate Emacs undo, GTP undo, subgame branching
diff --git a/NEWS b/NEWS
index 8a97a25..12ef38d 100644
--- a/NEWS
+++ b/NEWS
@@ -20,6 +20,7 @@ NB: "RCS: X..Y " means that the particular release includes
- ‘=’ 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: ‘C’ (gnugo-comment)
- new command: ‘o’ (gnugo-oops)
- new command: ‘O’ (gnugo-okay)
- new command: ‘L’ (gnugo-frolic-in-the-leaves)
diff --git a/gnugo.el b/gnugo.el
index 7c52087..632d2bf 100644
--- a/gnugo.el
+++ b/gnugo.el
@@ -2162,6 +2162,25 @@ If there a stone at that position, also display its move
number."
(switch-to-buffer buf))
finally do (message "(only one)")))
+(defun gnugo-comment (node comment)
+ "Add to NODE a COMMENT (string) property.
+Called interactively, NODE is the one corresponding to the
+stone at point, and any previous comment is inserted as the
+initial-input (see `read-string').
+
+If COMMENT is nil or the empty string, remove the property entirely."
+ (interactive
+ (let* ((pos (gnugo-position))
+ (node (or (gnugo--node-with-played-stone pos)
+ (user-error "No stone at %s" pos))))
+ (list node
+ (read-string (format "Comment for %s: "
+ (gnugo-describe-position))
+ (cdr (assq :C node))))))
+ (setq node (delq (assq :C node) node))
+ (unless (zerop (length comment))
+ (gnugo--decorate node `((:C . ,comment)))))
+
;;;---------------------------------------------------------------------------
;;; Command properties and gnugo-command
@@ -2473,6 +2492,7 @@ starting a new one. See `gnugo-board-mode' documentation
for more info."
("l" . gnugo-read-sgf-file)
("F" . gnugo-display-final-score)
("A" . gnugo-switch-to-another)
+ ("C" . gnugo-comment)
;; mouse
([(down-mouse-1)] . gnugo-mouse-move)
([(down-mouse-2)] . gnugo-mouse-move) ; mitigate accidents
- [elpa] externals/gnugo 4680536 143/357: [gnugo int] Fix bug: Unbreak SGF file output., (continued)
- [elpa] externals/gnugo 4680536 143/357: [gnugo int] Fix bug: Unbreak SGF file output., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 806a2f2 133/357: [gnugo] Add some navigation commands for GNUGO Frolic mode., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo c6795aa 140/357: [gnugo frolic int] Assign ‘pop’ rv to avoid byte-compiler warning., Stefan Monnier, 2020/11/29
- [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 <=
- [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, 2020/11/29
- [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