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

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

[elpa] externals/gnugo 35571e3 287/357: [gnugo int] Use private obarray


From: Stefan Monnier
Subject: [elpa] externals/gnugo 35571e3 287/357: [gnugo int] Use private obarray for :all-yy elems, display props.
Date: Sun, 29 Nov 2020 14:51:41 -0500 (EST)

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

    [gnugo int] Use private obarray for :all-yy elems, display props.
    
    * packages/gnugo/gnugo.el (gnugo-put): Update :all-yy blurb.
    (gnugo-f): Rewrite.
    (gnugo-cleanup): Don't bother w/ symbol cleanup.
    (gnugo-board-mode): Init :obarray.
---
 gnugo.el | 24 +++++++-----------------
 1 file changed, 7 insertions(+), 17 deletions(-)

diff --git a/gnugo.el b/gnugo.el
index e32f18a..e67c29c 100644
--- a/gnugo.el
+++ b/gnugo.el
@@ -275,7 +275,7 @@ you may never really understand to any degree of personal 
satisfaction\".
                           `gnugo-toggle-image-display' and `gnugo-refresh',
                           as well as gnugo-xpms.el (available elsewhere)
 
- :all-yy -- list of 46 keywords used as the `category' text property
+ :all-yy -- list of 46 symbols used as the `category' text property
             (so that their plists, typically w/ property `display' or
             `do-not-display') are consulted by the Emacs display engine;
             46 = 9 places * (4 moku + 1 empty) + 1 hoshi; see functions
@@ -505,8 +505,11 @@ when you are sure the command cannot fail."
                                (1- letter)))
                            ?A)))))
 
-(defun gnugo-f (frag)
-  (intern (format ":gnugo-%s%s-props" (gnugo-get :diamond) frag)))
+(defun gnugo-f (id)
+  (intern (if (symbolp id)
+              (symbol-name id)
+            id)
+          (gnugo-get :obarray)))
 
 (defun gnugo-yang (c)
   (cdr (assq c '((?+ . hoshi)
@@ -1744,20 +1747,6 @@ its move."
   (when (gnugo-board-buffer-p)
     (unless (zerop (buffer-size))
       (message "Thank you for playing GNU Go."))
-    (mapc (lambda (sym)
-            (setplist sym nil)          ; "...is next to fordliness." --Huxley
-            ;; Sigh, "2nd arg optional" obsolete as of Emacs 23.3.
-            ;; No worries, things will be Much Better w/ structs, RSN...
-            (unintern sym nil))
-          (append (gnugo-get :all-yy)
-                  (mapcar 'gnugo-f
-                          '(anim
-                            tpad
-                            gpad
-                            gspc
-                            lpad
-                            rpad
-                            ispc))))
     (setq gnugo-state nil)))
 
 (defun gnugo-position ()
@@ -2544,6 +2533,7 @@ In this mode, keys do not self insert.
                                (overlay-put ov 'display ")")
                                ov)))
   (gnugo-put :mul '(1 . 1))
+  (gnugo-put :obarray (make-vector 31 nil))
   (add-to-invisibility-spec :nogrid))
 
 ;;;---------------------------------------------------------------------------



reply via email to

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