[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/gnugo c2f7717 053/357: [gnugo slog] Fix bug: Avoid ‘cl
From: |
Stefan Monnier |
Subject: |
[elpa] externals/gnugo c2f7717 053/357: [gnugo slog] Fix bug: Avoid ‘cl-lib’ funcs; use only macros. |
Date: |
Sun, 29 Nov 2020 14:50:46 -0500 (EST) |
branch: externals/gnugo
commit c2f7717adfc25c9ed46290fb9c2f79b42c9ff943
Author: Thien-Thi Nguyen <ttn@gnu.org>
Commit: Thien-Thi Nguyen <ttn@gnu.org>
[gnugo slog] Fix bug: Avoid ‘cl-lib’ funcs; use only macros.
This silences byte-compiler warnings under Emacs 24.4.
Regression introduced 2014-01-30, "Use ‘cl-labels’ instead of ‘flet’".
Reported by Juanma Barranquero:
<http://lists.gnu.org/archive/html/gnu-emacs-sources/2014-02/msg00016.html>.
* gnugo.el: Don't require ‘cl-lib’;
instead, require ‘cl’, and wrap with ‘eval-when-compile’.
(gnugo-animate-group): Use ‘loop’, ‘zerop’, ‘logand’.
(gnugo-describe-position): Use ‘loop’.
---
gnugo.el | 33 ++++++++++++++++-----------------
1 file changed, 16 insertions(+), 17 deletions(-)
diff --git a/gnugo.el b/gnugo.el
index ae4a6a0..65444cd 100644
--- a/gnugo.el
+++ b/gnugo.el
@@ -74,7 +74,7 @@
;;; Code:
-(require 'cl-lib) ; use the source luke!
+(eval-when-compile (require 'cl)) ; use the source luke!
(require 'time-date) ; for `time-subtract'
;;;---------------------------------------------------------------------------
@@ -1110,17 +1110,15 @@ To start a game try M-x gnugo."
stones (gnugo-lsquery "%s_stones %s" w/d pos))
(message "%s %s in group." blurb (length stones))
(setplist (gnugo-f 'anim) nil)
- (let* ((spec (let ((spec (split-string gnugo-animation-string "" t)))
- (cond ((gnugo-get :display-using-images)
- (let* ((yin (get-text-property (point) 'gnugo-yin))
- (yang (gnugo-yang (char-after)))
- (up (get (gnugo-yy yin yang t) 'display))
- (dn (get (gnugo-yy yin yang) 'display)))
- (mapcar (lambda (n)
- (if (cl-oddp n)
- dn up))
- (number-sequence 1 (length spec)))))
- (t spec))))
+ (let* ((spec (if (gnugo-get :display-using-images)
+ (loop with yin = (get-text-property (point) 'gnugo-yin)
+ with yang = (gnugo-yang (char-after))
+ with up = (get (gnugo-yy yin yang t) 'display)
+ with dn = (get (gnugo-yy yin yang) 'display)
+ for n below (length gnugo-animation-string)
+ collect (if (zerop (logand 1 n))
+ dn up))
+ (split-string gnugo-animation-string "" t)))
(cell (list spec))
(ovs (save-excursion
(mapcar (lambda (pos)
@@ -1578,11 +1576,12 @@ which placed the stone at point."
(defun gnugo-switch-to-another ()
"Switch to another GNU Go game buffer (if any)."
(interactive)
- (let ((cur (current-buffer)))
- (switch-to-buffer (cl-find-if 'gnugo-board-buffer-p
- (reverse (buffer-list))))
- (when (eq cur (current-buffer))
- (message "(only one)"))))
+ (loop for buf in (cdr (buffer-list))
+ if (gnugo-board-buffer-p buf)
+ return (progn
+ (bury-buffer)
+ (switch-to-buffer buf))
+ finally do (message "(only one)")))
;;;---------------------------------------------------------------------------
;;; Command properties and gnugo-command
- [elpa] externals/gnugo b484515 064/357: [gnugo int] Use ‘loop’, functional style more., (continued)
- [elpa] externals/gnugo b484515 064/357: [gnugo int] Use ‘loop’, functional style more., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo a7dffa0 067/357: [gnugo maint] Update NEWS; nfc., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo d2b4549 068/357: [gnugo] Bind ‘M-u’ to ‘gnugo-undo-one-move’., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo f82c526 078/357: [gnugo int] Use ‘following-char’ instead of ‘char-after’., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo f29b22f 081/357: [gnugo int] Use ‘setq’ less., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 38137d3 079/357: [gnugo int] Cache gametree prop ‘:SZ’ as gnugo prop ‘:SZ’., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo d6f3956 089/357: [gnugo int] Decruft: Infer MOVEP from PROPERTY., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 5ca5b0a 097/357: [gnugo int] Add abstraction: gnugo--nodep, Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo a86a897 013/357: [gnugo int] Use ‘redisplay’ more., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 3063f95 041/357: [gnugo] Make proc-status change mode-line elem more informative., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo c2f7717 053/357: [gnugo slog] Fix bug: Avoid ‘cl-lib’ funcs; use only macros.,
Stefan Monnier <=
- [elpa] externals/gnugo 02926a1 049/357: [gnugo] Rename var to ‘gnugo-inhibit-refresh’., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 5e4b5a8 051/357: [gnugo] Release: 2.3.0, Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 400e27d 069/357: [gnugo int] Add abstraction: gnugo--who-is-who, Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 3547cbe 080/357: [gnugo int] Add abstraction: gnugo--set-root-prop, Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 11e545d 082/357: [gnugo int] Use ‘loop’ instead of ‘dolist’ + ‘destructuring-bind’., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 5eeb99b 087/357: [gnugo int] Use ‘incf’ more., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 7293802 088/357: [gnugo int] Use ‘setq’ less., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 35b1551 091/357: [gnugo int] Use ‘loop’ instead of ‘mapc’ + ‘apply’., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo b5990a0 085/357: [gnugo int] Use ‘gnugo-treeroot’ more., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo f9668f0 090/357: [gnugo int] Add abstraction: gnugo--blackp, Stefan Monnier, 2020/11/29