[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] 03/04: [gnugo] Replace ‘gnugo -toggle-grid’ w/ ‘gnugo-grid-mode’.
From: |
Thien-Thi Nguyen |
Subject: |
[elpa] 03/04: [gnugo] Replace ‘gnugo -toggle-grid’ w/ ‘gnugo-grid-mode’. |
Date: |
Sat, 03 May 2014 05:57:38 +0000 |
ttn pushed a commit to branch master
in repository elpa.
commit 9df80139624da5c8a95ec14459afb9b62a052d59
Author: Thien-Thi Nguyen <address@hidden>
Date: Fri May 2 15:56:29 2014 +0200
[gnugo] Replace ‘gnugo-toggle-grid’ w/ ‘gnugo-grid-mode’.
* packages/gnugo/gnugo.el (gnugo-grid-mode): New command.
(gnugo-toggle-grid): Delete command.
(gnugo-board-mode-map): Update binding for ‘g’.
---
packages/gnugo/NEWS | 1 +
packages/gnugo/gnugo.el | 19 +++++++++++--------
2 files changed, 12 insertions(+), 8 deletions(-)
diff --git a/packages/gnugo/NEWS b/packages/gnugo/NEWS
index 7153073..2db37f4 100644
--- a/packages/gnugo/NEWS
+++ b/packages/gnugo/NEWS
@@ -22,6 +22,7 @@ NB: "RCS: X..Y " means that the particular release includes
- 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’
+ - ‘gnugo-grid-mode’ replaces ‘gnugo-toggle-grid’
- 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/packages/gnugo/gnugo.el b/packages/gnugo/gnugo.el
index e95c91d..990ee48 100644
--- a/packages/gnugo/gnugo.el
+++ b/packages/gnugo/gnugo.el
@@ -567,14 +567,17 @@ when you are sure the command cannot fail."
'(1 . 1)))
(gnugo-put :display-using-images new)))
-(defun gnugo-toggle-grid ()
- "Turn the grid around the board on or off."
- (interactive)
- (funcall (if (memq :nogrid buffer-invisibility-spec)
- 'remove-from-invisibility-spec
- 'add-to-invisibility-spec)
+(define-minor-mode gnugo-grid-mode
+ "If enabled, display grid around the board."
+ :variable
+ ((not (memq :nogrid buffer-invisibility-spec))
+ .
+ (lambda (bool)
+ (funcall (if bool
+ 'remove-from-invisibility-spec
+ 'add-to-invisibility-spec)
:nogrid)
- (save-excursion (gnugo-refresh)))
+ (save-excursion (gnugo-refresh)))))
(defun gnugo-propertize-board-buffer ()
(erase-buffer)
@@ -2738,7 +2741,7 @@ See `gnugo-board-mode' for a full list of commands."
("W" . gnugo-worm-data)
("d" . gnugo-dragon-stones)
("D" . gnugo-dragon-data)
- ("g" . gnugo-toggle-grid)
+ ("g" . gnugo-grid-mode)
("!" . gnugo-estimate-score)
(":" . gnugo-command)
(";" . gnugo-command)