ttn pushed a commit to branch ttn-gnugo
in repository elpa.
commit 54cdb33b94478d60c4eadbcf8ef155a67ce52f49
Author: Thien-Thi Nguyen <[email protected]>
Date: Sat Feb 15 12:35:36 2014 +0100
[gnugo int] Revamp gnugo-{put,get} doc / indentation decl.
* packages/gnugo/gnugo.el (gnugo-put): Move shared docstring here;
specialize it; replace top-level direct symbol-plist
assignment w/ an internal ‘declare’ form for indentation.
(gnugo-get): Add docstring.
---
packages/gnugo/ChangeLog | 9 +++++++++
packages/gnugo/gnugo.el | 19 ++++++++++---------
2 files changed, 19 insertions(+), 9 deletions(-)
diff --git a/packages/gnugo/ChangeLog b/packages/gnugo/ChangeLog
index cebbc0d..2191eac 100644
--- a/packages/gnugo/ChangeLog
+++ b/packages/gnugo/ChangeLog
@@ -1,5 +1,14 @@
2014-02-15 Thien-Thi Nguyen <[email protected]>
+ [gnugo int] Revamp gnugo-{put,get} doc / indentation decl.
+
+ * gnugo.el (gnugo-put): Move shared docstring here;
+ specialize it; replace top-level direct symbol-plist
+ assignment w/ an internal ‘declare’ form for indentation.
+ (gnugo-get): Add docstring.
+
+2014-02-15 Thien-Thi Nguyen <[email protected]>
+
[gnugo int] Use ‘dolist’ and ‘destructuring-bind’.
* gnugo.el (gnugo-board-mode): ...here,
diff --git a/packages/gnugo/gnugo.el b/packages/gnugo/gnugo.el
index 340c46e..f3c3b4f 100644
--- a/packages/gnugo/gnugo.el
+++ b/packages/gnugo/gnugo.el
@@ -170,12 +170,8 @@ For ~t, the value is a snapshot, use `gnugo-refresh' to
update it.")
;;;---------------------------------------------------------------------------
;;; Support functions
-(put 'gnugo-put 'lisp-indent-function 1)
-(defun gnugo-put (key value) (puthash key value gnugo-state))
-(defun gnugo-get (key) (gethash key gnugo-state))
-
-(let ((docs "Put or get move/game/board-specific properties.
-\(This docstring is shared by `gnugo-put' and `gnugo-get'.\)
+(defun gnugo-put (key value)
+ "Associate move/game/board-specific property KEY with VALUE.
There are many properties, each named by a keyword, that record and control
how gnugo.el manages each game. Each GNUGO Board buffer has its own set
@@ -233,9 +229,14 @@ you may never really understand to any degree of personal
satisfaction\".
:last-user-bpos -- board position; keep the hapless human happy
-As things stabilize probably more info will be added to this docstring."))
- (put 'gnugo-put 'function-documentation docs)
- (put 'gnugo-get 'function-documentation docs))
+As things stabilize probably more info will be added to this docstring."
+ (declare (indent 1))
+ (puthash key value gnugo-state))
+
+(defun gnugo-get (key)
+ "Return the move/game/board-specific value for KEY.
+See `gnugo-put'."
+ (gethash key gnugo-state))
(defun gnugo-describe-internal-properties ()
"Pretty-print `gnugo-state' properties in another buffer.