[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] 02/03: [gnugo int] Consolidate paren overlays access.
From: |
Thien-Thi Nguyen |
Subject: |
[elpa] 02/03: [gnugo int] Consolidate paren overlays access. |
Date: |
Thu, 17 Apr 2014 08:46:47 +0000 |
ttn pushed a commit to branch master
in repository elpa.
commit 8764e80ec4d620dcc9b648745366498d81eeb885
Author: Thien-Thi Nguyen <address@hidden>
Date: Thu Apr 17 10:26:32 2014 +0200
[gnugo int] Consolidate paren overlays access.
* packages/gnugo/gnugo.el (gnugo-put): Update docstring.
(gnugo-refresh): Use ‘destructuring-bind’ for paren overlays.
(gnugo): Don't ‘gnugo-put’ overlays in :lparen-ov and
:rparen-ov; instead, cons them and stash the pair in :paren-ov.
---
packages/gnugo/gnugo.el | 15 +++++++--------
1 files changed, 7 insertions(+), 8 deletions(-)
diff --git a/packages/gnugo/gnugo.el b/packages/gnugo/gnugo.el
index 1d5d2b3..e20bd84 100644
--- a/packages/gnugo/gnugo.el
+++ b/packages/gnugo/gnugo.el
@@ -243,8 +243,8 @@ you may never really understand to any degree of personal
satisfaction\".
46 = 9 places * (4 moku + 1 empty) + 1 hoshi; see functions
`gnugo-toggle-image-display', `gnugo-yy' and `gnugo-yang'
- :lparen-ov -- overlays shuffled about to indicate the last move; only
- :rparen-ov one is used when displaying using images
+ :paren-ov -- a pair (left and right) of overlays shuffled about to indicate
+ the last move; only one is used when displaying using images
:last-user-bpos -- board position; keep the hapless human happy
@@ -1414,8 +1414,7 @@ its move."
window last)
;; last move
(when move
- (let ((l-ov (gnugo-get :lparen-ov))
- (r-ov (gnugo-get :rparen-ov)))
+ (destructuring-bind (l-ov . r-ov) (gnugo-get :paren-ov)
(if (member move '("PASS" "resign"))
(mapc 'delete-overlay (list l-ov r-ov))
(gnugo-goto-pos move)
@@ -2500,10 +2499,10 @@ starting a new one. See `gnugo-board-mode'
documentation for more info."
(gnugo-put :gnugo-color (gnugo-other user-color))
(gnugo-put :highlight-last-move-spec
(gnugo-put :default-highlight-last-move-spec '("(" -1 nil)))
- (gnugo-put :lparen-ov (make-overlay 1 1))
- (gnugo-put :rparen-ov (let ((ov (make-overlay 1 1)))
- (overlay-put ov 'display ")")
- ov))
+ (gnugo-put :paren-ov (cons (make-overlay 1 1)
+ (let ((ov (make-overlay 1 1)))
+ (overlay-put ov 'display ")")
+ ov)))
(gnugo--plant-and-climb
(gnugo/sgf-create "(;FF[4]GM[1])" t))
(gnugo--SZ! board-size)