ttn pushed a commit to branch ttn-gnugo in repository elpa. commit 3610bd0aae549c2541ccf1ff029c580e05433997 Author: Thien-Thi Nguyen <t...@gnu.org> Date: Fri Feb 21 12:47:18 2014 +0100
[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. --- packages/gnugo/gnugo.el | 10 ++++++++++ 1 files changed, 10 insertions(+), 0 deletions(-) diff --git a/packages/gnugo/gnugo.el b/packages/gnugo/gnugo.el index b30988c..7fc1e23 100644 --- a/packages/gnugo/gnugo.el +++ b/packages/gnugo/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