emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/gnugo 7ef5c66 036/357: [gnugo int] Revamp gnugo-{put, g


From: Stefan Monnier
Subject: [elpa] externals/gnugo 7ef5c66 036/357: [gnugo int] Revamp gnugo-{put, get} doc / indentation decl.
Date: Sun, 29 Nov 2020 14:50:42 -0500 (EST)

branch: externals/gnugo
commit 7ef5c66f816a15f25c158e4cb2484cf6682eef9e
Author: Thien-Thi Nguyen <ttn@gnu.org>
Commit: Thien-Thi Nguyen <ttn@gnu.org>

    [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.
---
 gnugo.el | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/gnugo.el b/gnugo.el
index 340c46e..f3c3b4f 100644
--- a/gnugo.el
+++ b/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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]