[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/gnugo 2f73382 353/357: [gnugo] Add some docstrings to s
From: |
Stefan Monnier |
Subject: |
[elpa] externals/gnugo 2f73382 353/357: [gnugo] Add some docstrings to some vars/funcs. |
Date: |
Sun, 29 Nov 2020 14:51:56 -0500 (EST) |
branch: externals/gnugo
commit 2f73382ffee6ec21f1e7b72a95dafdeb53cb7715
Author: Thien-Thi Nguyen <ttn@gnu.org>
Commit: Thien-Thi Nguyen <ttn@gnu.org>
[gnugo] Add some docstrings to some vars/funcs.
* packages/gnugo/gnugo.el (gnugo-option-history): Add docstring.
(gnugo-other, gnugo-lsquery, gnugo-yang, gnugo-yy): Likewise.
---
gnugo.el | 26 +++++++++++++++++++++++++-
1 file changed, 25 insertions(+), 1 deletion(-)
diff --git a/gnugo.el b/gnugo.el
index abc4970..b605d9c 100644
--- a/gnugo.el
+++ b/gnugo.el
@@ -204,7 +204,8 @@ list of forms.")
("O" . gnugo-O-face))
"Font lock keywords for `gnugo-board-mode'.")
-(defvar gnugo-option-history nil)
+(defvar gnugo-option-history nil
+ "History list of options for `gnugo' invocation.")
(defvar gnugo-state nil) ; hint: C-c C-p
@@ -386,6 +387,7 @@ Handle the big, slow-to-render, and/or uninteresting ones
specially."
(string= "black" string))
(defun gnugo-other (color)
+ "If COLOR is \"black\", return \"white\", otherwise \"black\"."
(if (gnugo--blackp color) "white" "black"))
(defun gnugo-current-player ()
@@ -486,6 +488,7 @@ when you are sure the command cannot fail."
(string-to-number (gnugo-query cmd)))
(defun gnugo-lsquery (message-format &rest args)
+ "Apply `gnugo-query' to args; split its rv (return list of strings)."
(split-string (apply 'gnugo-query message-format args)))
(defsubst gnugo--count-query (fmt &rest args)
@@ -524,12 +527,33 @@ Return final buffer position (i.e., point)."
(gnugo-get :obarray)))
(defun gnugo-yang (c)
+ "Return the \"image type information\" corresponding to character C.
+C is one of the four characters used in the ASCII representation
+of a game board -- ?+ (U+2B PLUS SIGN), ?. (U+2E FULL STOP), ?X
+and ?O (U+58 and U+4F, LATIN CAPITAL LETTER X and O, respectively).
+For example, here is a 5x5 board with two stones placed:
+
+ . . . . .
+ . O . + . (white at B4)
+ . . + . .
+ . + . + X (black at E2)
+ . . . . .
+
+The image type information consists of a single symbol for ?. and ?+
+and a pair (SANS-POINT . WITH-POINT) for ?X and ?O. Both SANS-POINT
+and WITH-POINT are symbols. For other C, return nil."
(gnugo-aqr c '((?+ . hoshi)
(?. . empty)
(?X . (bmoku . bpmoku))
(?O . (wmoku . wpmoku)))))
(defun gnugo-yy (yin yang &optional momentaryp)
+ "Return a symbol made by formatting YIN (an integer) and YANG.
+The returned symbol has the format N-SYMBOL.
+
+If YANG is a symbol, use it directly. Otherwise, YANG must be a pair.
+If optional arg MOMENTARYP is non-nil, use the `cdr' of YANG.
+Otherwise, use the `car' of YANG. See `gnugo-yang'."
(gnugo-f (format "%d-%s"
yin (cond ((symbolp yang) yang)
(momentaryp (cdr yang))
- [elpa] externals/gnugo 8123275 338/357: [gnugo] Drop trailing fullstop in animation message., (continued)
- [elpa] externals/gnugo 8123275 338/357: [gnugo] Drop trailing fullstop in animation message., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 08f11af 339/357: [gnugo int] Incorporate ‘gnugo-toggle-image-display’ into unique caller., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 1e01c65 340/357: [gnugo] When sorry, say "Sorry" first., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 3541ccf 343/357: [gnugo int] Lift redundant pall of death computation., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 38b2529 124/357: [gnugo int] Add abstraction: gnugo--mkht, Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 0f9f540 125/357: [gnugo int] Maintain tree MNUM., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 7211950 346/357: [gnugo] Indicate seki groups on the board., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 35c4645 347/357: [gnugo] Make ‘C-u F’ store additional SGF properties., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 0c4b37b 349/357: [gnugo] Document new ‘C-u F’ behavior., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo e66bfa0 352/357: [gnugo int] Gate ‘cursor-intangible-mode’ call precisely, Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 2f73382 353/357: [gnugo] Add some docstrings to some vars/funcs.,
Stefan Monnier <=
- [elpa] externals/gnugo eb9748f 355/357: [gnugo maint] Update years in copyright notice; nfc., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 2dd0aca 357/357: * .gitignore: New file, Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo ee905ef 048/357: [gnugo] Fix bug: Compute grid spacing using offset math., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 566623c 121/357: [gnugo int] Invert ‘if’ CONDITION and THEN/ELSE clauses., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 19309c3 139/357: [gnugo frolic] Handle invalid branch more consistently., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo d214e7e 137/357: [gnugo frolic] Add command to set the main line., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo dd42857 148/357: [gnugo frolic] Set ‘truncate-lines’., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 1a544a5 154/357: [gnugo int] Whitespace munging; nfc., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 89d10e4 159/357: [gnugo int] Reorder gametree IR: ENDS, MNUM, ROOT, KIDS., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo bba08d3 158/357: [gnugo sgf int] Internalize ‘gnugo/sgf-hang-from-root’., Stefan Monnier, 2020/11/29