[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] 91/255: adding properties to the board string
From: |
Eric Schulte |
Subject: |
[elpa] 91/255: adding properties to the board string |
Date: |
Sun, 16 Mar 2014 01:02:26 +0000 |
eschulte pushed a commit to branch go
in repository elpa.
commit 63d995e1a28d24a6a1a164fcc535a169d615b23e
Author: Eric Schulte <address@hidden>
Date: Thu May 24 20:23:13 2012 -0600
adding properties to the board string
Unfortunately something seems to be broken with the preservation of
string properties.
---
sgf-board.el | 14 ++++++++------
1 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/sgf-board.el b/sgf-board.el
index 09e52ac..6fe9bd7 100644
--- a/sgf-board.el
+++ b/sgf-board.el
@@ -151,12 +151,14 @@
((= size 9)
(or (= 2 n)
(= 4 n))))))
- (let ((val (aref board (pos-to-index pos size))))
- (cond
- ((equal val :W) white-piece)
- ((equal val :B) black-piece)
- ((and (stringp val) (= 1 (length val)) val))
- (t (if (and (emph (car pos)) (emph (cdr pos))) "+" ".")))))))
+ (let* ((val (aref board (pos-to-index pos size)))
+ (str (cond
+ ((equal val :W) white-piece)
+ ((equal val :B) black-piece)
+ ((and (stringp val) (= 1 (length val)) val))
+ (t (if (and (emph (car pos)) (emph (cdr pos))) "+" ".")))))
+ (put-text-property 0 (length str) :pos pos str)
+ str))))
(defun board-row-to-string (board row)
(let* ((size (board-size board))
- [elpa] 81/255: normalization, (continued)
- [elpa] 81/255: normalization, Eric Schulte, 2014/03/15
- [elpa] 80/255: splitting the sgf back end from the board interface, Eric Schulte, 2014/03/15
- [elpa] 84/255: more transition, Eric Schulte, 2014/03/15
- [elpa] 82/255: organization, Eric Schulte, 2014/03/15
- [elpa] 88/255: made the *back-ends* variable singular, Eric Schulte, 2014/03/15
- [elpa] 57/255: splitting sgf.el into board test and utility files, Eric Schulte, 2014/03/15
- [elpa] 87/255: removed old variable, Eric Schulte, 2014/03/15
- [elpa] 83/255: starting to transition to generic board interface, Eric Schulte, 2014/03/15
- [elpa] 85/255: working with new set less some state-leak issues, Eric Schulte, 2014/03/15
- [elpa] 90/255: moving around major mode and key bindings, Eric Schulte, 2014/03/15
- [elpa] 91/255: adding properties to the board string,
Eric Schulte <=
- [elpa] 86/255: playing gnugo, Eric Schulte, 2014/03/15
- [elpa] 94/255: remove old variable from tests, Eric Schulte, 2014/03/15
- [elpa] 92/255: worked around stupid bug in mapconcat, Eric Schulte, 2014/03/15
- [elpa] 93/255: able to play against gnugo, Eric Schulte, 2014/03/15
- [elpa] 95/255: renaming files for go- prefix, Eric Schulte, 2014/03/15
- [elpa] 98/255: *trackers* are multiple subordinate back-ends, Eric Schulte, 2014/03/15
- [elpa] 89/255: tweaks, Eric Schulte, 2014/03/15
- [elpa] 102/255: simpler name for main go-board function, Eric Schulte, 2014/03/15
- [elpa] 100/255: automated playing with gnugo, Eric Schulte, 2014/03/15
- [elpa] 99/255: single function to play gnugo, Eric Schulte, 2014/03/15