;;; mpuz.el --- multiplication puzzle for GNU Emacs
-;; Copyright (C) 1990, 2001-2011 Free Software Foundation, Inc.
+;; Copyright (C) 1990, 2001-2015 Free Software Foundation, Inc.
;; Author: Philippe Schnoebelen <phs@lsv.ens-cachan.fr>
;; Overhauled: Daniel Pfeiffer <occitan@esperanto.org>
:prefix "mpuz-"
:group 'games)
-(random t) ; randomize
-
(defcustom mpuz-silent 'error
"Set this to nil if you want dings on inputs.
The value t means never ding, and `error' means only ding on wrong input."
:group 'mpuz)
(defface mpuz-unsolved
- '((((class color)) (:foreground "red1" :bold t))
- (t (:bold t)))
- "Face to use for letters to be solved."
+ '((default :weight bold)
+ (((class color)) :foreground "red1"))
+ "Face for letters to be solved."
:group 'mpuz)
(defface mpuz-solved
- '((((class color)) (:foreground "green1" :bold t))
- (t (:bold t)))
- "Face to use for solved digits."
+ '((default :weight bold)
+ (((class color)) :foreground "green1"))
+ "Face for solved digits."
:group 'mpuz)
(defface mpuz-trivial
- '((((class color)) (:foreground "blue" :bold t))
- (t (:bold t)))
- "Face to use for trivial digits solved for you."
+ '((default :weight bold)
+ (((class color)) :foreground "blue"))
+ "Face for trivial digits solved for you."
:group 'mpuz)
(defface mpuz-text
- '((t (:inherit variable-pitch)))
- "Face to use for text on right."
+ '((t :inherit variable-pitch))
+ "Face for text on right."
:group 'mpuz)
\f
map)
"Local keymap to use in Mult Puzzle.")
-(defun mpuz-mode ()
+
+
+(define-derived-mode mpuz-mode fundamental-mode "Mult Puzzle"
"Multiplication puzzle mode.
You have to guess which letters stand for which digits in the
To leave the game to do other editing work, just switch buffers.
Then you may resume the game with M-x mpuz.
You may abort a game by typing \\<mpuz-mode-map>\\[mpuz-offer-abort]."
- (interactive)
- (kill-all-local-variables)
- (setq major-mode 'mpuz-mode
- mode-name "Mult Puzzle"
- tab-width 30)
- (use-local-map mpuz-mode-map)
- (run-mode-hooks 'mpuz-mode-hook))
+ (setq tab-width 30))
\f
;; Some variables for statistics