[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [gnugo-devel] Re: Improved XPM's
From: |
bump |
Subject: |
Re: [gnugo-devel] Re: Improved XPM's |
Date: |
Thu, 4 Nov 2004 16:00:00 -0800 |
> > There's still a problem, because after : undo the board
> > is not in its correct state.
> >
> > Shouldn't the board be redrawn after every gtp command
> > issued with : ? (Though maybe just loadsgf and undo are
> > enough, I'm not sure.)
> >
> > i guess i need to do what i've been avoiding doing (out of
> > laziness): configuring gnugo.el handling of each command on a
> > case by case basis. for example, both `loadsgf' and `undo'
> > require redrawing the board, but `get_komi' and `worm_stones'
> > do not, instead requiring another type of handling altogether.
> > the support is all there (under "Load-time actions"), it's
> > just a matter of finding a couple free hours. perhaps this
> > evening...
>
> Wouldn't the simplest solution be just to redraw the
> board after every command entered with : ?
The following patch seems to me to produce better
behavior, in that the displayed board is less likely to
show the wrong state.
Even after the patch there is still a problem with undo,
however, in that the last move is not displayed. Also if
you undo once instead of twice, then make a move, the
wrong color is played on the board. (Normally in playing
you would undo twice, to undo the computer's last move,
then our own, so this is a less important problem.)
I assume that you have to delete the last move from
move-history before calling gnugo-refresh.
I do think it is important to support undo. I don't
think it is necessary to have good behavior on the
entire range of gtp commands but : loadsgf and : undo
are important.
For playing, the most useful thing would be a
keystroke such as "U" that would call undo twice,
taking back the computer's last move played, then
our own move. However I think it would be fine for now
if you just have to type : undo : undo, especially if
all variables such as move-history, black-captures and
white-captures get correctly updated before redrawing the
board.
The mode will have other applications than just playing
with GNU Go such as viewing the regressions. It would
be good if a grid were displayed. (You can get the
location of any point on the board using =, but this
doesn't eliminate the wish for a grid.)
Dan
Index: gnugo.el
===================================================================
RCS file: /cvsroot/gnugo/gnugo/interface/gnugo.el,v
retrieving revision 1.5.2.1
diff -u -r1.5.2.1 gnugo.el
--- gnugo.el 4 Nov 2004 04:33:27 -0000 1.5.2.1
+++ gnugo.el 4 Nov 2004 23:12:17 -0000
@@ -1328,7 +1328,9 @@
(let ((hook
;; do not elide this binding; `run-hooks' needs it
(plist-get spec :post-hook)))
- (run-hooks 'hook))))))))
+ (run-hooks 'hook))))))
+ (gnugo-refresh t)
+))
;;;---------------------------------------------------------------------------
;;; Major mode for interacting with a GNUGO subprocess
@@ -1573,6 +1575,7 @@
(" " . gnugo-move)
("P" . gnugo-pass)
("R" . gnugo-resign)
+ ("u" . gnugo-undo)
("q" . (lambda () (interactive)
(if (or (gnugo-get :game-over)
(y-or-n-p "Quit? "))
@@ -1580,7 +1583,7 @@
(message "(not quitting)"))))
("Q" . (lambda () (interactive)
(kill-buffer nil)))
- ("\C-l" . gnugo-refresh)
+ ("\C-l" . (gnugo-refresh t))
("\M-_" . bury-buffer)
("_" . bury-buffer)
("h" . (lambda () (interactive)