emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/gnugo 052ea8a 045/357: [gnugo] New command: ‘A’ (gnugo


From: Stefan Monnier
Subject: [elpa] externals/gnugo 052ea8a 045/357: [gnugo] New command: ‘A’ (gnugo-switch-to-another)
Date: Sun, 29 Nov 2020 14:50:44 -0500 (EST)

branch: externals/gnugo
commit 052ea8a90e68e340241ba0a3682b135a6054f73f
Author: Thien-Thi Nguyen <ttn@gnu.org>
Commit: Thien-Thi Nguyen <ttn@gnu.org>

    [gnugo] New command: ‘A’ (gnugo-switch-to-another)
    
    * packages/gnugo/gnugo.el
    (gnugo-switch-to-another): New command.
    (gnugo-board-mode-map): Bind ‘A’ to it.
---
 gnugo.el | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/gnugo.el b/gnugo.el
index b30988c..7fc1e23 100644
--- a/gnugo.el
+++ b/gnugo.el
@@ -1554,6 +1554,15 @@ which placed the stone at point."
   (interactive)
   (message "%s" (gnugo-position)))
 
+(defun gnugo-switch-to-another ()
+  "Switch to another GNU Go game buffer (if any)."
+  (interactive)
+  (let ((cur (current-buffer)))
+    (switch-to-buffer (cl-find-if 'gnugo-board-buffer-p
+                                  (reverse (buffer-list))))
+    (when (eq cur (current-buffer))
+      (message "(only one)"))))
+
 ;;;---------------------------------------------------------------------------
 ;;; Command properties and gnugo-command
 
@@ -1834,6 +1843,7 @@ starting a new one.  See `gnugo-board-mode' documentation 
for more info."
           ("\C-x\C-w" . gnugo-write-sgf-file)
           ("l"        . gnugo-read-sgf-file)
           ("F"        . gnugo-display-final-score)
+          ("A"        . gnugo-switch-to-another)
           ;; mouse
           ([(down-mouse-1)] . gnugo-mouse-move)
           ([(down-mouse-2)] . gnugo-mouse-move) ; mitigate accidents



reply via email to

[Prev in Thread] Current Thread [Next in Thread]