emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] master 75386e3: * lisp/play/bubbles.el: Use lexical-bindin


From: Stefan Monnier
Subject: [Emacs-diffs] master 75386e3: * lisp/play/bubbles.el: Use lexical-binding
Date: Sat, 22 Sep 2018 19:28:42 -0400 (EDT)

branch: master
commit 75386e305f388ff51bc8cf9945f52c29c14427cd
Author: Stefan Monnier <address@hidden>
Commit: Stefan Monnier <address@hidden>

    * lisp/play/bubbles.el: Use lexical-binding
---
 lisp/play/bubbles.el | 32 +++++++++++++-------------------
 1 file changed, 13 insertions(+), 19 deletions(-)

diff --git a/lisp/play/bubbles.el b/lisp/play/bubbles.el
index ee2135b..a54682f 100644
--- a/lisp/play/bubbles.el
+++ b/lisp/play/bubbles.el
@@ -1,4 +1,4 @@
-;;; bubbles.el --- Puzzle game for Emacs
+;;; bubbles.el --- Puzzle game for Emacs  -*- lexical-binding:t -*-
 
 ;; Copyright (C) 2007-2018 Free Software Foundation, Inc.
 
@@ -144,8 +144,7 @@ images the `ascii' theme will be used."
                 (const :tag "Diamonds" diamonds)
                 (const :tag "Balls" balls)
                 (const :tag "Emacs" emacs)
-                (const :tag "ASCII (no images)" ascii))
-  :group 'bubbles)
+                (const :tag "ASCII (no images)" ascii)))
 
 (defconst bubbles--grid-small '(10 . 10)
   "Predefined small bubbles grid.")
@@ -168,8 +167,7 @@ images the `ascii' theme will be used."
                 (const :tag "Huge" ,bubbles--grid-huge)
                 (cons :tag "User defined"
                       (integer :tag "Width")
-                      (integer :tag "Height")))
-  :group 'bubbles)
+                      (integer :tag "Height"))))
 
 (defconst bubbles--colors-2 '("orange" "violet")
   "Predefined bubbles color list with two colors.")
@@ -194,16 +192,14 @@ types are present."
                 (const :tag "Red, darkgreen, blue, orange" ,bubbles--colors-4)
                 (const :tag "Red, darkgreen, blue, orange, violet"
                        ,bubbles--colors-5)
-                (repeat :tag "User defined" color))
-  :group 'bubbles)
+                (repeat :tag "User defined" color)))
 
 (defcustom bubbles-chars
   '(?+ ?O ?# ?X ?. ?* ?& ?ยง)
   "Characters used for bubbles.
 Note that the actual number of different bubbles is determined by
 the number of colors, see `bubbles-colors'."
-  :type '(repeat character)
-  :group 'bubbles)
+  :type '(repeat character))
 
 (defcustom bubbles-shift-mode
   'default
@@ -212,12 +208,10 @@ Available modes are `shift-default' and `shift-always'."
   :type '(radio (const :tag "Default" default)
                 (const :tag "Shifter" always)
                 ;;(const :tag "Mega Shifter" mega)
-                )
-  :group 'bubbles)
+                ))
 
 (defcustom bubbles-mode-hook nil
   "Hook run by Bubbles mode."
-  :group 'bubbles
   :type 'hook)
 
 (defun bubbles-customize ()
@@ -898,7 +892,7 @@ static char * dot3d_xpm[] = {
 ;; bubbles mode map
 (defvar bubbles-mode-map
   (let ((map (make-sparse-keymap 'bubbles-mode-map)))
-;;    (suppress-keymap map t)
+    ;; (suppress-keymap map t)
     (define-key map "q" 'bubbles-quit)
     (define-key map "\n" 'bubbles-plop)
     (define-key map " " 'bubbles-plop)
@@ -925,7 +919,7 @@ static char * dot3d_xpm[] = {
   (buffer-disable-undo)
   (force-mode-line-update)
   (redisplay)
-  (add-hook 'post-command-hook 'bubbles--mark-neighborhood t t))
+  (add-hook 'post-command-hook #'bubbles--mark-neighborhood t t))
 
 ;;;###autoload
 (defun bubbles ()
@@ -1004,14 +998,14 @@ Set `bubbles--col-offset' and `bubbles--row-offset'."
                                           (list bubbles--row-offset))))
     (insert "\n")
     (let ((max-char (length (bubbles--colors))))
-      (dotimes (i (bubbles--grid-height))
+      (dotimes (_ (bubbles--grid-height))
         (let ((p (point)))
           (insert " ")
           (put-text-property p (point)
                              'display
                              (cons 'space (list :width
                                                 (list bubbles--col-offset)))))
-        (dotimes (j (bubbles--grid-width))
+        (dotimes (_ (bubbles--grid-width))
           (let* ((index (random max-char))
                  (char (nth index bubbles-chars)))
             (insert char)
@@ -1268,7 +1262,7 @@ Use optional parameter POS instead of point if given."
                      (while (get-text-property (point) 'removed)
                        (setq shifted-cols (1+ shifted-cols))
                        (bubbles--shift 'right (1- (bubbles--grid-height)) j))
-                     (dotimes (k shifted-cols)
+                     (dotimes (_ shifted-cols)
                        (let ((i (- (bubbles--grid-height) 2)))
                          (while (>= i 0)
                            (setq shifted (or (bubbles--shift 'right i j)
@@ -1422,8 +1416,8 @@ Return t if new char is non-empty."
         (goto-char (point-min))
         (forward-line 1)
         (let ((inhibit-read-only t))
-          (dotimes (i (bubbles--grid-height))
-            (dotimes (j (bubbles--grid-width))
+          (dotimes (_ (bubbles--grid-height))
+            (dotimes (_ (bubbles--grid-width))
               (forward-char 1)
               (let ((index (or (get-text-property (point) 'index) -1)))
                 (let ((img bubbles--empty-image))



reply via email to

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