emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] master 497680d: * mines: Fix compilation warnings


From: Stefan Monnier
Subject: [elpa] master 497680d: * mines: Fix compilation warnings
Date: Fri, 10 Nov 2017 11:59:00 -0500 (EST)

branch: master
commit 497680d78f5879c93f8a7942c855053b357f19b3
Author: Stefan Monnier <address@hidden>
Commit: Stefan Monnier <address@hidden>

    * mines: Fix compilation warnings
---
 packages/mines/mines-tests.el | 21 +++++++++++----------
 packages/mines/mines.el       | 10 ++++++----
 2 files changed, 17 insertions(+), 14 deletions(-)

diff --git a/packages/mines/mines-tests.el b/packages/mines/mines-tests.el
index e19c557..9bdf9ca 100644
--- a/packages/mines/mines-tests.el
+++ b/packages/mines/mines-tests.el
@@ -50,7 +50,7 @@
       (should-not (mines-first-move-p))
       ;; 2nd trial might end the game.
       (cl-letf (((symbol-function 'yes-or-no-p)
-                 (lambda (&rest arg) (error "Fail"))))
+                 (lambda (&rest _) (error "Fail"))))
         (should-error (mines-dig))))
     (when (buffer-live-p buf) (kill-buffer buf))))
 
@@ -94,19 +94,20 @@
       (when (buffer-live-p buf) (kill-buffer buf)))))
 
 (ert-deftest mines-test-indices ()
-  (= 0 (mines-matrix-2-index 0 0))
-  (= 1 (mines-matrix-2-index 0 1))
-  (= (1- mines-number-cols)
-     (mines-matrix-2-index 0 (1- mines-number-cols)))
-  (= (* mines-number-cols (1- mines-number-rows))
-     (mines-matrix-2-index (1- mines-number-rows) 0))
-  (= (1- mines-number-cells)
-     (mines-matrix-2-index (1- mines-number-rows) (1- mines-number-cols)))
+  (should (= 0 (mines-matrix-2-index 0 0)))
+  (should (= 1 (mines-matrix-2-index 0 1)))
+  (should (= (1- mines-number-cols)
+             (mines-matrix-2-index 0 (1- mines-number-cols))))
+  (should (= (* mines-number-cols (1- mines-number-rows))
+             (mines-matrix-2-index (1- mines-number-rows) 0)))
+  (should (= (1- mines-number-cells)
+             (mines-matrix-2-index (1- mines-number-rows)
+                                   (1- mines-number-cols))))
   ;; `mines-matrix-2-index' consistent with `mines-index-2-matrix'.
   (dolist (idx (list 0 1 (1- mines-number-cols)
                      (* mines-number-cols (1- mines-number-rows))
                      (1- mines-number-cells)))
-    (= idx (apply #'mines-matrix-2-index (mines-index-2-matrix idx)))))
+    (should (= idx (apply #'mines-matrix-2-index (mines-index-2-matrix 
idx))))))
 
 (ert-deftest mines-test-neighbours ()
   (cl-flet ((set-equalp (x y)
diff --git a/packages/mines/mines.el b/packages/mines/mines.el
index 02bfc9b..9304622 100644
--- a/packages/mines/mines.el
+++ b/packages/mines/mines.el
@@ -454,8 +454,8 @@ If called again then unflag it."
   (interactive)
   (when (mines-mines-mode-p)
     (if mines-game-over
-        (user-error "Current game is over.  Try `%s' to start a new one."
-                    (substitute-command-keys "\\[mines\]"))
+        (user-error "Current game is over.  Try `%s' to start a new one"
+                    (substitute-command-keys "\\[mines]"))
       (skip-chars-forward "[:blank:]") ; Set point in the center of the cell.
       (cl-labels ((uncover-fn
                    ()
@@ -484,7 +484,7 @@ If called again then unflag it."
                                     (aset mines-grid pos t))
                                   ;; Update the numbers on neighbour cells.
                                   (mines-set-numbers)
-                                  ;; Update current element. 
+                                  ;; Update current element.
                                   (setq elt (aref mines-grid idx))))
                               ;; If the cell is flagged ask for confirmation.
                               (if (and (not show-mines) (eq (following-char) 
mines-flagged-cell-char))
@@ -511,6 +511,8 @@ If called again then unflag it."
 
 ;;;###autoload
 (defun mines (&optional arg)
+  ;; FIXME: I think most of this doc should be moved to `mines-mode' so it
+  ;; is shown to the user when he uses the standard `describe-mode' command.
   "Play the minesweeper game.
 Called with a prefix prompt for the difficulty level.
 
@@ -534,7 +536,7 @@ For instance, following is a possible configuration:
 @ @ @ @ @
 
 You can move between cells using the arrow keys, or using vi
-or emacs keystrokes (↑↓→←) = (kjlh) = (pnfb).
+or Emacs keystrokes (↑↓→←) = (kjlh) = (pnfb).
 
 You can flag a cell as having a mine with \\[mines-flag-cell\]; if you
 call this command again, the cell is unflagged."



reply via email to

[Prev in Thread] Current Thread [Next in Thread]