emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/trunk r103967: lisp/play/*.el: Lexical-bind


From: Juanma Barranquero
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r103967: lisp/play/*.el: Lexical-binding cleanup.
Date: Thu, 21 Apr 2011 14:24:46 +0200
User-agent: Bazaar (2.3.1)

------------------------------------------------------------
revno: 103967
committer: Juanma Barranquero <address@hidden>
branch nick: trunk
timestamp: Thu 2011-04-21 14:24:46 +0200
message:
  lisp/play/*.el: Lexical-binding cleanup.
modified:
  lisp/ChangeLog
  lisp/play/5x5.el
  lisp/play/bubbles.el
  lisp/play/decipher.el
  lisp/play/doctor.el
  lisp/play/fortune.el
  lisp/play/gamegrid.el
  lisp/play/gametree.el
  lisp/play/gomoku.el
  lisp/play/handwrite.el
  lisp/play/hanoi.el
  lisp/play/landmark.el
  lisp/play/mpuz.el
  lisp/play/solitaire.el
  lisp/play/tetris.el
  lisp/play/zone.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2011-04-20 23:34:00 +0000
+++ b/lisp/ChangeLog    2011-04-21 12:24:46 +0000
@@ -1,3 +1,51 @@
+2011-04-21  Juanma Barranquero  <address@hidden>
+
+       Lexical-binding cleanup.
+
+       * play/5x5.el (5x5-make-random-solution, 5x5-make-mutate-current)
+       (5x5-make-mutate-best):
+       * play/fortune.el (fortune-in-buffer):
+       * play/gomoku.el (gomoku-init-display):
+       * play/solitaire.el (solitaire, solitaire-do-check):
+       * play/tetris.el (tetris-default-update-speed-function):
+       Mark unused parameters.
+
+       * play/bubbles.el (bubbles-mode): Set `show-trailing-whitespace'.
+       (bubbles--shift): Remove unused variable `char-org'.
+       (bubbles--set-faces): Remove unused variable `fg-col'.  Simplify.
+       (bubbles--show-images): Remove unused variable `char'.
+
+       * play/decipher.el (decipher-keypress, decipher-alphabet-keypress)
+       (decipher-get-undo, decipher-set-map, decipher-complete-alphabet)
+       (decipher-resync, decipher-loop-with-breaks, decipher--analyze)
+       (decipher-analyze-buffer): Use ?\s.
+       (decipher-make-checkpoint): Remove unused variable `mapping'.
+
+       * play/doctor.el (doctor-doc): Rename parameter DOCTOR-SENT to SENT.
+
+       * play/gamegrid.el (gamegrid-add-score-with-update-game-score):
+       Remove unused variable `result'; use `let'.
+
+       * play/gametree.el (gametree-current-layout, gametree-apply-layout):
+       Rename parameter TOP-LEVEL to FROM-TOP-LEVEL; use `ignore-errors'.
+       (gametree-children-shown-p, gametree-compute-reduced-score):
+       Use `ignore-errors'.
+
+       * play/handwrite.el (ps-lpr-switches): Declare.
+       (handwrite): Remove unused variables `pmin' and `lastp'.
+
+       * play/hanoi.el (hanoi-move-ring): Remove unused variable `total-steps'.
+
+       * play/landmark.el (landmark-init-display)
+       (landmark-update-naught-weights): Mark unused parameters.
+       (landmark-y): Remove unused variable `noise'.  Simplify.
+       (landmark-human-plays): Remove unused variable `score'.
+
+       * play/mpuz.el (mpuz-try-letter): Remove unused variable `message'.
+       (mpuz-try-proposal): Remove unused variable `game'.
+
+       * play/zone.el (life-patterns): Declare.
+
 2011-04-20  Juanma Barranquero  <address@hidden>
 
        * vc/vc.el (ediff-vc-internal): Declare function.

=== modified file 'lisp/play/5x5.el'
--- a/lisp/play/5x5.el  2011-01-25 04:08:28 +0000
+++ b/lisp/play/5x5.el  2011-04-21 12:24:46 +0000
@@ -368,15 +368,15 @@
                                       (5x5-copy-grid best-solution)))))
   (setq 5x5-cracking nil))
 
-(defun 5x5-make-random-solution (&rest ignore)
+(defun 5x5-make-random-solution (&rest _ignore)
   "Make a random solution."
   (5x5-make-random-grid))
 
-(defun 5x5-make-mutate-current (current best)
+(defun 5x5-make-mutate-current (current _best)
   "Mutate the current solution."
   (5x5-mutate-solution current))
 
-(defun 5x5-make-mutate-best (current best)
+(defun 5x5-make-mutate-best (_current best)
   "Mutate the best solution."
   (5x5-mutate-solution best))
 

=== modified file 'lisp/play/bubbles.el'
--- a/lisp/play/bubbles.el      2011-03-15 17:39:56 +0000
+++ b/lisp/play/bubbles.el      2011-04-21 12:24:46 +0000
@@ -1,4 +1,4 @@
-;;; bubbles.el --- Puzzle game for Emacs.
+;;; bubbles.el --- Puzzle game for Emacs
 
 ;; Copyright (C) 2007-2011  Free Software Foundation, Inc.
 
@@ -921,7 +921,8 @@
 (define-derived-mode bubbles-mode nil "Bubbles"
   "Major mode for playing bubbles.
 \\{bubbles-mode-map}"
-  (setq buffer-read-only t)
+  (setq buffer-read-only t
+        show-trailing-whitespace nil)
   (buffer-disable-undo)
   (force-mode-line-update)
   (redisplay)
@@ -1317,8 +1318,7 @@
 Return t if new char is non-empty."
   (save-excursion
     (when (bubbles--goto row col)
-      (let ((char-org (char-after (point)))
-            (char-new (bubbles--empty-char))
+      (let ((char-new (bubbles--empty-char))
             (removed nil)
             (trow row)
             (tcol col)
@@ -1416,9 +1416,8 @@
           (dotimes (i (bubbles--grid-height))
             (dotimes (j (bubbles--grid-width))
               (bubbles--goto i j)
-              (let* ((index (get-text-property (point) 'index))
-                     (face (nth index bubbles--faces))
-                     (fg-col (face-foreground face)))
+              (let ((face (nth (get-text-property (point) 'index)
+                               bubbles--faces)))
                 (when (get-text-property (point) 'active)
                   (set-face-foreground 'bubbles--highlight-face "#ff0000")
                   (setq face 'bubbles--highlight-face))
@@ -1434,8 +1433,7 @@
       (save-excursion
         (goto-char (point-min))
         (forward-line 1)
-        (let ((inhibit-read-only t)
-              char)
+        (let ((inhibit-read-only t))
           (dotimes (i (bubbles--grid-height))
             (dotimes (j (bubbles--grid-width))
               (forward-char 1)

=== modified file 'lisp/play/decipher.el'
--- a/lisp/play/decipher.el     2011-01-25 04:08:28 +0000
+++ b/lisp/play/decipher.el     2011-04-21 12:24:46 +0000
@@ -353,7 +353,7 @@
       (let ((char-a (following-char))
             (char-b (decipher-last-command-char)))
         (or (and (not (= ?w (char-syntax char-a)))
-                 (= char-b ?\ )) ;Spacebar just advances on non-letters
+                 (= char-b ?\s)) ;Spacebar just advances on non-letters
             (funcall decipher-function char-a char-b)))))
   (forward-char))
 
@@ -366,10 +366,10 @@
          (decipher-set-map a b))
         ((and (>= a ?a) (<= a ?z))
          ;; If A is lowercase, then it is in the plaintext alphabet:
-         (if (= b ?\ )
+         (if (= b ?\s)
              ;; We are clearing the association (if any):
-             (if (/= ?\  (setq b (cdr (assoc a decipher-alphabet))))
-                 (decipher-set-map b ?\ ))
+             (if (/= ?\s (setq b (cdr (assoc a decipher-alphabet))))
+                 (decipher-set-map b ?\s))
            ;; Associate the plaintext char with the char pressed:
            (decipher-set-map b a)))
         (t
@@ -432,12 +432,12 @@
   ;; modified using setcdr.
   (let ((cipher-map (decipher-copy-cons (rassoc cipher-char 
decipher-alphabet)))
         (plain-map  (decipher-copy-cons (assoc  plain-char  
decipher-alphabet))))
-    (cond ((equal ?\  plain-char)
+    (cond ((equal ?\s plain-char)
            cipher-map)
           ((equal cipher-char (cdr plain-map))
            nil)                         ;We aren't changing anything
-          ((equal ?\  (cdr plain-map))
-           (or cipher-map (cons ?\  cipher-char)))
+          ((equal ?\s (cdr plain-map))
+           (or cipher-map (cons ?\s cipher-char)))
           (cipher-map
            (list plain-map cipher-map))
           (t
@@ -466,15 +466,15 @@
       (goto-char (point-min))
       (if (setq mapping (rassoc cipher-char decipher-alphabet))
           (progn
-            (setcdr mapping ?\ )
+            (setcdr mapping ?\s)
             (search-forward-regexp (concat "^([a-z]*"
                                            (char-to-string (car mapping))))
-            (decipher-insert ?\ )
+            (decipher-insert ?\s)
             (beginning-of-line)))
       (if (setq mapping (assoc plain-char decipher-alphabet))
           (progn
-            (if (/= ?\  (cdr mapping))
-                (decipher-set-map (cdr mapping) ?\  t))
+            (if (/= ?\s (cdr mapping))
+                (decipher-set-map (cdr mapping) ?\s t))
             (setcdr mapping cipher-char)
             (search-forward-regexp (concat "^([a-z]*" plain-string))
             (decipher-insert cipher-char)
@@ -527,8 +527,7 @@
   (or (stringp desc)
       (setq desc ""))
   (let (alphabet
-        buffer-read-only                ;Make buffer writable
-        mapping)
+        buffer-read-only)               ;Make buffer writable
     (goto-char (point-min))
     (re-search-forward "^)")
     (move-to-column 27 t)
@@ -585,12 +584,12 @@
         buffer-read-only                ;Make buffer writable
         plain-map undo-rec)
     (while (setq plain-map (pop ptr))
-      (if (equal ?\  (cdr plain-map))
+      (if (equal ?\s (cdr plain-map))
           (progn
             (while (rassoc cipher-char decipher-alphabet)
               ;; Find the next unused letter
               (incf cipher-char))
-            (push (cons ?\  cipher-char) undo-rec)
+            (push (cons ?\s cipher-char) undo-rec)
             (decipher-set-map cipher-char (car plain-map) t))))
     (decipher-add-undo undo-rec)))
 
@@ -624,7 +623,7 @@
         (replace-match ">" nil nil))
       (decipher-read-alphabet)
       (while (setq mapping (pop alphabet))
-        (or (equal ?\  (cdr mapping))
+        (or (equal ?\s (cdr mapping))
             (decipher-set-map (cdr mapping) (car mapping))))))
   (setq decipher-undo-list       nil
         decipher-undo-list-size  0)
@@ -751,8 +750,8 @@
 a space.
 
 See `decipher-loop-no-breaks' if you do not care about word divisions."
-  (let ((decipher-char ?\ )
-        (decipher--loop-prev-char ?\ ))
+  (let ((decipher-char ?\s)
+        (decipher--loop-prev-char ?\s))
     (save-excursion
       (goto-char (point-min))
       (funcall func)              ;Space marks beginning of first word
@@ -760,16 +759,16 @@
         (while (not (eolp))
           (setq decipher-char (upcase (following-char)))
           (or (and (>= decipher-char ?A) (<= decipher-char ?Z))
-              (setq decipher-char ?\ ))
-          (or (and (equal decipher-char ?\ )
-                   (equal decipher--loop-prev-char ?\ ))
+              (setq decipher-char ?\s))
+          (or (and (equal decipher-char ?\s)
+                   (equal decipher--loop-prev-char ?\s))
               (funcall func))
           (setq decipher--loop-prev-char decipher-char)
           (forward-char))
-        (or (equal decipher-char ?\ )
+        (or (equal decipher-char ?\s)
             (progn
               (setq decipher-char ?\s
-                    decipher--loop-prev-char ?\ )
+                    decipher--loop-prev-char ?\s)
               (funcall func)))))))
 
 (defun decipher-loop-no-breaks (func)
@@ -844,13 +843,13 @@
                             decipher--digram-list)))))
   (and (>= decipher--prev-char ?A)
        (incf (aref (aref decipher--before (- decipher--prev-char ?A))
-                   (if (equal decipher-char ?\ )
+                   (if (equal decipher-char ?\s)
                        26
                      (- decipher-char ?A)))))
   (and (>= decipher-char ?A)
        (incf (aref decipher--freqs (- decipher-char ?A)))
        (incf (aref (aref decipher--after (- decipher-char ?A))
-                   (if (equal decipher--prev-char ?\ )
+                   (if (equal decipher--prev-char ?\s)
                        26
                      (- decipher--prev-char ?A)))))
   (setq decipher--prev-char decipher-char))
@@ -883,7 +882,7 @@
 (defun decipher-analyze-buffer ()
   "Perform frequency analysis and store results in statistics buffer.
 Creates the statistics buffer if it doesn't exist."
-  (let ((decipher--prev-char (if decipher-ignore-spaces ?\  ?\*))
+  (let ((decipher--prev-char (if decipher-ignore-spaces ?\s ?\*))
         (decipher--before (make-vector 26 nil))
         (decipher--after  (make-vector 26 nil))
         (decipher--freqs   (make-vector 26 0))
@@ -1057,7 +1056,7 @@
 ;;              (setq undo-rec (list undo-rec)))
 ;;          (insert ?\()
 ;;          (while (setq undo-map (pop undo-rec))
-;;            (insert (cdr undo-map) (car undo-map) ?\ ))
+;;            (insert (cdr undo-map) (car undo-map) ?\s))
 ;;          (delete-char -1)
 ;;          (insert ")\n"))))))
 

=== modified file 'lisp/play/doctor.el'
--- a/lisp/play/doctor.el       2011-02-16 16:55:21 +0000
+++ b/lisp/play/doctor.el       2011-04-21 12:24:46 +0000
@@ -268,7 +268,7 @@
         (you seem to dwell on (doc// doctor-owner) family \.)
         ((doc$ doctor--areyou) hung up on (doc// doctor-owner) family \?)))
   (set (make-local-variable 'doctor--huhlst)
-       '(((doc$ doctor--whysay)(doc// doctor-sent) \?)
+       '(((doc$ doctor--whysay) (doc// doctor-sent) \?)
         (is it because of (doc$ doctor--things) that you say (doc// 
doctor-sent) \?)))
   (set (make-local-variable 'doctor--longhuhlst)
        '(((doc$ doctor--whysay) that \?)
@@ -371,8 +371,8 @@
         (did you watch a lot of crime and violence on television as a child 
\?)))
   (set (make-local-variable 'doctor--sexlst)
        '(((doc$ doctor--areyou) (doc$ doctor--afraidof) sex \?)
-        ((doc$ doctor--describe)(doc$ doctor--something) about your sexual 
history \.)
-        ((doc$ doctor--please)(doc$ doctor--describe) your sex life \.\.\.)
+        ((doc$ doctor--describe) (doc$ doctor--something) about your sexual 
history \.)
+        ((doc$ doctor--please) (doc$ doctor--describe) your sex life \.\.\.)
         ((doc$ doctor--describe) your (doc$ doctor--feelings-about) your 
sexual partner \.)
         ((doc$ doctor--describe) your most (doc$ doctor--random-adjective) 
sexual experience \.)
         ((doc$ doctor--areyou) satisfied with (doc// doctor--lover) \.\.\. 
\?)))
@@ -384,11 +384,11 @@
                                       ((doc$ doctor--bother) i ask that \?)))
   (set (make-local-variable 'doctor--beclst)
        '((is it because (doc// doctor-sent) that you came to me \?)
-        ((doc$ doctor--bother)(doc// doctor-sent) \?)
+        ((doc$ doctor--bother) (doc// doctor-sent) \?)
         (when did you first know that (doc// doctor-sent) \?)
         (is the fact that (doc// doctor-sent) the real reason \?)
         (does the fact that (doc// doctor-sent) explain anything else \?)
-        ((doc$ doctor--areyou)(doc$ doctor--sure)(doc// doctor-sent) \? )))
+        ((doc$ doctor--areyou) (doc$ doctor--sure) (doc// doctor-sent) \? )))
   (set (make-local-variable 'doctor--shortbeclst)
    '(((doc$ doctor--bother) i ask you that \?)
      (that\'s not much of an answer!)
@@ -398,15 +398,15 @@
      (don\'t be (doc$ doctor--afraidof) elaborating \.)
      ((doc$ doctor--please) go into more detail \.)))
   (set (make-local-variable 'doctor--thlst)
-       '(((doc$ doctor--maybe)(doc$ doctor--thing)(doc$ doctor--isrelated) 
this \.)
-        ((doc$ doctor--maybe)(doc$ doctor--things)(doc$ doctor--arerelated) 
this \.)
+       '(((doc$ doctor--maybe) (doc$ doctor--thing) (doc$ doctor--isrelated) 
this \.)
+        ((doc$ doctor--maybe) (doc$ doctor--things) (doc$ doctor--arerelated) 
this \.)
         (is it because of (doc$ doctor--things) that you are going through all 
this \?)
         (how do you reconcile (doc$ doctor--things) \? )
-        ((doc$ doctor--maybe) this (doc$ doctor--isrelated)(doc$ 
doctor--things) \?)))
+        ((doc$ doctor--maybe) this (doc$ doctor--isrelated) (doc$ 
doctor--things) \?)))
   (set (make-local-variable 'doctor--remlst)
        '((earlier you said (doc$ doctor--history) \?)
         (you mentioned that (doc$ doctor--history) \?)
-        ((doc$ doctor--whysay)(doc$ doctor--history) \? )))
+        ((doc$ doctor--whysay) (doc$ doctor--history) \? )))
   (set (make-local-variable 'doctor--toklst)
        '((is this how you relax \?)
         (how long have you been smoking        grass \?)
@@ -415,7 +415,7 @@
        '((do you get (doc// doctor-found) often \?)
         (do you enjoy being (doc// doctor-found) \?)
         (what makes you (doc// doctor-found) \?)
-        (how often (doc$ doctor--areyou)(doc// doctor-found) \?)
+        (how often (doc$ doctor--areyou) (doc// doctor-found) \?)
         (when were you last (doc// doctor-found) \?)))
   (set (make-local-variable 'doctor--replist) '((i . (you))
                                        (my . (your))
@@ -859,25 +859,25 @@
 
 ;; Main processing function for sentences that have been read.
 
-(defun doctor-doc (doctor-sent)
+(defun doctor-doc (sent)
   (cond
-   ((equal doctor-sent '(foo))
-    (doctor-type '(bar! (doc$ doctor--please)(doc$ doctor--continue) \.)))
-   ((member doctor-sent doctor--howareyoulst)
+   ((equal sent '(foo))
+    (doctor-type '(bar! (doc$ doctor--please) (doc$ doctor--continue) \.)))
+   ((member sent doctor--howareyoulst)
     (doctor-type '(i\'m ok \.  (doc$ doctor--describe) yourself \.)))
-   ((or (member doctor-sent '((good bye) (see you later) (i quit) (so long)
+   ((or (member sent '((good bye) (see you later) (i quit) (so long)
                       (go away) (get lost)))
-       (memq (car doctor-sent)
+       (memq (car sent)
              '(bye halt break quit done exit goodbye
                    bye\, stop pause goodbye\, stop pause)))
     (doctor-type (doc$ doctor--bye)))
-   ((and (eq (car doctor-sent) 'you)
-        (memq (cadr doctor-sent) doctor--abusewords))
-    (setq doctor-found (cadr doctor-sent))
+   ((and (eq (car sent) 'you)
+        (memq (cadr sent) doctor--abusewords))
+    (setq doctor-found (cadr sent))
     (doctor-type (doc$ doctor--abuselst)))
-   ((eq (car doctor-sent) 'whatmeans)
-    (doctor-def (cadr doctor-sent)))
-   ((equal doctor-sent '(parse))
+   ((eq (car sent) 'whatmeans)
+    (doctor-def (cadr sent)))
+   ((equal sent '(parse))
     (doctor-type (list  'subj '= doctor-subj ",  "
                        'verb '= doctor-verb "\n"
                        'object 'phrase '= doctor-obj ","
@@ -889,29 +889,29 @@
                        'sentence 'used 'was
                        "..."
                        '(doc// doctor--bak))))
-   ((memq (car doctor-sent) '(are is do has have how when where who why))
+   ((memq (car sent) '(are is do has have how when where who why))
     (doctor-type (doc$ doctor--qlist)))
-   ;;   ((eq (car doctor-sent) 'forget)
-   ;;    (set (cadr doctor-sent) nil)
-   ;;    (doctor-type '((doc$ doctor--isee)(doc$ doctor--please)
+   ;;   ((eq (car sent) 'forget)
+   ;;    (set (cadr sent) nil)
+   ;;    (doctor-type '((doc$ doctor--isee) (doc$ doctor--please)
    ;;     (doc$ doctor--continue)\.)))
    (t
-    (if (doctor-defq doctor-sent) (doctor-define doctor-sent doctor-found))
-    (if (> (length doctor-sent) 12)(setq doctor-sent (doctor-shorten 
doctor-sent)))
-    (setq doctor-sent (doctor-correct-spelling (doctor-replace doctor-sent 
doctor--replist)))
-    (cond ((and (not (memq 'me doctor-sent))(not (memq 'i doctor-sent))
-               (memq 'am doctor-sent))
-          (setq doctor-sent (doctor-replace doctor-sent '((am . (are)))))))
-    (cond ((equal (car doctor-sent) 'yow) (doctor-zippy))
-         ((< (length doctor-sent) 2)
-          (cond ((eq (doctor-meaning (car doctor-sent)) 'howdy)
+    (if (doctor-defq sent) (doctor-define sent doctor-found))
+    (if (> (length sent) 12) (setq sent (doctor-shorten sent)))
+    (setq sent (doctor-correct-spelling (doctor-replace sent doctor--replist)))
+    (cond ((and (not (memq 'me sent)) (not (memq 'i sent))
+               (memq 'am sent))
+          (setq sent (doctor-replace sent '((am . (are)))))))
+    (cond ((equal (car sent) 'yow) (doctor-zippy))
+         ((< (length sent) 2)
+          (cond ((eq (doctor-meaning (car sent)) 'howdy)
                  (doctor-howdy))
                 (t (doctor-short))))
          (t
-          (if (memq 'am doctor-sent)
-              (setq doctor-sent (doctor-replace doctor-sent '((me . (i))))))
-          (setq doctor-sent (doctor-fixup doctor-sent))
-          (if (and (eq (car doctor-sent) 'do) (eq (cadr doctor-sent) 'not))
+          (if (memq 'am sent)
+              (setq sent (doctor-replace sent '((me . (i))))))
+          (setq sent (doctor-fixup sent))
+          (if (and (eq (car sent) 'do) (eq (cadr sent) 'not))
               (cond ((zerop (random 3))
                      (doctor-type '(are you (doc$ doctor--afraidof) that \?)))
                     ((zerop (random 2))
@@ -920,9 +920,9 @@
                      (doctor-rthing))
                     (t
                      (doctor-type '((doc$ doctor--whysay) that i shouldn\'t
-                                    (cddr doctor-sent)
+                                    (cddr sent)
                                     \?))))
-            (doctor-go (doctor-wherego doctor-sent))))))))
+            (doctor-go (doctor-wherego sent))))))))
 
 ;; Things done to process sentences once read.
 
@@ -1130,8 +1130,8 @@
          (t 'something))))
 
 (defun doctor-getnoun (x)
-  (cond ((null x)(setq doctor-object 'something))
-       ((atom x)(setq doctor-object x))
+  (cond ((null x) (setq doctor-object 'something))
+       ((atom x) (setq doctor-object x))
        ((eq (length x) 1)
         (setq doctor-object (cond
                       ((doctor-nounp (setq doctor-object (car x))) 
doctor-object)
@@ -1304,7 +1304,7 @@
           sent)))
 
 (defun doctor-wherego (sent)
-  (cond ((null sent)(doc$ doctor--whereoutp))
+  (cond ((null sent) (doc$ doctor--whereoutp))
        ((null (doctor-meaning (car sent)))
         (doctor-wherego (cond ((zerop (random 2))
                                (reverse (cdr sent)))
@@ -1327,8 +1327,8 @@
       (setq foo (cdr foo)))
     (setq doctor-verb (car foo))
     (setq doctor-obj (doctor-getnoun (cdr foo)))
-    (cond ((eq doctor-object 'i)(setq doctor-object 'me))
-         ((eq doctor-subj 'me)(setq doctor-subj 'i)))
+    (cond ((eq doctor-object 'i) (setq doctor-object 'me))
+         ((eq doctor-subj 'me) (setq doctor-subj 'i)))
     (cond (mem (doctor-remember (list doctor-subj doctor-verb doctor-obj))))))
 
 (defun doctor-possess (sent key)
@@ -1414,7 +1414,7 @@
 
 (defun doctor-rthing () (doctor-type (doc$ doctor--thlst)))
 
-(defun doctor-remem () (cond ((null doctor--history)(doctor-huh))
+(defun doctor-remem () (cond ((null doctor--history) (doctor-huh))
                             ((doctor-type (doc$ doctor--remlst)))))
 
 (defun doctor-howdy ()
@@ -1426,14 +1426,14 @@
         (doctor-type '((doc$ doctor--please) (doc$ doctor--describe) (doc$ 
doctor--things) \.)))))
 
 (defun doctor-when ()
-  (cond ((< (length (memq doctor-found doctor-sent)) 3)(doctor-short))
+  (cond ((< (length (memq doctor-found doctor-sent)) 3) (doctor-short))
        (t
         (setq doctor-sent (cdr (memq doctor-found doctor-sent)))
         (setq doctor-sent (doctor-fixup doctor-sent))
-        (doctor-type '((doc$ doctor--whatwhen)(doc// doctor-sent) \?)))))
+        (doctor-type '((doc$ doctor--whatwhen) (doc// doctor-sent) \?)))))
 
 (defun doctor-conj ()
-  (cond ((< (length (memq doctor-found doctor-sent)) 4)(doctor-short))
+  (cond ((< (length (memq doctor-found doctor-sent)) 4) (doctor-short))
        (t
         (setq doctor-sent (cdr (memq doctor-found doctor-sent)))
         (setq doctor-sent (doctor-fixup doctor-sent))
@@ -1497,10 +1497,10 @@
   (doctor-type (doc$ doctor--toklst)))
 
 (defun doctor-state ()
-  (doctor-type (doc$ doctor--states))(doctor-remember (list 'you 'were 
doctor-found)))
+  (doctor-type (doc$ doctor--states)) (doctor-remember (list 'you 'were 
doctor-found)))
 
 (defun doctor-mood ()
-  (doctor-type (doc$ doctor--moods))(doctor-remember (list 'you 'felt 
doctor-found)))
+  (doctor-type (doc$ doctor--moods)) (doctor-remember (list 'you 'felt 
doctor-found)))
 
 (defun doctor-fear ()
   (setq doctor--feared (doctor-setprep doctor-sent doctor-found))
@@ -1511,8 +1511,8 @@
   (doctor-svo doctor-sent doctor-found 1 t)
   (cond ((memq 'not doctor-sent) (doctor-forget) (doctor-huh))
        ((equal doctor-subj 'you)
-        (doctor-type '(why do you (doc// doctor-verb)(doc// doctor-obj) \?)))
-       (t (doctor-type '((doc$ doctor--whysay)(list doctor-subj doctor-verb 
doctor-obj))))))
+        (doctor-type '(why do you (doc// doctor-verb) (doc// doctor-obj) \?)))
+       (t (doctor-type '((doc$ doctor--whysay) (list doctor-subj doctor-verb 
doctor-obj))))))
 
 (defun doctor-symptoms ()
   (doctor-type '((doc$ doctor--maybe) you should consult a medical doctor\;
@@ -1523,14 +1523,14 @@
   (doctor-hates1))
 
 (defun doctor-hates1 ()
-  (doctor-type '((doc$ doctor--whysay)(list doctor-subj doctor-verb 
doctor-obj) \?)))
+  (doctor-type '((doc$ doctor--whysay) (list doctor-subj doctor-verb 
doctor-obj) \?)))
 
 (defun doctor-loves ()
   (doctor-svo doctor-sent doctor-found 1 t)
   (doctor-qloves))
 
 (defun doctor-qloves ()
-  (doctor-type '((doc$ doctor--bother)(list doctor-subj doctor-verb 
doctor-obj) \?)))
+  (doctor-type '((doc$ doctor--bother) (list doctor-subj doctor-verb 
doctor-obj) \?)))
 
 (defun doctor-love ()
   (doctor-svo doctor-sent doctor-found 1 t)
@@ -1564,7 +1564,7 @@
 (defun doctor-sexnoun () (doctor-sexverb))
 
 (defun doctor-sexverb ()
-  (if (or (memq 'me doctor-sent)(memq 'myself doctor-sent)(memq 'i 
doctor-sent))
+  (if (or (memq 'me doctor-sent) (memq 'myself doctor-sent) (memq 'i 
doctor-sent))
       (doctor-foul)
     (doctor-type (doc$ doctor--sexlst))))
 

=== modified file 'lisp/play/fortune.el'
--- a/lisp/play/fortune.el      2011-01-25 04:08:28 +0000
+++ b/lisp/play/fortune.el      2011-04-21 12:24:46 +0000
@@ -282,7 +282,7 @@
 
 ;;; **************
 ;;; Display fortune
-(defun fortune-in-buffer (interactive &optional file)
+(defun fortune-in-buffer (_interactive &optional file)
   "Put a fortune cookie in the *fortune* buffer.
 INTERACTIVE is ignored.  Optional argument FILE, when supplied,
 specifies the file to choose the fortune from."

=== modified file 'lisp/play/gamegrid.el'
--- a/lisp/play/gamegrid.el     2011-03-15 17:39:56 +0000
+++ b/lisp/play/gamegrid.el     2011-04-21 12:24:46 +0000
@@ -485,12 +485,11 @@
 (defvar gamegrid-shared-game-dir)
 
 (defun gamegrid-add-score-with-update-game-score (file score)
-  (let* ((result nil) ;; What is this good for? -- os
-        (gamegrid-shared-game-dir
-         (not (zerop (logand (file-modes
-                              (expand-file-name "update-game-score"
-                                                exec-directory))
-                             #o4000)))))
+  (let ((gamegrid-shared-game-dir
+        (not (zerop (logand (file-modes
+                             (expand-file-name "update-game-score"
+                                               exec-directory))
+                            #o4000)))))
     (cond ((file-name-absolute-p file)
           (gamegrid-add-score-insecure file score))
          ((and gamegrid-shared-game-dir

=== modified file 'lisp/play/gametree.el'
--- a/lisp/play/gametree.el     2011-02-10 16:56:00 +0000
+++ b/lisp/play/gametree.el     2011-04-21 12:24:46 +0000
@@ -258,23 +258,20 @@
 
 (defun gametree-children-shown-p ()
   (save-excursion
-    (condition-case nil
+    (ignore-errors
         (let ((depth (gametree-current-branch-depth)))
           (outline-next-visible-heading 1)
-          (< depth (gametree-current-branch-depth)))
-      (error nil))))
+          (< depth (gametree-current-branch-depth))))))
 
-(defun gametree-current-layout (depth &optional top-level)
+(defun gametree-current-layout (depth &optional from-top-level)
   (let ((layout nil) (first-time t))
     (while (save-excursion
-             (condition-case nil
-                 (progn
-                   (or (and first-time top-level
-                            (bolp) (looking-at outline-regexp))
-                       (setq first-time nil)
-                       (outline-next-visible-heading 1))
-                   (< depth (gametree-current-branch-depth)))
-               (error nil)))
+             (ignore-errors
+               (or (and first-time from-top-level
+                        (bolp) (looking-at outline-regexp))
+                   (setq first-time nil)
+                   (outline-next-visible-heading 1))
+               (< depth (gametree-current-branch-depth))))
       (if (not first-time)
           (outline-next-visible-heading 1))
       (setq first-time nil)
@@ -297,18 +294,16 @@
     (goto-char (point-min))
     (setq gametree-local-layout (gametree-current-layout 0 t))))
 
-(defun gametree-apply-layout (layout depth &optional top-level)
+(defun gametree-apply-layout (layout depth &optional from-top-level)
   (let ((first-time t))
     (while (and layout
                 (save-excursion
-                  (condition-case nil
-                      (progn
-                        (or (and first-time top-level
-                                 (bolp) (looking-at outline-regexp))
-                            (setq first-time nil)
-                            (outline-next-visible-heading 1))
-                        (< depth (gametree-current-branch-depth)))
-                    (error nil))))
+                  (ignore-errors
+                    (or (and first-time from-top-level
+                             (bolp) (looking-at outline-regexp))
+                        (setq first-time nil)
+                        (outline-next-visible-heading 1))
+                    (< depth (gametree-current-branch-depth)))))
       (if (not first-time)
           (outline-next-visible-heading 1))
       (setq first-time nil)
@@ -375,9 +370,7 @@
             (while (not done)           ;handle subheadings
               (setq running (funcall minmax running
                                      (gametree-compute-reduced-score)))
-              (setq done (condition-case nil
-                             (outline-forward-same-level 1)
-                           (error nil)))))
+              (setq done (ignore-errors (outline-forward-same-level 1)))))
           running)))))
 
 ;;;; Commands

=== modified file 'lisp/play/gomoku.el'
--- a/lisp/play/gomoku.el       2011-01-25 04:08:28 +0000
+++ b/lisp/play/gomoku.el       2011-04-21 12:24:46 +0000
@@ -1043,11 +1043,11 @@
       (insert-char ?\n gomoku-square-height))
     (or (eq (char-after 1) ?.)
        (put-text-property 1 2 'point-entered
-                          (lambda (x y) (if (bobp) (forward-char)))))
+                          (lambda (_x _y) (if (bobp) (forward-char)))))
     (or intangible
        (put-text-property point (point) 'intangible 2))
     (put-text-property point (point) 'point-entered
-                      (lambda (x y) (if (eobp) (backward-char))))
+                      (lambda (_x _y) (if (eobp) (backward-char))))
     (put-text-property (point-min) (point) 'category 'gomoku-mode))
   (gomoku-goto-xy (/ (1+ n) 2) (/ (1+ m) 2)) ; center of the board
   (sit-for 0))                         ; Display NOW

=== modified file 'lisp/play/handwrite.el'
--- a/lisp/play/handwrite.el    2011-02-10 16:56:00 +0000
+++ b/lisp/play/handwrite.el    2011-04-21 12:24:46 +0000
@@ -67,8 +67,10 @@
 
 ;;; Code:
 
+;; From ps-print.el
 (defvar ps-printer-name)
 (defvar ps-lpr-command)
+(defvar ps-lpr-switches)
 
 
 ;; Variables
@@ -157,8 +159,7 @@
            `handwrite-pagenumbering' (default nil)"
   (interactive)
   (let
-      ((pmin)                          ; thanks, Havard
-       (lastp)
+      (;(pmin)                         ; thanks, Havard
        (cur-buf (current-buffer))
        (tpoint (point))
        (ps-ypos 63)

=== modified file 'lisp/play/hanoi.el'
--- a/lisp/play/hanoi.el        2011-01-15 23:16:57 +0000
+++ b/lisp/play/hanoi.el        2011-04-21 12:24:46 +0000
@@ -355,7 +355,6 @@
         (fly-steps (abs (/ (- (cdr to) (cdr from)) fly-step)))
         (directed-fly-step (/ (- (cdr to) (cdr from)) fly-steps))
         (baseward-steps (/ (- (car to) (cdr to)) baseward-step))
-        (total-steps (+ flyward-steps fly-steps baseward-steps))
         ;; A step is a character cell.  A tick is a time-unit.  To
         ;; make horizontal and vertical motion appear roughly the
         ;; same speed, we allow one tick per horizontal step and two

=== modified file 'lisp/play/landmark.el'
--- a/lisp/play/landmark.el     2011-01-25 04:08:28 +0000
+++ b/lisp/play/landmark.el     2011-04-21 12:24:46 +0000
@@ -943,11 +943,11 @@
       (insert-char ?\n landmark-square-height))
     (or (eq (char-after 1) ?.)
        (put-text-property 1 2 'point-entered
-                          (lambda (x y) (if (bobp) (forward-char)))))
+                          (lambda (_x _y) (if (bobp) (forward-char)))))
     (or intangible
        (put-text-property point (point) 'intangible 2))
     (put-text-property point (point) 'point-entered
-                      (lambda (x y) (if (eobp) (backward-char))))
+                      (lambda (_x _y) (if (eobp) (backward-char))))
     (put-text-property (point-min) (point) 'category 'landmark-mode))
   (landmark-goto-xy (/ (1+ n) 2) (/ (1+ m) 2)) ; center of the board
   (sit-for 0))                         ; Display NOW
@@ -1377,11 +1377,11 @@
    (t x)))
 
 (defun landmark-y (direction)
-  (let ((noise (put direction 'noise (landmark-noise))))
-    (put direction 'y_t
-        (if (> (get direction 's) 0.0)
-            1.0
-          0.0))))
+  (put direction 'noise (landmark-noise))
+  (put direction 'y_t
+       (if (> (get direction 's) 0.0)
+           1.0
+         0.0)))
 
 (defun landmark-update-normal-weights (direction)
   (mapc (lambda (target-direction)
@@ -1395,7 +1395,7 @@
          landmark-directions))
 
 (defun landmark-update-naught-weights (direction)
-  (mapc (lambda (target-direction)
+  (mapc (lambda (_target-direction)
             (put direction 'w0
                  (landmark-f
                   (+
@@ -1513,7 +1513,7 @@
    ((not landmark-game-in-progress)
     (landmark-prompt-for-other-game))
    (t
-    (let (square score)
+    (let (square)
       (setq square (landmark-point-square))
       (cond ((null square)
             (error "Your point is not on a square. Retry!"))

=== modified file 'lisp/play/mpuz.el'
--- a/lisp/play/mpuz.el 2011-01-25 04:08:28 +0000
+++ b/lisp/play/mpuz.el 2011-04-21 12:24:46 +0000
@@ -425,7 +425,7 @@
   "Propose a digit for a letter in puzzle."
   (interactive)
   (if mpuz-in-progress
-      (let (letter-char digit digit-char message)
+      (let (letter-char digit digit-char)
        (setq letter-char (upcase last-command-event)
              digit (mpuz-to-digit (- letter-char ?A)))
        (cond ((mpuz-digit-solved-p digit)
@@ -454,8 +454,7 @@
   "Propose LETTER-CHAR as code for DIGIT-CHAR."
   (let* ((letter (- letter-char ?A))
         (digit (- digit-char ?0))
-        (correct-digit (mpuz-to-digit letter))
-        (game mpuz-nb-completed-games))
+        (correct-digit (mpuz-to-digit letter)))
     (cond ((mpuz-digit-solved-p correct-digit)
           (message "%c has already been found." (+ correct-digit ?0)))
          ((mpuz-digit-solved-p digit)

=== modified file 'lisp/play/solitaire.el'
--- a/lisp/play/solitaire.el    2011-02-18 22:52:58 +0000
+++ b/lisp/play/solitaire.el    2011-04-21 12:24:46 +0000
@@ -126,7 +126,7 @@
   '(solitaire-left solitaire-right solitaire-up solitaire-down))
 
 ;;;###autoload
-(defun solitaire (arg)
+(defun solitaire (_arg)
   "Play Solitaire.
 
 To play Solitaire, type \\[solitaire].
@@ -393,7 +393,7 @@
                solitaire-valid-directions)))
        count))))
 
-(defun solitaire-do-check (&optional arg)
+(defun solitaire-do-check (&optional _arg)
   "Check for any possible moves in Solitaire."
   (interactive "P")
   (let ((moves (solitaire-check)))

=== modified file 'lisp/play/tetris.el'
--- a/lisp/play/tetris.el       2011-01-25 04:08:28 +0000
+++ b/lisp/play/tetris.el       2011-04-21 12:24:46 +0000
@@ -193,32 +193,32 @@
 ;; ;;;;;;;;;;;;; constants ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
 (defconst tetris-shapes
-  [[[[0  0] [1  0] [0  1] [1  1]]]  
-   
-   [[[0  0] [1  0] [2  0] [2  1]] 
-    [[1 -1] [1  0] [1  1] [0  1]] 
-    [[0 -1] [0  0] [1  0] [2  0]] 
-    [[1 -1] [2 -1] [1  0] [1  1]]] 
-   
-   [[[0  0] [1  0] [2  0] [0  1]] 
-    [[0 -1] [1 -1] [1  0] [1  1]] 
-    [[2 -1] [0  0] [1  0] [2  0]] 
-    [[1 -1] [1  0] [1  1] [2  1]]]  
-   
-   [[[0  0] [1  0] [1  1] [2  1]] 
+  [[[[0  0] [1  0] [0  1] [1  1]]]
+
+   [[[0  0] [1  0] [2  0] [2  1]]
+    [[1 -1] [1  0] [1  1] [0  1]]
+    [[0 -1] [0  0] [1  0] [2  0]]
+    [[1 -1] [2 -1] [1  0] [1  1]]]
+
+   [[[0  0] [1  0] [2  0] [0  1]]
+    [[0 -1] [1 -1] [1  0] [1  1]]
+    [[2 -1] [0  0] [1  0] [2  0]]
+    [[1 -1] [1  0] [1  1] [2  1]]]
+
+   [[[0  0] [1  0] [1  1] [2  1]]
     [[1  0] [0  1] [1  1] [0  2]]]
-   
-   [[[1  0] [2  0] [0  1] [1  1]] 
-    [[0  0] [0  1] [1  1] [1  2]]]  
-   
-   [[[1  0] [0  1] [1  1] [2  1]] 
-    [[1  0] [1  1] [2  1] [1  2]]                
-    [[0  1] [1  1] [2  1] [1  2]] 
+
+   [[[1  0] [2  0] [0  1] [1  1]]
+    [[0  0] [0  1] [1  1] [1  2]]]
+
+   [[[1  0] [0  1] [1  1] [2  1]]
+    [[1  0] [1  1] [2  1] [1  2]]
+    [[0  1] [1  1] [2  1] [1  2]]
     [[1  0] [0  1] [1  1] [1  2]]]
-   
+
    [[[0  0] [1  0] [2  0] [3  0]]
     [[1 -1] [1  0] [1  1] [1  2]]]]
-  "Each shape is described by a vector that contains the coordinates of 
+  "Each shape is described by a vector that contains the coordinates of
 each one of its four blocks.")
 
 ;;the scoring rules were taken from "xtetris".  Blocks score differently
@@ -236,7 +236,7 @@
 
 (defconst tetris-space 9)
 
-(defun tetris-default-update-speed-function (shapes rows)
+(defun tetris-default-update-speed-function (_shapes rows)
   (/ 20.0 (+ 50.0 rows)))
 
 ;; ;;;;;;;;;;;;; variables ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -380,10 +380,10 @@
   (loop for i from 0 to 3 do
         (let ((c (tetris-get-shape-cell i)))
           (gamegrid-set-cell (+ tetris-top-left-x
-                                tetris-pos-x 
+                                tetris-pos-x
                                 (aref c 0))
                              (+ tetris-top-left-y
-                                tetris-pos-y 
+                                tetris-pos-y
                                 (aref c 1))
                              tetris-blank))))
 
@@ -393,14 +393,14 @@
           (unless hit
             (setq hit
                   (let* ((c (tetris-get-shape-cell i))
-                         (xx (+ tetris-pos-x 
+                         (xx (+ tetris-pos-x
                                 (aref c 0)))
-                         (yy (+ tetris-pos-y 
+                         (yy (+ tetris-pos-y
                                 (aref c 1))))
                     (or (>= xx tetris-width)
                         (>= yy tetris-height)
-                        (/= (gamegrid-get-cell 
-                             (+ xx tetris-top-left-x) 
+                        (/= (gamegrid-get-cell
+                             (+ xx tetris-top-left-x)
                              (+ yy tetris-top-left-y))
                             tetris-blank))))))
     hit))
@@ -537,10 +537,10 @@
   (interactive)
   (unless tetris-paused
       (tetris-erase-shape)
-      (setq tetris-rot (% (+ 1 tetris-rot) 
+      (setq tetris-rot (% (+ 1 tetris-rot)
                           (tetris-shape-rotations)))
       (if (tetris-test-shape)
-          (setq tetris-rot (% (+ 3 tetris-rot) 
+          (setq tetris-rot (% (+ 3 tetris-rot)
                               (tetris-shape-rotations))))
       (tetris-draw-shape)))
 

=== modified file 'lisp/play/zone.el'
--- a/lisp/play/zone.el 2011-01-25 04:08:28 +0000
+++ b/lisp/play/zone.el 2011-04-21 12:24:46 +0000
@@ -626,6 +626,8 @@
   "*Seconds to wait between successive `life' generations.
 If nil, `zone-pgm-random-life' chooses a value from 0-3 (inclusive).")
 
+(defvar life-patterns) ; from life.el
+
 (defun zone-pgm-random-life ()
   (require 'life)
   (zone-fill-out-screen (1- (window-width)) (1- (window-height)))


reply via email to

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