[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/gnugo b6bb24d 057/357: [gnugo int] Use ‘eq’ less.
From: |
Stefan Monnier |
Subject: |
[elpa] externals/gnugo b6bb24d 057/357: [gnugo int] Use ‘eq’ less. |
Date: |
Sun, 29 Nov 2020 14:50:47 -0500 (EST) |
branch: externals/gnugo
commit b6bb24db8c8bbd0e56df1d50aa1e75109ffc428a
Author: Thien-Thi Nguyen <ttn@gnu.org>
Commit: Thien-Thi Nguyen <ttn@gnu.org>
[gnugo int] Use ‘eq’ less.
* gnugo.el (gnugo-sentinel): Use ‘memq’.
(gnugo-move-history finish): New func.
(gnugo-move-history): Use ‘if’, ‘case’, ‘finish’.
(:gnugo-gtp-command-spec help): Use ‘if’, ‘case’.
---
gnugo.el | 31 ++++++++++++++++---------------
1 file changed, 16 insertions(+), 15 deletions(-)
diff --git a/gnugo.el b/gnugo.el
index bafdd81..856db6c 100644
--- a/gnugo.el
+++ b/gnugo.el
@@ -311,8 +311,7 @@ Handle the big, slow-to-render, and/or uninteresting ones
specially."
(defun gnugo-sentinel (proc string)
(let ((status (process-status proc)))
- (when (or (eq status 'exit)
- (eq status 'signal))
+ (when (memq status '(exit signal))
(let ((buf (process-buffer proc)))
(when (buffer-live-p buf)
(with-current-buffer buf
@@ -649,13 +648,16 @@ For all other values of RSEL, do nothing and return nil."
acc)))
(tell () (message "(%d moves) %s"
(length acc)
- (mapconcat 'identity (nreverse acc) " "))))
- (cond
- ((not rsel) (while (next nil)) (tell))
- ((equal '(4) rsel) (while (next t)) (tell))
- ((eq 'car rsel) (car (next nil)))
- ((eq 'cadr rsel) (next nil) (car (next nil)))
- ((eq 'count rsel) (aref (gnugo-get :monkey) 2))))))
+ (mapconcat 'identity (nreverse acc) " ")))
+ (finish (byp) (while (next byp)) (tell)))
+ (if (equal '(4) rsel)
+ (finish t)
+ (case rsel
+ ((nil) (finish nil))
+ (car (car (next nil)))
+ (cadr (next nil) (car (next nil)))
+ (count (aref (gnugo-get :monkey) 2))
+ (t nil))))))
(defun gnugo-boss-is-near ()
"Do `bury-buffer' until the current one is not a GNU Board."
@@ -1904,12 +1906,11 @@ starting a new one. See `gnugo-board-mode'
documentation for more info."
:full)
(note "handles this command completely"))
(when (setq output (plist-get spec :output))
- (cond ((functionp output)
- (note "handles the output specially"))
- ((eq :discard output)
- (note "discards the output"))
- ((eq :message output)
- (note "displays the output in the echo area"))))
+ (if (functionp output)
+ (note "handles the output specially")
+ (case output
+ (:discard (note "discards the output"))
+ (:message (note "displays the output in the echo
area")))))
(when (eq sel cur)
(setq found (match-beginning 0))))))
(cond (found (goto-char found))
- [elpa] externals/gnugo 9589d64 167/357: [gnugo int] Add abstraction: gnugo--as-cc-func, (continued)
- [elpa] externals/gnugo 9589d64 167/357: [gnugo int] Add abstraction: gnugo--as-cc-func, Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo d71bab7 174/357: [gnugo int] Add abstractions: gnugo--{user-}play-stone, Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo e3a50ca 014/357: [gnugo int] Use ‘display’ property more., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo c02cc72 030/357: [gnugo maint] Update NEWS file; nfc., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 1dcff48 019/357: [gnugo maint] Revamp "ChangeLog discipline" in HACKING; nfc., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo f0aa02d 033/357: [gnugo int] Zonk unused local var., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 74ff909 038/357: [gnugo] Fix bug: Relax sync regexp., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo f09af15 058/357: [gnugo maint] Reindent; nfc., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 052ea8a 045/357: [gnugo] New command: ‘A’ (gnugo-switch-to-another), Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 6e26e76 061/357: [gnugo int] Add abstraction: gnugo--begin-exchange, Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo b6bb24d 057/357: [gnugo int] Use ‘eq’ less.,
Stefan Monnier <=
- [elpa] externals/gnugo ae25c81 050/357: [gnugo maint] Update NEWS, HACKING; nfc., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo f282ec7 063/357: [gnugo int] Associate process w/ buffer immediately., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 8e3f44e 070/357: [gnugo] Make ‘C-u M-u’ switch roles., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo d02a500 095/357: [gnugo maint] NEWS futzing; nfc., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 273da4b 098/357: [gnugo sgf] Normalize PASS internal rep on read, as ""., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 61be18a 022/357: [gnugo maint] Add .dir-locals.el file, link in HACKING; nfc., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 0c7bc82 025/357: [gnugo int] Use cl-{plus, minus}p more., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 6d835b3 023/357: [gnugo int] Drop unused local var., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 2a75447 034/357: [gnugo int] Use ‘set-process-query-on-exit-flag’., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo bd4d40f 028/357: [gnugo int] Drop leading "*" in docstrings., Stefan Monnier, 2020/11/29