-;;; bubbles.el --- Puzzle game for Emacs
+;;; bubbles.el --- Puzzle game for Emacs -*- coding: utf-8 -*-
-;; Copyright (C) 2007-2012 Free Software Foundation, Inc.
+;; Copyright (C) 2007-2013 Free Software Foundation, Inc.
;; Author: Ulf Jasper <ulf.jasper@web.de>
;; URL: http://ulf.epplejasper.de/
;; Installation
;; ------------
-;; Add the following lines to your Emacs startup file (`~/.emacs').
+;; Add the following lines to your init file:
;; (add-to-list 'load-path "/path/to/bubbles/")
;; (autoload 'bubbles "bubbles" "Play Bubbles" t)
:group 'bubbles)
(defcustom bubbles-chars
- '(?+ ?O ?# ?X ?. ?* ?& ?§)
+ '(?+ ?O ?# ?X ?. ?* ?& ?§)
"Characters used for bubbles.
Note that the actual number of different bubbles is determined by
the number of colors, see `bubbles-colors'."
Use optional parameter POS instead of point if given."
(when bubbles--playing
(unless pos (setq pos (point)))
- (condition-case err
- (let ((char (char-after pos))
- (inhibit-read-only t)
- (row (bubbles--row (point)))
- (col (bubbles--col (point))))
- (add-text-properties (point-min) (point-max)
- '(face default active nil))
- (let ((count 0))
- (when (and row col (not (eq char (bubbles--empty-char))))
- (setq count (bubbles--mark-direct-neighbours row col char))
- (unless (> count 1)
- (add-text-properties (point-min) (point-max)
- '(face default active nil))
- (setq count 0)))
- (bubbles--update-neighbourhood-score count))
- (put-text-property (point-min) (point-max) 'pointer 'arrow)
- (bubbles--update-faces-or-images)
- (sit-for 0))
- (error (message "Bubbles: Internal error %s" err)))))
+ (with-demoted-errors "Bubbles: Internal error %s"
+ (let ((char (char-after pos))
+ (inhibit-read-only t)
+ (row (bubbles--row (point)))
+ (col (bubbles--col (point))))
+ (add-text-properties (point-min) (point-max)
+ '(face default active nil))
+ (let ((count 0))
+ (when (and row col (not (eq char (bubbles--empty-char))))
+ (setq count (bubbles--mark-direct-neighbours row col char))
+ (unless (> count 1)
+ (add-text-properties (point-min) (point-max)
+ '(face default active nil))
+ (setq count 0)))
+ (bubbles--update-neighbourhood-score count))
+ (put-text-property (point-min) (point-max) 'pointer 'arrow)
+ (bubbles--update-faces-or-images)
+ (sit-for 0)))))
(defun bubbles--neighbourhood-available ()
"Return t if another valid neighborhood is available."