[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/gnugo 5414994 277/357: [gnugo] Handle function for ‘gn
From: |
Stefan Monnier |
Subject: |
[elpa] externals/gnugo 5414994 277/357: [gnugo] Handle function for ‘gnugo-xpms’ value. |
Date: |
Sun, 29 Nov 2020 14:51:38 -0500 (EST) |
branch: externals/gnugo
commit 5414994d2a14298bac1aba38601fb705a9831ee6
Author: Thien-Thi Nguyen <ttn@gnu.org>
Commit: Thien-Thi Nguyen <ttn@gnu.org>
[gnugo] Handle function for ‘gnugo-xpms’ value.
* packages/gnugo/gnugo.el (gnugo-xpms): Update docstring.
(gnugo-toggle-image-display): If ‘gnugo-xpms’
is a function, call it with the board size and
take its rv as the set of XPM images to use.
---
NEWS | 4 +++-
gnugo.el | 15 +++++++++++----
2 files changed, 14 insertions(+), 5 deletions(-)
diff --git a/NEWS b/NEWS
index 1f48fdd..b873710 100644
--- a/NEWS
+++ b/NEWS
@@ -18,7 +18,9 @@ NB: "RCS: X..Y " means that the particular release includes
- proper support for ‘-l FILENAME’ / ‘--infile FILENAME’
- dropped support for ‘gnugo-program’ of form "PROGRAM OPTIONS..."
- dropped command: ‘t’ (gnugo-toggle-dead-group)
- - ‘gnugo-xpms’ now a normal var, and not a feature
+ - changes to ‘gnugo-xpms’
+ - now a normal var, and not a feature
+ - value can be a function to compute XPMs
- PASS for SZ <= 19 normalized to "" on read, written as ""
- ‘=’ also displays move number of the stone (if any) at that position
- ‘C-u F’ adds the (abbreviated) blurb as a comment to the last node
diff --git a/gnugo.el b/gnugo.el
index 614d0ed..61ef95f 100644
--- a/gnugo.el
+++ b/gnugo.el
@@ -194,7 +194,11 @@ LOCATION is an integer encoding edge, corner, or center:
For instance, 4 means \"left edge\", 9 means \"bottom right\".
There is only one location for hoshi: center. The other five
-types each have all possible locations. So (+ 1 (* 9 5)) => 46.")
+types each have all possible locations. So (+ 1 (* 9 5)) => 46.
+
+The value can also be a function (satisfying `functionp') that
+takes one arg, the size of the board, and returns the appropriate
+list of forms.")
;;;---------------------------------------------------------------------------
;;; Variables for the inquisitive programmer
@@ -518,9 +522,12 @@ when you are sure the command cannot fail."
(defun gnugo-toggle-image-display ()
(unless (display-images-p)
(user-error "Display does not support images, sorry"))
- (let ((fresh (or (gnugo-get :local-xpms)
- gnugo-xpms
- (user-error "Sorry, `gnugo-xpms' unset"))))
+ (let ((fresh (or (gnguo-get :local-xpms)
+ (if (functionp gnugo-xpms)
+ (funcall gnugo-xpms (gnugo-get :SZ))
+ gnugo-xpms))))
+ (unless fresh
+ (user-error "Sorry, `gnugo-xpms' unset"))
(unless (eq fresh (gnugo-get :xpms))
(gnugo-put :xpms fresh)
(gnugo--forget :all-yy)))
- [elpa] externals/gnugo 3903907 235/357: [gnugo] Validate position arg of GTP commands ‘undo’, ‘gg-undo’., (continued)
- [elpa] externals/gnugo 3903907 235/357: [gnugo] Validate position arg of GTP commands ‘undo’, ‘gg-undo’., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo ab1f4c2 242/357: [gnugo] Fix bug: DTRT for suggestion ‘nowarp’ check., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo e814724 243/357: [gnugo] Allow user to request suggestion for GNU Go., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 5157534 241/357: [gnugo int] Use ‘destructuring-bind’ more., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 6c99d78 251/357: [gnugo int] Add abstraction: gnugo--no-worries, Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 9f5fcfc 250/357: [gnugo int] Add abstraction: gnugo--resignp, Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 2612c6b 263/357: [gnugo] Replace abdication w/ Assist and Zombie minor modes., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo b586e0c 268/357: [gnugo] Refuse to climb towards root when in Assist mode., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo af7aa4a 267/357: [gnugo] Fix bug: On role switch, flip karma after roles., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo b6ac4ac 283/357: [gnugo frolic] Add command to navigate to end of branch., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 5414994 277/357: [gnugo] Handle function for ‘gnugo-xpms’ value.,
Stefan Monnier <=
- [elpa] externals/gnugo f42837f 280/357: [gnugo int] Mention ‘gnugo-frolic-mode-map’ in Commentary; nfc., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo ef2bfa7 273/357: [gnugo maint] Update HACKING; nfc., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 407ca43 266/357: [gnugo int] Move some ‘gnugo-gate’ calls down-chain., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 1ce9fbb 312/357: [gnugo slog] Clear ‘inhibit-point-motion-hooks’., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 9208a24 317/357: * gnugo/gnugo.el (gnugo-refresh): Fix unknown function `pushnew`, Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 61a7217 297/357: [gnugo maint] Add some headers to gnugo-frolic.el; nfc., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 5b213db 293/357: fixup! [gnugo imgen] New feature: gnugo-imgen, Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 36a2fd5 291/357: [gnugo int] Accomodate XPM w/ :color-symbols property., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 2d4e59e 292/357: [gnugo imgen] New feature: gnugo-imgen, Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 7478f81 302/357: [gnugo int] Bump required ‘xpm’ version to "1.0.1"., Stefan Monnier, 2020/11/29