changeset 21363:f1fc193b6958

Customized.
author Stephen Eglen <stephen@gnu.org>
date Sun, 05 Apr 1998 16:14:58 +0000
parents a45af443a262
children ab5063078051
files lisp/play/bruce.el lisp/play/decipher.el lisp/play/dunnet.el lisp/play/gametree.el lisp/play/gomoku.el lisp/play/handwrite.el lisp/play/landmark.el lisp/play/mpuz.el lisp/play/solitaire.el lisp/play/spook.el lisp/play/yow.el
diffstat 11 files changed, 221 insertions(+), 80 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/play/bruce.el	Sun Apr 05 11:46:30 1998 +0000
+++ b/lisp/play/bruce.el	Sun Apr 05 16:14:58 1998 +0000
@@ -106,11 +106,20 @@
 (require 'cookie1)
 
 ; Variables
-(defvar bruce-phrases-file "~/bruce.lines"
-   "Keep your favorite phrases here.")
+(defgroup bruce nil
+  "Insert phrases selected at random from a file into a buffer."
+  :prefix "bruce-"
+  :group 'games)
 
-(defvar bruce-phrase-default-count 15
-   "Default number of phrases to insert")
+(defcustom bruce-phrases-file "~/bruce.lines"
+  "Keep your favorite phrases here."
+  :type 'file
+  :group 'bruce)
+
+(defcustom bruce-phrase-default-count 15
+  "Default number of phrases to insert."
+  :type 'integer
+  :group 'bruce)
 
 ;;;###autoload
 (defun bruce ()
--- a/lisp/play/decipher.el	Sun Apr 05 11:46:30 1998 +0000
+++ b/lisp/play/decipher.el	Sun Apr 05 16:14:58 1998 +0000
@@ -93,22 +93,39 @@
 (eval-when-compile
   (require 'cl))
 
-(defvar decipher-force-uppercase t
+(defgroup decipher nil
+  "Cryptanalyze monoalphabetic substitution ciphers."
+  :prefix "decipher-"
+  :group 'games)
+
+(defcustom decipher-force-uppercase t
   "*Non-nil means to convert ciphertext to uppercase.
 Nil means the case of the ciphertext is preserved.
-This variable must be set before typing `\\[decipher]'.")
+This variable must be set before typing `\\[decipher]'."
+  :type 'boolean
+  :group 'decipher)
 
-(defvar decipher-ignore-spaces nil
+
+(defcustom decipher-ignore-spaces nil
   "*Non-nil means to ignore spaces and punctuation when counting digrams.
 You should set this to `nil' if the cipher message is divided into words,
 or `t' if it is not.
-This variable is buffer-local.")
+This variable is buffer-local."
+  :type 'boolean
+  :group 'decipher)
 (make-variable-buffer-local 'decipher-ignore-spaces)
 
-(defvar decipher-undo-limit 5000
+(defcustom decipher-undo-limit 5000
   "The maximum number of entries in the undo list.
 When the undo list exceeds this number, 100 entries are deleted from
-the tail of the list.")
+the tail of the list."
+  :type 'integer
+  :group 'decipher)
+
+(defcustom decipher-mode-hook nil
+  "Hook to run upon entry to decipher."
+  :type 'hook
+  :group 'decipher)
 
 ;; End of user modifiable variables
 ;;--------------------------------------------------------------------
--- a/lisp/play/dunnet.el	Sun Apr 05 11:46:30 1998 +0000
+++ b/lisp/play/dunnet.el	Sun Apr 05 16:14:58 1998 +0000
@@ -33,9 +33,15 @@
 ;;;  The log file should be set for your system, and it must
 ;;;  be writable by all.
 
+(defgroup dunnet nil
+  "Text adventure for Emacs."
+  :prefix "dun-"
+  :group 'games)
 
-(defvar dun-log-file "/usr/local/dunnet.score"
-  "Name of file to store score information for dunnet.")
+(defcustom dun-log-file "/usr/local/dunnet.score"
+  "Name of file to store score information for dunnet."
+  :type 'file
+  :group 'dunnet)
 
 (if nil
     (eval-and-compile (setq byte-compile-warnings nil)))
--- a/lisp/play/gametree.el	Sun Apr 05 11:46:30 1998 +0000
+++ b/lisp/play/gametree.el	Sun Apr 05 16:14:58 1998 +0000
@@ -90,33 +90,48 @@
 
 ;;;; Configuration variables
 
-(defvar gametree-half-ply-regexp (regexp-quote ":")
+(defgroup gametree nil
+  "Manage game analysis trees in Emacs."
+  :prefix "gametree-"
+  :group 'games)
+
+(defcustom gametree-half-ply-regexp (regexp-quote ":")
   "*Matches ends of numbers of moves by the \"second\" player.
 For instance, it is an almost universal convention in chess to postfix
 numbers of moves by Black (if considered in isolation) by the ellipsis
 \"...\".  This is NOT a good choice for this program, though, because it
 conflicts with the use of ellipsis by Outline mode to denote collapsed
 subtrees.  The author uses \":\" because it agrees nicely with a set of
-LaTeX macros he uses for typesetting annotated games.")
+LaTeX macros he uses for typesetting annotated games."
+  :type 'regexp
+  :group 'gametree)
 
-(defvar gametree-full-ply-regexp (regexp-quote ".")
+(defcustom gametree-full-ply-regexp (regexp-quote ".")
   "*Matches ends of numbers of moves by the \"first\" player.
 For instance, it is an almost universal convention in chess to postfix
-numbers of moves by White (if considered in isolation) by the dot \".\".")
-
-(defvar gametree-half-ply-format "%d:"
-  "*Output format for move numbers of moves by the \"second\" player.
-Has to contain \"%d\" to output the actual number.")
+numbers of moves by White (if considered in isolation) by the dot \".\"."
+  :type 'regexp
+  :group 'gametree)
 
-(defvar gametree-full-ply-format "%d."
+(defcustom gametree-half-ply-format "%d:"
+  "*Output format for move numbers of moves by the \"second\" player.
+Has to contain \"%d\" to output the actual number."
+  :type 'string
+  :group 'gametree)
+
+(defcustom gametree-full-ply-format "%d."
   "*Output format for move numbers of moves by the \"first\" player.
-Has to contain \"%d\" to output the actual number.")
+Has to contain \"%d\" to output the actual number."
+  :type 'string
+  :group 'gametree)
 
-(defvar gametree-make-heading-function
+(defcustom gametree-make-heading-function
   (function (lambda (level)
               (insert (make-string level ?*))))
   "A function of one numeric argument, LEVEL, to insert a heading at point.
-You should change this if you change `outline-regexp'.")
+You should change this if you change `outline-regexp'."
+  :type 'function
+  :group 'gametree)
 
 (defvar gametree-local-layout nil
   "A list encoding the layout (i.e. the show or hide state) of the file.
--- a/lisp/play/gomoku.el	Sun Apr 05 11:46:30 1998 +0000
+++ b/lisp/play/gomoku.el	Sun Apr 05 16:14:58 1998 +0000
@@ -66,11 +66,18 @@
 
 ;;; Code:
 
+(defgroup gomoku nil
+  "Gomoku game between you and Emacs."
+  :prefix "gomoku-"
+  :group 'games)
 ;;;
 ;;; GOMOKU MODE AND KEYMAP.
 ;;;
-(defvar gomoku-mode-hook nil
-  "If non-nil, its value is called on entry to Gomoku mode.")
+(defcustom gomoku-mode-hook nil
+  "If non-nil, its value is called on entry to Gomoku mode.
+One useful value to include is `turn-on-font-lock' to highlight the pieces."
+  :type 'hook
+  :group 'gomoku)
 
 (defvar gomoku-mode-map nil
   "Local keymap to use in Gomoku mode.")
@@ -133,17 +140,21 @@
 			     gomoku-mode-map (current-global-map)))
 
 (defvar gomoku-emacs-won ()
-  "*For making font-lock use the winner's face for the line.")
+  "For making font-lock use the winner's face for the line.")
 
-(defvar gomoku-font-lock-O-face
+(defcustom gomoku-font-lock-O-face
   (if window-system
       (list (facemenu-get-face 'fg:red) 'bold))
-  "*Face to use for Emacs' O.")
+  "*Face to use for Emacs' O."
+  :type '(repeat face)
+  :group 'gomoku)
 
-(defvar gomoku-font-lock-X-face
+(defcustom gomoku-font-lock-X-face
   (if window-system
       (list (facemenu-get-face 'fg:green) 'bold))
-  "*Face to use for your X.")
+  "*Face to use for your X."
+  :type '(repeat face)
+  :group 'gomoku)
 
 (defvar gomoku-font-lock-keywords
   '(("O" . gomoku-font-lock-O-face)
--- a/lisp/play/handwrite.el	Sun Apr 05 11:46:30 1998 +0000
+++ b/lisp/play/handwrite.el	Sun Apr 05 16:14:58 1998 +0000
@@ -72,6 +72,11 @@
 
 ;; Variables
 
+(defgroup handwrite nil
+  "Turns your emacs buffer into a handwritten document."
+  :prefix "handwrite-"
+  :group 'games)
+
 (defvar handwrite-psindex 0
   "The index of the PostScript buffer.")
 (defvar menu-bar-handwrite-map (make-sparse-keymap "Handwrite functions."))
@@ -80,27 +85,46 @@
 
 ;; User definable variables
 
-(defvar handwrite-numlines 60
-  "*The number of lines on a page of the PostScript output from `handwrite'.")
-(defvar handwrite-fontsize 11
-  "*The size of the font for the PostScript output from `handwrite'.")
-(defvar handwrite-linespace 12
-  "*The spacing for the PostScript output from `handwrite'.")
-(defvar handwrite-xstart 30
-  "*X-axis translation in the PostScript output from `handwrite'.")
-(defvar handwrite-ystart 810
-  "*Y-axis translation in the PostScript output from `handwrite'.")
-(defvar handwrite-pagenumbering nil
-  "*If non-nil, number each page of the PostScript output from `handwrite'.")
-(defvar handwrite-10pt-numlines 65
-  "*The number of lines on a page for the function `handwrite-10pt'.")
-(defvar handwrite-11pt-numlines 60
-  "*The number of lines on a page for the function `handwrite-11pt'.")
-(defvar handwrite-12pt-numlines 55
-  "*The number of lines on a page for the function `handwrite-12pt'.")
-(defvar handwrite-13pt-numlines 50
-  "*The number of lines on a page for the function `handwrite-13pt'.")
-
+(defcustom handwrite-numlines 60
+  "*The number of lines on a page of the PostScript output from `handwrite'."
+  :type 'integer
+  :group 'handwrite)
+(defcustom handwrite-fontsize 11
+  "*The size of the font for the PostScript output from `handwrite'."
+  :type 'integer
+  :group 'handwrite)
+(defcustom handwrite-linespace 12
+  "*The spacing for the PostScript output from `handwrite'."
+  :type 'integer
+  :group 'handwrite)
+(defcustom handwrite-xstart 30
+  "*X-axis translation in the PostScript output from `handwrite'."
+  :type 'integer
+  :group 'handwrite)
+(defcustom handwrite-ystart 810
+  "*Y-axis translation in the PostScript output from `handwrite'."
+  :type 'integer
+  :group 'handwrite)
+(defcustom handwrite-pagenumbering nil
+  "*If non-nil, number each page of the PostScript output from `handwrite'."
+  :type 'boolean
+  :group 'handwrite)
+(defcustom handwrite-10pt-numlines 65
+  "*The number of lines on a page for the function `handwrite-10pt'."
+  :type 'integer
+  :group 'handwrite)
+(defcustom handwrite-11pt-numlines 60
+  "*The number of lines on a page for the function `handwrite-11pt'."
+  :type 'integer
+  :group 'handwrite)
+(defcustom handwrite-12pt-numlines 55
+  "*The number of lines on a page for the function `handwrite-12pt'."
+  :type 'integer
+  :group 'handwrite)
+(defcustom handwrite-13pt-numlines 50
+  "*The number of lines on a page for the function `handwrite-13pt'."
+  :type 'integer
+  :group 'handwrite)
 
 ;; Interactive functions
 
--- a/lisp/play/landmark.el	Sun Apr 05 11:46:30 1998 +0000
+++ b/lisp/play/landmark.el	Sun Apr 05 16:14:58 1998 +0000
@@ -68,6 +68,11 @@
 
 ;;;_* From Gomoku
 
+(defgroup lm nil
+  "Neural-network robot that learns landmarks."
+  :prefix "lm-"
+  :group 'games)
+
 ;;;_ +  THE BOARD.
 
 ;; The board is a rectangular grid. We code empty squares with 0, X's with 1
@@ -154,8 +159,10 @@
 
 ;;;_ +  LM MODE AND KEYMAP.
 
-(defvar lm-mode-hook nil
-  "If non-nil, its value is called on entry to Lm mode.")
+(defcustom lm-mode-hook nil
+  "If non-nil, its value is called on entry to Lm mode."
+  :type 'hook
+  :group 'lm)
 
 (defvar lm-mode-map nil
   "Local keymap to use in Lm mode.")
@@ -1123,12 +1130,16 @@
 ;;;(setq lm-debug nil)
 (defvar lm-debug nil
   "If non-nil, debugging is printed.")
-(defvar lm-one-moment-please nil
+(defcustom lm-one-moment-please nil
   "If non-nil, print \"One moment please\" when a new board is generated.
 The drawback of this is you don't see how many moves the last run took
-because it is overwritten by \"One moment please\".")
-(defvar lm-output-moves t
-  "If non-nil, output number of moves so far on a move-by-move basis.")
+because it is overwritten by \"One moment please\"."
+  :type 'boolean
+  :group 'lm)
+(defcustom lm-output-moves t
+  "If non-nil, output number of moves so far on a move-by-move basis."
+  :type 'boolean
+  :group 'lm)
 
 
 (defun lm-weights-debug ()
@@ -1252,22 +1263,32 @@
   (mapc 'lm-print-wts-int lm-directions))
 
 ;;;_  - learning parameters
-(defvar lm-bound 0.005
-  "The maximum that w0j may be.")
-(defvar lm-c 1.0
+(defcustom lm-bound 0.005
+  "The maximum that w0j may be."
+  :type 'number
+  :group 'lm)
+(defcustom lm-c 1.0
   "A factor applied to modulate the increase in wij.
-Used in the function lm-update-normal-weights.")
-(defvar lm-c-naught 0.5
+Used in the function lm-update-normal-weights."
+  :type 'number
+  :group 'lm)
+(defcustom lm-c-naught 0.5
   "A factor applied to modulate the increase in w0j.
-Used in the function lm-update-naught-weights.")
+Used in the function lm-update-naught-weights."
+  :type 'number
+  :group 'lm)
 (defvar lm-initial-w0 0.0)
 (defvar lm-initial-wij 0.0)
-(defvar lm-no-payoff 0
+(defcustom lm-no-payoff 0
   "The amount of simulation cycles that have occurred with no movement.
-Used to move the robot when he is stuck in a rut for some reason.")
-(defvar lm-max-stall-time 2
+Used to move the robot when he is stuck in a rut for some reason."
+  :type 'integer
+  :group 'lm)
+(defcustom lm-max-stall-time 2
   "The maximum number of cycles that the robot can remain stuck in a place.
-After this limit is reached, lm-random-move is called to push him out of it.")
+After this limit is reached, lm-random-move is called to push him out of it."
+  :type 'integer
+  :group 'lm)
 
 
 ;;;_ + Randomizing functions
--- a/lisp/play/mpuz.el	Sun Apr 05 11:46:30 1998 +0000
+++ b/lisp/play/mpuz.el	Sun Apr 05 16:14:58 1998 +0000
@@ -31,10 +31,17 @@
 
 ;;; Code:
 
+(defgroup mpuz nil
+  "Multiplication puzzle."
+  :prefix "mpuz-"
+  :group 'games)
+
 (random t)				; randomize
 
-(defvar mpuz-silent nil
-  "*Set this to T if you don't want dings on inputs.")
+(defcustom mpuz-silent nil
+  "*Set this to T if you don't want dings on inputs."
+  :type 'boolean
+  :group 'mpuz)
 
 (defun mpuz-ding ()
   "Dings, unless global variable `mpuz-silent' forbids it."
@@ -43,7 +50,10 @@
 
 ;; Mpuz mode and keymaps
 ;;----------------------
-(defvar mpuz-mode-hook nil)
+(defcustom mpuz-mode-hook nil
+  "Hook to run upon entry to mpuz."
+  :type 'hook
+  :group 'mpuz)
 
 (defvar mpuz-mode-map nil
   "Local keymap to use in Mult Puzzle.")
--- a/lisp/play/solitaire.el	Sun Apr 05 11:46:30 1998 +0000
+++ b/lisp/play/solitaire.el	Sun Apr 05 16:14:58 1998 +0000
@@ -33,9 +33,19 @@
 
 ;;; Code:
 
+(defgroup solitaire nil
+  "Game of solitaire."
+  :prefix "solitaire-"
+  :group 'games)
+
 (defvar solitaire-mode-map nil
   "Keymap for playing solitaire.")
 
+(defcustom solitaire-mode-hook nil
+  "Hook to run upon entry to solitaire."
+  :type 'hook
+  :group 'solitaire)
+
 (if solitaire-mode-map
     ()
   (setq solitaire-mode-map (make-sparse-keymap))
@@ -116,10 +126,12 @@
 (defvar solitaire-end-x nil)
 (defvar solitaire-end-y nil)
 
-(defvar solitaire-auto-eval t
+(defcustom solitaire-auto-eval t
   "*Non-nil means check for possible moves after each major change.
 This takes a while, so switch this on if you like to be informed when
-the game is over, or off, if you are working on a slow machine.")
+the game is over, or off, if you are working on a slow machine."
+  :type 'boolean
+  :group 'solitaire)
 
 (defconst solitaire-valid-directions
   '(solitaire-left solitaire-right solitaire-up solitaire-down))
@@ -134,7 +146,7 @@
 Move stones using \\[solitaire-move] followed by a direction key.
 Undo moves using \\[solitaire-undo].
 Check for possible moves using \\[solitaire-do-check].
-\(The variable solitaire-auto-eval controls whether to automatically
+\(The variable `solitaire-auto-eval' controls whether to automatically
 check after each move or undo)
 
 What is Solitaire?
--- a/lisp/play/spook.el	Sun Apr 05 11:46:30 1998 +0000
+++ b/lisp/play/spook.el	Sun Apr 05 16:14:58 1998 +0000
@@ -40,11 +40,20 @@
 (require 'cookie1)
 
 ; Variables
-(defvar spook-phrases-file (concat data-directory "spook.lines")
-   "Keep your favorite phrases here.")
+(defgroup spook nil
+  "Spook phrase utility for overloading the NSA line eater."
+  :prefix "spook-"
+  :group 'games)
 
-(defvar spook-phrase-default-count 15
-   "Default number of phrases to insert")
+(defcustom spook-phrases-file (concat data-directory "spook.lines")
+  "Keep your favorite phrases here."
+  :type 'file
+  :group 'spook)
+
+(defcustom spook-phrase-default-count 15
+  "Default number of phrases to insert."
+  :type 'integer
+  :group 'spook)
 
 ;;;###autoload
 (defun spook ()
--- a/lisp/play/yow.el	Sun Apr 05 11:46:30 1998 +0000
+++ b/lisp/play/yow.el	Sun Apr 05 16:14:58 1998 +0000
@@ -35,8 +35,15 @@
 
 (require 'cookie1)
 
-(defvar yow-file (concat data-directory "yow.lines")
-   "File containing pertinent pinhead phrases.")
+(defgroup yow nil
+  "Quote random zippyisms."
+  :prefix "yow-"
+  :group 'games)
+
+(defcustom yow-file (concat data-directory "yow.lines")
+   "File containing pertinent pinhead phrases."
+  :type 'file
+  :group 'yow)
 
 (defconst yow-load-message "Am I CONSING yet?...")
 (defconst yow-after-load-message "I have SEEN the CONSING!!")