mlang pushed a commit to branch externals/chess in repository elpa. commit 3fa2b4db0eb930f763353cd3b72623215d30341a Author: Mario Lang <ml...@delysid.org> Date: Sun Jun 15 04:05:03 2014 +0200
(chess-display-highlight-move): Simplify. --- ChangeLog | 1 + chess-display.el | 9 +++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2a89732..436fe5b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,7 @@ * chess-display.el (chess-display-draw-square): New function. (chess-display-paint-move, chess-display-set-piece): Use it. + (chess-display-highlight-move): Simplify. * chess-plain.el (chess-plain-handler): Fix error if unknown event is received. diff --git a/chess-display.el b/chess-display.el index 61a3ca2..f92a213 100644 --- a/chess-display.el +++ b/chess-display.el @@ -353,12 +353,14 @@ also view the same game." (defun chess-display-draw-square (display index piece &optional pos) (cl-check-type display (or null buffer)) (cl-check-type index (integer 0 63)) + (cl-check-type piece (member ? ?P ?N ?B ?R ?Q ?K ?p ?n ?b ?r ?q ?k)) (chess-with-current-buffer display (cl-check-type pos (or null (number ((point-min)) ((point-max))))) (funcall chess-display-event-handler 'draw-square (or pos (chess-display-index-pos nil index)) piece index))) (defun chess-display-paint-move (display ply) + (cl-check-type display (or null buffer)) (chess-with-current-buffer display (if chess-display-highlight-last-move (chess-display-redraw)) @@ -440,10 +442,9 @@ that is supported by most displays, and is the default mode." (defun chess-display-highlight-move (display ply) "Highlight the last move made in the current game." - (chess-with-current-buffer display - (chess-display-highlight nil "medium sea green" - (chess-ply-source ply) - (chess-ply-target ply)))) + (chess-display-highlight display "medium sea green" + (chess-ply-source ply) + (chess-ply-target ply))) (defun chess-display-highlight-passed-pawns (&optional display) (interactive)