changeset 1217:d0b19afef0ae

Fix setup of mpuz-read-map not to depend on keymap format. (mpuz): Renamed from mult-puzzle. Make it autoload.
author Richard M. Stallman <rms@gnu.org>
date Sat, 26 Sep 1992 21:27:08 +0000
parents 6a8704922fe8
children 678ff000d9c8
files lisp/play/mpuz.el
diffstat 1 files changed, 13 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/play/mpuz.el	Sat Sep 26 21:15:01 1992 +0000
+++ b/lisp/play/mpuz.el	Sat Sep 26 21:27:08 1992 +0000
@@ -76,20 +76,23 @@
 
 (if mpuz-read-map nil
     (setq mpuz-read-map (make-keymap))
-    (fillarray mpuz-read-map 'exit-minibuffer))
+    (let ((i 0))
+      (while (< i (length mpuz-read-map))
+	(define-key mpuz-read-map (char-to-string i) 'exit-minibuffer)
+	(setq i (1+ i)))))
 
 (defun mpuz-mode ()
-  "Multiplication puzzle with GNU Emacs.
+  "Multiplication puzzle mode.
 
 You have to guess which letters stand for which digits in the
-multiplication displayed inside the *Mult Puzzle* buffer.
+multiplication displayed inside the `*Mult Puzzle*' buffer.
 
-You may enter a proposal (e.g. A=3) by hitting first the letter A,
-then the digit 3, on your keyboard.
+You may enter a guess for a letter's value by typing first the letter,
+then the digit.  Thus, to guess that A=3, type A 3.
 
-At any time you may leave the game to do other editing work. :-)
-Then you may resume the game with M-x mult-puzzle.
-You may abort a game by hitting \\[keyboard-quit]."
+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)
   (setq major-mode 'mpuz-mode
 	mode-name  "Mult Puzzle")
@@ -336,7 +339,8 @@
       (mpuz-start-new-game)
       (message "OK. I won't.")))
 
-(defun mult-puzzle ()
+;;;###autoload
+(defun mpuz ()
   "Multiplication puzzle with GNU Emacs."
   ;; Main entry point
   (interactive)