From 323f7c491fa609efb16ab53da95c591e487e6f23 Mon Sep 17 00:00:00 2001 From: Stephen Eglen Date: Sun, 5 Apr 1998 16:14:58 +0000 Subject: [PATCH] Customized. --- lisp/play/bruce.el | 19 ++++++++---- lisp/play/decipher.el | 29 +++++++++++++++---- lisp/play/dunnet.el | 12 ++++++-- lisp/play/gametree.el | 35 +++++++++++++++------- lisp/play/gomoku.el | 25 +++++++++++----- lisp/play/handwrite.el | 66 ++++++++++++++++++++++++++++-------------- lisp/play/landmark.el | 53 +++++++++++++++++++++++---------- lisp/play/mpuz.el | 16 ++++++++-- lisp/play/solitaire.el | 18 ++++++++++-- lisp/play/spook.el | 19 ++++++++---- lisp/play/yow.el | 11 +++++-- 11 files changed, 222 insertions(+), 81 deletions(-) diff --git a/lisp/play/bruce.el b/lisp/play/bruce.el index 46fa59bdec9..d54a49981c0 100644 --- a/lisp/play/bruce.el +++ b/lisp/play/bruce.el @@ -106,11 +106,20 @@ (require 'cookie1) ; Variables -(defvar bruce-phrases-file "~/bruce.lines" - "Keep your favorite phrases here.") - -(defvar bruce-phrase-default-count 15 - "Default number of phrases to insert") +(defgroup bruce nil + "Insert phrases selected at random from a file into a buffer." + :prefix "bruce-" + :group 'games) + +(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 () diff --git a/lisp/play/decipher.el b/lisp/play/decipher.el index 307ac0d1732..b880ddb29fb 100644 --- a/lisp/play/decipher.el +++ b/lisp/play/decipher.el @@ -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 ;;-------------------------------------------------------------------- diff --git a/lisp/play/dunnet.el b/lisp/play/dunnet.el index a3f43ef0a03..58e06fd2348 100644 --- a/lisp/play/dunnet.el +++ b/lisp/play/dunnet.el @@ -33,9 +33,15 @@ ;;; The log file should be set for your system, and it must ;;; be writable by all. - -(defvar dun-log-file "/usr/local/dunnet.score" - "Name of file to store score information for dunnet.") +(defgroup dunnet nil + "Text adventure for Emacs." + :prefix "dun-" + :group 'games) + +(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))) diff --git a/lisp/play/gametree.el b/lisp/play/gametree.el index 40cd2bfd207..17a192d9794 100644 --- a/lisp/play/gametree.el +++ b/lisp/play/gametree.el @@ -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 \".\".") +numbers of moves by White (if considered in isolation) by the dot \".\"." + :type 'regexp + :group 'gametree) -(defvar gametree-half-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.") +Has to contain \"%d\" to output the actual number." + :type 'string + :group 'gametree) -(defvar gametree-full-ply-format "%d." +(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. diff --git a/lisp/play/gomoku.el b/lisp/play/gomoku.el index 73cbcc0307d..d1a1ff890cf 100644 --- a/lisp/play/gomoku.el +++ b/lisp/play/gomoku.el @@ -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) diff --git a/lisp/play/handwrite.el b/lisp/play/handwrite.el index 1a0fabfb9f9..758293acf74 100644 --- a/lisp/play/handwrite.el +++ b/lisp/play/handwrite.el @@ -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 diff --git a/lisp/play/landmark.el b/lisp/play/landmark.el index 2fd7d9d79f1..e8bb833825b 100644 --- a/lisp/play/landmark.el +++ b/lisp/play/landmark.el @@ -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 @@ this program to add a random element to the way moves were made.") ;;;(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 @@ because it is overwritten by \"One moment please\".") (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 diff --git a/lisp/play/mpuz.el b/lisp/play/mpuz.el index e08a274b851..8f0f2f688e4 100644 --- a/lisp/play/mpuz.el +++ b/lisp/play/mpuz.el @@ -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.") diff --git a/lisp/play/solitaire.el b/lisp/play/solitaire.el index c3a4b4ff114..812d0a8d6a8 100644 --- a/lisp/play/solitaire.el +++ b/lisp/play/solitaire.el @@ -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 @@ The usual mnemonic keys move the cursor around the board; in addition, (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 around the board using the cursor keys. 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? diff --git a/lisp/play/spook.el b/lisp/play/spook.el index 8d8f8229d5b..527bdda94f0 100644 --- a/lisp/play/spook.el +++ b/lisp/play/spook.el @@ -40,11 +40,20 @@ (require 'cookie1) ; Variables -(defvar spook-phrases-file (concat data-directory "spook.lines") - "Keep your favorite phrases here.") - -(defvar spook-phrase-default-count 15 - "Default number of phrases to insert") +(defgroup spook nil + "Spook phrase utility for overloading the NSA line eater." + :prefix "spook-" + :group 'games) + +(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 () diff --git a/lisp/play/yow.el b/lisp/play/yow.el index 501758e94a4..42a421f2b6b 100644 --- a/lisp/play/yow.el +++ b/lisp/play/yow.el @@ -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!!") -- 2.39.2