[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/gnugo 3a7f75e 132/357: [gnugo] Define "GNUGO Frolic" mo
From: |
Stefan Monnier |
Subject: |
[elpa] externals/gnugo 3a7f75e 132/357: [gnugo] Define "GNUGO Frolic" mode. |
Date: |
Sun, 29 Nov 2020 14:51:05 -0500 (EST) |
branch: externals/gnugo
commit 3a7f75e5fac5f3f2979495d5a5f5ae76b1127206
Author: Thien-Thi Nguyen <ttn@gnu.org>
Commit: Thien-Thi Nguyen <ttn@gnu.org>
[gnugo] Define "GNUGO Frolic" mode.
* packages/gnugo/gnugo.el (gnugo-frolic-mode):
New command, via ‘define-derived-mode’.
(gnugo-frolic-in-the-leaves): Use it.
---
NEWS | 1 +
gnugo.el | 20 ++++++++++++++------
2 files changed, 15 insertions(+), 6 deletions(-)
diff --git a/NEWS b/NEWS
index e079fb3..e813c77 100644
--- a/NEWS
+++ b/NEWS
@@ -17,6 +17,7 @@ NB: "RCS: X..Y " means that the particular release includes
- ‘gnugo-undo-one-move’ can optionally arrange for you to play next
- new command: ‘o’ (gnugo-oops)
- new command: ‘L’ (gnugo-frolic-in-the-leaves)
+ - new major mode: GNUGO Frolic (gnugo-frolic-mode)
- ‘gnugo-move-history’ returns last two moves w/ RSEL ‘two’
- performance improvements
- of interest to hackers (see source, BI => backward incompatible)
diff --git a/gnugo.el b/gnugo.el
index 9734595..0c7e682 100644
--- a/gnugo.el
+++ b/gnugo.el
@@ -711,6 +711,15 @@ For all other values of RSEL, do nothing and return nil."
(`two (nn) (nn) acc)
(_ nil)))))
+(define-derived-mode gnugo-frolic-mode special-mode "GNUGO Frolic"
+ "A special mode for viewing a GNUGO gametree.
+Initially View minor mode is active.
+
+\\{gnugo-frolic-mode-map}"
+ (buffer-disable-undo)
+ ;; Is this idio{ma}tic?
+ (view-mode 1))
+
(defun gnugo-frolic-in-the-leaves ()
"Display the game tree in a *GNUGO Frolic* buffer.
This looks something like:
@@ -739,7 +748,7 @@ with 0, 1, ... N (in this case N is 3) in the header line
to indicate the branches. Branch 0 is the \"main line\".
Point (* in this example) indicates the current position,
and moves not actually on the game tree (e.g., E7, branch 3)
-are dimmed. The buffer is in View minor mode."
+are dimmed. Type \\[describe-mode] in that buffer for details."
(interactive)
(let* ((buf (get-buffer-create (concat (gnugo-get :diamond)
"*GNUGO Frolic*")))
@@ -761,6 +770,7 @@ are dimmed. The buffer is in View minor mode."
(gethash (car end) mnum))
ends))
(max-move-num (apply 'max (append valid nil)))
+ (inhibit-read-only t)
finish)
(cl-flet
((on (node)
@@ -790,9 +800,7 @@ are dimmed. The buffer is in View minor mode."
until fork))
;; breathe out
(switch-to-buffer buf)
- (when view-mode
- (view-mode -1))
- (buffer-disable-undo)
+ (gnugo-frolic-mode)
(erase-buffer)
(setq header-line-format
(concat (make-string 11 ?\s)
@@ -895,8 +903,8 @@ are dimmed. The buffer is in View minor mode."
(point))))))))
(when finish
(goto-char finish)
- (recenter (- (count-lines (line-beginning-position) (point-max)))))
- (view-mode 1)))
+ (recenter (- (count-lines (line-beginning-position)
+ (point-max)))))))
(defun gnugo-boss-is-near ()
"Do `bury-buffer' until the current one is not a GNU Board."
- [elpa] externals/gnugo d41a581 029/357: [gnugo] Indicate buffer not modified after load., (continued)
- [elpa] externals/gnugo d41a581 029/357: [gnugo] Indicate buffer not modified after load., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 80a22a5 032/357: [gnugo] Use ‘user-error’., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 423683d 055/357: [gnugo int] Use ‘dolist’, ‘destructuring-bind’ more., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 7c3a30f 100/357: [gnugo int] Use ‘pop’ more., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo a35692a 106/357: [gnugo int] Add abstraction: gnugo--move-prop, Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 6ee477d 112/357: [gnugo int] Remove abstraction: continue-on, Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 58d4d6d 117/357: [gnugo int] Add abstractions: gnugo--{, set-}tree-ends, Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo f107328 122/357: [gnugo int] Expand gametree IR: MNUM, KIDS, ROOT., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo c3b3c3f 123/357: [gnugo int] Fix bug: Detect case for KIDS addition correctly., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo a63d31b 128/357: [gnugo int] Comment munging; nfc., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 3a7f75e 132/357: [gnugo] Define "GNUGO Frolic" mode.,
Stefan Monnier <=
- [elpa] externals/gnugo cb78651 138/357: [gnugo frolic] Add command to prune a branch., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 7025924 156/357: [gnugo sgf] Fix bug: Add ‘\’-escapes on write., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo e64f1ae 170/357: [gnugo frolic] Add previous/next move navigation commands., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo c78119f 191/357: [gnugo int] Add abstraction: gnugo--finish-move, Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo a3d90aa 189/357: [gnugo maint] Update HACKING; nfc., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 5dcf9f6 185/357: [gnugo int] Add abstraction: gnugo--node-with-played-stone, Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 1367651 173/357: [gnugo int] Make ‘gnugo-gate’ slightly faster., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo a4c246e 188/357: [gnugo frolic] Display "!" for comment; add as ‘help-echo’., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 8203f46 194/357: [gnugo int] Centralize some constant strings., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo b1f2856 183/357: [gnugo] Fix bug: Keep subproc informed of forced PASS., Stefan Monnier, 2020/11/29