[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/gnugo d62412f 144/357: [gnugo int] Add abstraction: gnu
From: |
Stefan Monnier |
Subject: |
[elpa] externals/gnugo d62412f 144/357: [gnugo int] Add abstraction: gnugo--move-to-bcol |
Date: |
Sun, 29 Nov 2020 14:51:08 -0500 (EST) |
branch: externals/gnugo
commit d62412fbbcacf730db0d3b4ba1c19da0dee3357f
Author: Thien-Thi Nguyen <ttn@gnu.org>
Commit: Thien-Thi Nguyen <ttn@gnu.org>
[gnugo int] Add abstraction: gnugo--move-to-bcol
* packages/gnugo/gnugo.el (gnugo--move-to-bcol): New defsubst.
(gnugo--swiz, gnugo-frolic-prune-branch)
(gnugo-frolic-backward-branch)
(gnugo-frolic-forward-branch): Use it.
---
gnugo.el | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/gnugo.el b/gnugo.el
index 951881a..363409b 100644
--- a/gnugo.el
+++ b/gnugo.el
@@ -954,6 +954,9 @@ are dimmed. Type \\[describe-mode] in that buffer for
details."
(gnugo--awake)
,@body))
+(defsubst (gnugo--move-to-bcol bidx)
+ (move-to-column (+ 10 (* 6 bidx))))
+
(defun gnugo--swiz (direction &optional blunt)
(gnugo--awakened
(unless a
@@ -980,7 +983,7 @@ are dimmed. Type \\[describe-mode] in that buffer for
details."
(gnugo-frolic-in-the-leaves)
(goto-char (point-min))
(forward-line line)
- (forward-char (+ 10 (* 6 b))))))
+ (gnugo--move-to-bcol b))))
(defun gnugo-frolic-exchange-left ()
"Exchange the current branch with the one to its left."
@@ -1036,19 +1039,19 @@ This fails if the monkey is on the current branch
(when line
(goto-char (point-min))
(search-forward line)
- (move-to-column (+ 10 (* 6 (min a (- width 2))))))))
+ (gnugo--move-to-bcol (min a (- width 2))))))
(defun gnugo-frolic-backward-branch (&optional n)
"Move backward N (default 1) branches."
(interactive "p")
(gnugo--awakened
- (move-to-column (+ 10 (* 6 (mod (- (or a width) n) width))))))
+ (gnugo--move-to-bcol (mod (- (or a width) n) width))))
(defun gnugo-frolic-forward-branch (&optional n)
"Move forward N (default 1) branches."
(interactive "p")
(gnugo--awakened
- (move-to-column (+ 10 (* 6 (mod (+ (or a -1) n) width))))))
+ (gnugo--move-to-bcol (mod (+ (or a -1) n) width))))
(defun gnugo-boss-is-near ()
"Do `bury-buffer' until the current one is not a GNU Board."
- [elpa] externals/gnugo ae888ba 105/357: [gnugo] Add command ‘gnugo-oops’ and keybinding., (continued)
- [elpa] externals/gnugo ae888ba 105/357: [gnugo] Add command ‘gnugo-oops’ and keybinding., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 2c5e356 107/357: [gnugo maint] Add some debugging aids to HACKING; nfc., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo a708759 110/357: [gnugo int] Use ‘cl-labels’ less., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo a35f657 115/357: [gnugo] Support SGF[4] parsing from string data., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 3d8db48 119/357: [gnugo] Declare dependency on ‘ascii-art-to-unicode’., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 4b866c7 127/357: [gnugo int] Avoid lower move-num candidates in déjà-vu search., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 5b51e4f 129/357: [gnugo int] Decruft: Consolidate "breathe in" loops., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo fda0ca5 130/357: [gnugo int] Move precise fanout computation to "breathe in"., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo cbf99df 131/357: [gnugo int] Insert frolic xrep starting w/ the leaves., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 5c87b11 141/357: [gnugo frolic int] Use ‘move-to-column’ more., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo d62412f 144/357: [gnugo int] Add abstraction: gnugo--move-to-bcol,
Stefan Monnier <=
- [elpa] externals/gnugo 4680536 143/357: [gnugo int] Fix bug: Unbreak SGF file output., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 806a2f2 133/357: [gnugo] Add some navigation commands for GNUGO Frolic mode., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo c6795aa 140/357: [gnugo frolic int] Assign ‘pop’ rv to avoid byte-compiler warning., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 13c8f82 149/357: [gnugo frolic] Doc fix., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo de40b22 152/357: [gnugo int] Move vectorization into ‘gnugo--set-tree-ends’., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo e8833a9 161/357: [gnugo int] Fix syntax error in ‘loop’ destructuring., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 3e3fbea 155/357: [gnugo sgf] Fix bug: Preserve whitespace for ‘text’ values., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 0f3f4b6 165/357: [gnugo int] Use ‘ignore’ to avoid byte-compiler warnings., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 082d56c 178/357: [gnugo int] Use ‘gnugo--decorate’ more., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo e382633 190/357: [gnugo] Drop var: gnugo-inhibit-refresh, Stefan Monnier, 2020/11/29