summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2002-04-16 21:29:15 +0000
committerJohn Wiegley <johnw@newartisans.com>2002-04-16 21:29:15 +0000
commit42c0fd53bcb88b4f9cf78fdd2216684a2a288203 (patch)
treec3af05044746721513f4b4f3b72571170c27df8d
parentdf9a0f1d290e8729a6fbe7fcceb152097062fb18 (diff)
(chess-ply-set-keyword): Added a new function for setting a ply's
keyword, with an optional value (must be non-nil for setting with a value to occur).
-rw-r--r--chess-ply.el10
1 files changed, 10 insertions, 0 deletions
diff --git a/chess-ply.el b/chess-ply.el
index e5eb626..1d42f53 100644
--- a/chess-ply.el
+++ b/chess-ply.el
@@ -74,6 +74,16 @@
t
(cadr item)))))
+(defun chess-ply-set-keyword (ply keyword &optional value)
+ (let* ((changes (chess-ply-changes ply))
+ (item (memq keyword changes)))
+ (if item
+ (if value
+ (setcar (cdr item) value))
+ (nconc changes (if value
+ (list keyword value)
+ (list keyword))))))
+
(defsubst chess-ply-source (ply)
(let ((changes (chess-ply-changes ply)))
(and (listp changes) (not (symbolp (car changes)))