Function: gametree-insert-score
gametree-insert-score is an interactive and byte-compiled function
defined in gametree.el.gz.
Signature
(gametree-insert-score SCORE &optional AUTO)
Documentation
Insert a score tag with value SCORE at the end of the current line.
If this line already has a score tag, just jump to it and alter it. When called from a program, optional AUTO flag tells if the score is being entered automatically (and thus should lack the manual mark).
Key Bindings
Source Code
;; Defined in /usr/src/emacs/lisp/play/gametree.el.gz
(defun gametree-insert-score (score &optional auto)
"Insert a score tag with value SCORE at the end of the current line.
If this line already has a score tag, just jump to it and alter it.
When called from a program, optional AUTO flag tells if the score is
being entered automatically (and thus should lack the manual mark)."
(interactive "*P")
(beginning-of-line 1)
(if (looking-at gametree-score-regexp)
(progn
(goto-char (match-beginning 3))
(if (and auto (not (null (match-string 2))))
(delete-region (match-beginning 2) (match-end 2)))
(if (not (null score))
(delete-region (match-beginning 3) (match-end 3)))
(if (and (not auto) (null (match-string 2)))
(insert gametree-score-manual-flag)))
(end-of-line 1)
(if (= 0 (save-excursion (skip-chars-backward " \t")))
(insert " "))
(insert gametree-score-opener)
(if (not auto) (insert gametree-score-manual-flag))
(save-excursion (insert gametree-score-closer)))
(if (not (null score))
(save-excursion
(insert (int-to-string (prefix-numeric-value score))))))