-;;; bubbles.el --- Puzzle game for Emacs
+;;; bubbles.el --- Puzzle game for Emacs -*- lexical-binding:t -*-
;; Copyright (C) 2007-2018 Free Software Foundation, Inc.
(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.")
(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.")
(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
: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 ()
;; 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)
(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 ()
(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)
(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)
(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))