[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/gnugo dfe75eb 281/357: [gnugo] Replace ‘gnugo-toggle-i
From: |
Stefan Monnier |
Subject: |
[elpa] externals/gnugo dfe75eb 281/357: [gnugo] Replace ‘gnugo-toggle-image-display-command’ w/ ‘gnugo-image-display-mode’. |
Date: |
Sun, 29 Nov 2020 14:51:39 -0500 (EST) |
branch: externals/gnugo
commit dfe75ebe4167831757cc68ee87b7df494cf07051
Author: Thien-Thi Nguyen <ttn@gnu.org>
Commit: Thien-Thi Nguyen <ttn@gnu.org>
[gnugo] Replace ‘gnugo-toggle-image-display-command’ w/
‘gnugo-image-display-mode’.
* packages/gnugo/gnugo.el (gnugo-image-display-mode): New command.
(gnugo-toggle-image-display-command): Delete command.
(gnugo-board-mode-map): Update binding for ‘i’.
---
NEWS | 1 +
gnugo.el | 17 +++++++++++------
2 files changed, 12 insertions(+), 6 deletions(-)
diff --git a/NEWS b/NEWS
index b873710..7153073 100644
--- a/NEWS
+++ b/NEWS
@@ -21,6 +21,7 @@ NB: "RCS: X..Y " means that the particular release includes
- changes to ‘gnugo-xpms’
- now a normal var, and not a feature
- value can be a function to compute XPMs
+ - ‘gnugo-image-display-mode’ replaces ‘gnugo-toggle-image-display-command’
- 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 ffa2ebb..e95c91d 100644
--- a/gnugo.el
+++ b/gnugo.el
@@ -2331,11 +2331,16 @@ which placed the stone at point."
(cond ((numberp count) count)
((consp count) (car count)))))
-(defun gnugo-toggle-image-display-command () ; ugh
- "Toggle use of images to display the board, then refresh."
- (interactive)
- (gnugo-toggle-image-display)
- (save-excursion (gnugo-refresh)))
+(define-minor-mode gnugo-image-display-mode
+ "If enabled, display the board using images.
+See function `display-images-p' and variable `gnugo-xpms'."
+ :variable
+ ((gnugo-get :display-using-images)
+ .
+ (lambda (bool)
+ (unless (eq bool (gnugo-get :display-using-images))
+ (gnugo-toggle-image-display)
+ (save-excursion (gnugo-refresh))))))
(defsubst gnugo--node-with-played-stone (pos &optional noerror)
(car (gnugo--mem-with-played-stone pos noerror)))
@@ -2728,7 +2733,7 @@ See `gnugo-board-mode' for a full list of commands."
("h" . gnugo-move-history)
("L" . gnugo-frolic-in-the-leaves)
("\C-c\C-l" . gnugo-frolic-in-the-leaves)
- ("i" . gnugo-toggle-image-display-command)
+ ("i" . gnugo-image-display-mode)
("w" . gnugo-worm-stones)
("W" . gnugo-worm-data)
("d" . gnugo-dragon-stones)
- [elpa] externals/gnugo 6ddf38f 269/357: [gnugo int] Add abstraction: gnugo--assist-state, (continued)
- [elpa] externals/gnugo 6ddf38f 269/357: [gnugo int] Add abstraction: gnugo--assist-state, Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo d48adca 244/357: [gnugo] On disable, transform in-flight user-move into suggestion., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 764251b 259/357: [gnugo int] Fix bug: Use correct color for "Not your turn yet"., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 16da062 284/357: [gnugo int] Use ‘loop ... collect’ more., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo e2f7c7b 212/357: [gnugo int] Consolidate display scaling factors access., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 2bde4bc 207/357: [gnugo] Add hook: gnugo-start-game-hook, Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 714d3c9 201/357: [gnugo int] Commentary munging; nfc., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo e019871 206/357: [gnugo] Add abstraction: gnugo-current-player, Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 40f7299 225/357: [gnugo] Fix bug: Ensure gametree sync for -l/--infile., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo cedd448 227/357: [gnugo int] Add abstraction: gnugo--prop<-color, Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo dfe75eb 281/357: [gnugo] Replace ‘gnugo-toggle-image-display-command’ w/ ‘gnugo-image-display-mode’.,
Stefan Monnier <=
- [elpa] externals/gnugo 88620df 278/357: [gnugo int] Decruft: Drop :local-xpms support., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo cacb0c7 275/357: [gnugo] Publicize ‘gnugo-undo-reaction’., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 48913fd 313/357: [gnugo maint] Update years in copyright notice; nfc., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 844189b 308/357: [gnugo] Release: 3.0.0, Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 9928736 299/357: * packages/gnugo: Add `cl-lib' as dependency; require it and use its names., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 67c82c1 309/357: Fix some quoting problems in doc strings, Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 6bf46ba 290/357: [gnugo maint] Add ‘Maintainer’ header per top-level README; nfc., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 7dbf4d7 305/357: [gnugo int] Use idiomatic ‘re-search-forward’ BOUND., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 289e336 310/357: [gnugo int] Use ‘setq-local’., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo d4a4afd 289/357: [gnugo int] Add section "Tip Jar" in Commentary; nfc., Stefan Monnier, 2020/11/29