From 42c0fd53bcb88b4f9cf78fdd2216684a2a288203 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Tue, 16 Apr 2002 21:29:15 +0000 Subject: (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). --- chess-ply.el | 10 ++++++++++ 1 file changed, 10 insertions(+) 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))) -- cgit v1.2.3