summaryrefslogtreecommitdiff
path: root/chess-plain.el
diff options
context:
space:
mode:
authorMario Lang <mlang@delysid.org>2003-01-08 00:45:02 +0000
committerMario Lang <mlang@delysid.org>2003-01-08 00:45:02 +0000
commit90a024f2a28023b1c90cecc7e883856c613404f0 (patch)
treeaa5b4d518e1be951c060041a9fa7a781a6eec8e9 /chess-plain.el
parent0ab4a2fbb073f6641ae4eea322e00131269a78e5 (diff)
(chess-plain-piece-text): Simplyfied a bit
(chess-plain-draw-square): Doc fix
Diffstat (limited to 'chess-plain.el')
-rw-r--r--chess-plain.el24
1 files changed, 11 insertions, 13 deletions
diff --git a/chess-plain.el b/chess-plain.el
index c794038..7811811 100644
--- a/chess-plain.el
+++ b/chess-plain.el
@@ -53,7 +53,8 @@
(?p . ?p))
"*Alist of pieces and their corresponding characters."
:group 'chess-plain
- :type '(alist :key-type character :value-type character))
+ :type '(alist :key-type (character :tag "Internal representation")
+ :value-type (character :tag "Printed representation")))
(defcustom chess-plain-upcase-indicates 'color
"*Defines what a upcase char should indicate.
@@ -63,8 +64,7 @@ lowercase char a black piece. Possible values: 'color (default),
indicates a piece on a black square. (Note that you also need to
modify `chess-plain-piece-chars' to avoid real confusion.)"
:group 'chess-plain
- :type '(choice (const 'color) (const 'square-color)))
- ;; fails somehow
+ :type '(choice (const color) (const square-color)))
(defcustom chess-plain-spacing 1
"*Number of spaces between pieces."
@@ -130,22 +130,20 @@ modify `chess-plain-piece-chars' to avoid real confusion.)"
(if white-square
chess-plain-white-square-char
chess-plain-black-square-char)
- (let* ((what chess-plain-upcase-indicates)
- (pchar (cdr (assq piece chess-plain-piece-chars)))
- (piece (cond
- ((eq what 'square-color)
- (if white-square
- (downcase pchar)
- (upcase pchar)))
- (t pchar)))
- (p (char-to-string piece)))
+ (let* ((pchar (cdr (assq piece chess-plain-piece-chars)))
+ (p (char-to-string
+ (if (eq chess-plain-upcase-indicates 'square-color)
+ (if white-square
+ (downcase pchar)
+ (upcase pchar))
+ pchar))))
(add-text-properties 0 1 (list 'face (if (> piece ?a)
'chess-plain-black-face
'chess-plain-white-face)) p)
p))))
(defsubst chess-plain-draw-square (pos piece index)
- "Draw a piece image at point on an already drawn display."
+ "Draw a piece image at POS on an already drawn display."
(save-excursion
(goto-char pos)
(delete-char 1)