From 6abf66e2aaf04b82d47ff616d089ddeabcb0233b Mon Sep 17 00:00:00 2001 From: Thien-Thi Nguyen Date: Wed, 16 Apr 2014 09:12:40 +0200 Subject: [PATCH] =?utf8?q?[gnugo]=20Drop=20support=20for=20=E2=80=98(gnugo?= =?utf8?q?-move-history=20'count)=E2=80=99.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit * packages/gnugo/gnugo.el (gnugo-move-history): ...here. (gnugo-refresh): For ‘~m’, access :sgf-gametree, :monkey directly. --- packages/gnugo/NEWS | 1 + packages/gnugo/gnugo.el | 17 ++++++++++------- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/packages/gnugo/NEWS b/packages/gnugo/NEWS index 02c93372c..3c51bdf53 100644 --- a/packages/gnugo/NEWS +++ b/packages/gnugo/NEWS @@ -35,6 +35,7 @@ NB: "RCS: X..Y " means that the particular release includes - ‘gnugo/sgf-read-file’ renamed to ‘gnugo/sgf-create’ and enhanced - ‘:sgf-gametree’ internal representation inverted (BI) - ‘gnugo-magic-undo’ handles SPEC ‘0’ + - dropped ‘(gnugo-move-history 'count)’ (BI) - 2.3.1 | 2014-02-27 - portability fixes diff --git a/packages/gnugo/gnugo.el b/packages/gnugo/gnugo.el index 8047d5f31..7e7f44672 100644 --- a/packages/gnugo/gnugo.el +++ b/packages/gnugo/gnugo.el @@ -695,10 +695,10 @@ If nil, display the history in the echo area as \"(N moves)\" followed by the space-separated list of moves. When called interactively with a prefix arg (i.e., RSEL is `(4)'), display similarly, but suffix with the mover (either \":B\" or \":W\"). -If RSEL is the symbol `car' return the most-recent move; if -`cadr', the next-to-most-recent move; if `count' the number of -moves thus far; if `two' the last two moves as a list, oldest last. - +RSEL may also be a symbol that selects what to return: + car -- the most-recent move + cadr -- the next-to-most-recent move + two -- the last two moves as a list, oldest last For all other values of RSEL, do nothing and return nil." (interactive "P") (let* ((monkey (gnugo-get :monkey)) @@ -726,8 +726,6 @@ For all other values of RSEL, do nothing and return nil." (`nil (finish nil)) (`car (car (nn))) (`cadr (nn) (car (nn))) - (`count (gethash (car mem) (gnugo--tree-mnum - (gnugo-get :sgf-gametree)))) (`two (nn) (nn) acc) (_ nil))))) @@ -1553,7 +1551,12 @@ its move." (cadr (time-since ws)) "-"))) (?u '(or (gnugo-get :last-waiting) "-")) - (?m '(gnugo-move-history 'count)))) + (?m '(let ((tree (gnugo-get :sgf-gametree)) + (monkey (gnugo-get :monkey))) + (gethash (car (aref monkey 0)) + (gnugo--tree-mnum tree) + ;; should be unnecessary + "?"))))) acc)) `(let ,(delete-dups (copy-sequence acc)) (format ,cur ,@(reverse (mapcar 'car acc)))))) -- 2.39.2