From c5292bc831ae97cd0d99234c039c9309c05af2a6 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sat, 12 Apr 1997 08:35:41 +0000 Subject: [PATCH] Add defgroup's; use defcustom for user vars. --- lisp/emacs-lisp/edebug.el | 131 +++++++++++++++++++++++++------------- lisp/lpr.el | 47 ++++++++++---- lisp/progmodes/prolog.el | 40 ++++++++---- lisp/rcompile.el | 41 ++++++++---- lisp/uniquify.el | 47 ++++++++++---- 5 files changed, 211 insertions(+), 95 deletions(-) diff --git a/lisp/emacs-lisp/edebug.el b/lisp/emacs-lisp/edebug.el index f6831f6f29..b1c97b2404 100644 --- a/lisp/emacs-lisp/edebug.el +++ b/lisp/emacs-lisp/edebug.el @@ -1,6 +1,7 @@ ;;; edebug.el --- a source-level debugger for Emacs Lisp -;; Copyright (C) 1988,'89,'90,'91,'92,'93,'94,'95 Free Software Foundation, Inc +;; Copyright (C) 1988,'89,'90,'91,'92,'93,'94,'95,'97 +;; Free Software Foundation, Inc ;; Author: Daniel LaLiberte ;; Keywords: lisp, tools, maint @@ -8,7 +9,7 @@ ;; LCD Archive Entry: ;; edebug|Daniel LaLiberte|liberte@cs.uiuc.edu ;; |A source level debugger for Emacs Lisp. -;; |$Date: 1996/11/09 21:48:07 $|$Revision: 3.12 $|~/modes/edebug.el| +;; |$Date: 1996/12/26 20:46:51 $|$Revision: 3.13 $|~/modes/edebug.el| ;; This file is part of GNU Emacs. @@ -85,7 +86,7 @@ ;;; Code: (defconst edebug-version - (let ((raw-version "$Revision: 3.12 $")) + (let ((raw-version "$Revision: 3.13 $")) (substring raw-version (string-match "[0-9.]*" raw-version) (match-end 0)))) @@ -126,14 +127,21 @@ ;;; Options -(defvar edebug-setup-hook nil +(defgroup edebug nil + "A source-level debugger for Emacs Lisp" + :group 'lisp) + + +(defcustom edebug-setup-hook nil "*Functions to call before edebug is used. Each time it is set to a new value, Edebug will call those functions once and then `edebug-setup-hook' is reset to nil. You could use this to load up Edebug specifications associated with a package you are -using but only when you also use Edebug.") +using but only when you also use Edebug." + :type 'hook + :group 'edebug) -(defvar edebug-all-defs nil +(defcustom edebug-all-defs nil "*If non-nil, evaluation of any defining forms will instrument for Edebug. This applies to `eval-defun', `eval-region', `eval-buffer', and `eval-current-buffer'. `eval-region' is also called by @@ -142,14 +150,18 @@ This applies to `eval-defun', `eval-region', `eval-buffer', and You can use the command `edebug-all-defs' to toggle the value of this variable. You may wish to make it local to each buffer with \(make-local-variable 'edebug-all-defs) in your -`emacs-lisp-mode-hook'.") +`emacs-lisp-mode-hook'." + :type 'boolean + :group 'edebug) -(defvar edebug-all-forms nil +(defcustom edebug-all-forms nil "*Non-nil evaluation of all forms will instrument for Edebug. This doesn't apply to loading or evaluations in the minibuffer. -Use the command `edebug-all-forms' to toggle the value of this option.") +Use the command `edebug-all-forms' to toggle the value of this option." + :type 'boolean + :group 'edebug) -(defvar edebug-eval-macro-args nil +(defcustom edebug-eval-macro-args nil "*Non-nil means all macro call arguments may be evaluated. If this variable is nil, the default, Edebug will *not* wrap macro call arguments as if they will be evaluated. @@ -157,15 +169,19 @@ For each macro, a `edebug-form-spec' overrides this option. So to specify exceptions for macros that have some arguments evaluated and some not, you should specify an `edebug-form-spec'. -This option is going away soon.") +This option is going away soon." + :type 'boolean + :group 'edebug) -(defvar edebug-stop-before-symbols nil +(defcustom edebug-stop-before-symbols nil "*Non-nil causes Edebug to stop before symbols as well as after. In any case, a breakpoint or interrupt may stop before a symbol. -This option is going away soon.") +This option is going away soon." + :type 'boolean + :group 'edebug) -(defvar edebug-save-windows t +(defcustom edebug-save-windows t "*If non-nil, Edebug saves and restores the window configuration. That takes some time, so if your program does not care what happens to the window configurations, it is better to set this variable to nil. @@ -173,9 +189,11 @@ the window configurations, it is better to set this variable to nil. If the value is a list, only the listed windows are saved and restored. -`edebug-toggle-save-windows' may be used to change this variable.") +`edebug-toggle-save-windows' may be used to change this variable." + :type '(choice boolean (repeat string)) + :group 'edebug) -(defvar edebug-save-displayed-buffer-points nil +(defcustom edebug-save-displayed-buffer-points nil "*If non-nil, save and restore point in all displayed buffers. Saving and restoring point in other buffers is necessary if you are @@ -185,50 +203,71 @@ window, the buffer's point will be changed to the window's point. Saving and restoring point in all buffers is expensive, since it requires selecting each window twice, so enable this only if you need -it.") +it." + :type 'boolean + :group 'edebug) -(defvar edebug-initial-mode 'step +(defcustom edebug-initial-mode 'step "*Initial execution mode for Edebug, if non-nil. If this variable is non-@code{nil}, it specifies the initial execution mode for Edebug when it is first activated. Possible values are step, next, go, -Go-nonstop, trace, Trace-fast, continue, and Continue-fast.") - -(defvar edebug-trace nil +Go-nonstop, trace, Trace-fast, continue, and Continue-fast." + :type '(choice (const step) (const next) (const go) + (const Go-nonstop) (const trace) + (const Trace-fast) (const continue) + (const continue-fast)) + :group 'edebug) + +(defcustom edebug-trace nil "*Non-nil means display a trace of function entry and exit. Tracing output is displayed in a buffer named `*edebug-trace*', one function entry or exit per line, indented by the recursion level. You can customize by replacing functions `edebug-print-trace-before' -and `edebug-print-trace-after'.") +and `edebug-print-trace-after'." + :type 'boolean + :group 'edebug) -(defvar edebug-test-coverage nil +(defcustom edebug-test-coverage nil "*If non-nil, Edebug tests coverage of all expressions debugged. This is done by comparing the result of each expression with the previous result. Coverage is considered OK if two different results are found. Use `edebug-display-freq-count' to display the frequency count and -coverage information for a definition.") +coverage information for a definition." + :type 'boolean + :group 'edebug) -(defvar edebug-continue-kbd-macro nil +(defcustom edebug-continue-kbd-macro nil "*If non-nil, continue defining or executing any keyboard macro. -Use this with caution since it is not debugged.") - - -(defvar edebug-print-length 50 - "*Default value of `print-length' to use while printing results in Edebug.") -(defvar edebug-print-level 50 - "*Default value of `print-level' to use while printing results in Edebug.") -(defvar edebug-print-circle t - "*Default value of `print-circle' to use while printing results in Edebug.") - -(defvar edebug-unwrap-results nil +Use this with caution since it is not debugged." + :type 'boolean + :group 'edebug) + + +(defcustom edebug-print-length 50 + "*Default value of `print-length' to use while printing results in Edebug." + :type 'integer + :group 'edebug) +(defcustom edebug-print-level 50 + "*Default value of `print-level' to use while printing results in Edebug." + :type 'integer + :group 'edebug) +(defcustom edebug-print-circle t + "*Default value of `print-circle' to use while printing results in Edebug." + :type 'boolean + :group 'edebug) + +(defcustom edebug-unwrap-results nil "*Non-nil if Edebug should unwrap results of expressions. This is useful when debugging macros where the results of expressions are instrumented expressions. But don't do this when results might be -circular or an infinite loop will result.") +circular or an infinite loop will result." + :type 'boolean + :group 'edebug) -(defvar edebug-on-error t +(defcustom edebug-on-error t "*Value bound to `debug-on-error' while Edebug is active. If `debug-on-error' is non-nil, that value is still used. @@ -237,14 +276,20 @@ If the value is a list of signal names, Edebug will stop when any of these errors are signaled from Lisp code whether or not the signal is handled by a `condition-case'. This option is useful for debugging signals that *are* handled since they would otherwise be missed. -After execution is resumed, the error is signaled again.") +After execution is resumed, the error is signaled again." + :type '(choice boolean (repeat string)) + :group 'edebug) -(defvar edebug-on-quit t - "*Value bound to `debug-on-quit' while Edebug is active.") +(defcustom edebug-on-quit t + "*Value bound to `debug-on-quit' while Edebug is active." + :type 'boolean + :group 'edebug) -(defvar edebug-global-break-condition nil +(defcustom edebug-global-break-condition nil "*If non-nil, an expression to test for at every stop point. -If the result is non-nil, then break. Errors are ignored.") +If the result is non-nil, then break. Errors are ignored." + :type 'sexp + :group 'edebug) ;;; Form spec utilities. diff --git a/lisp/lpr.el b/lisp/lpr.el index 3495619364..e219e4bfa2 100644 --- a/lisp/lpr.el +++ b/lisp/lpr.el @@ -30,40 +30,59 @@ ;;; Code: +(defgroup lpr nil + "Print Emacs buffer on line printer" + :group 'wp) + + ;;;###autoload -(defvar lpr-switches nil +(defcustom lpr-switches nil "*List of strings to pass as extra options for the printer program. -See `lpr-command'.") +See `lpr-command'." + :type '(repeat (string :tag "Argument")) + :group 'lpr) -(defvar lpr-add-switches (eq system-type 'berkeley-unix) +(defcustom lpr-add-switches (eq system-type 'berkeley-unix) "*Non-nil means construct -T and -J options for the printer program. These are made assuming that the program is `lpr'; if you are using some other incompatible printer program, -this variable should be nil.") +this variable should be nil." + :type 'boolean + :group 'lpr) ;;;###autoload -(defvar lpr-command +(defcustom lpr-command (if (memq system-type '(usg-unix-v dgux hpux irix)) "lp" "lpr") - "*Name of program for printing a file.") + "*Name of program for printing a file." + :type 'string + :group 'lpr) ;; Default is nil, because that enables us to use pr -f ;; which is more reliable than pr with no args, which is what lpr -p does. -(defvar lpr-headers-switches nil +(defcustom lpr-headers-switches nil "*List of strings of options to request page headings in the printer program. If nil, we run `lpr-page-header-program' to make page headings -and print the result.") +and print the result." + :type '(repeat (string :tag "Argument")) + :group 'lpr) -(defvar print-region-function nil +(defcustom print-region-function nil "Function to call to print the region on a printer. -See definition of `print-region-1' for calling conventions.") +See definition of `print-region-1' for calling conventions." + :type 'function + :group 'lpr) -(defvar lpr-page-header-program "pr" - "*Name of program for adding page headers to a file.") +(defcustom lpr-page-header-program "pr" + "*Name of program for adding page headers to a file." + :type 'string + :group 'lpr) -(defvar lpr-page-header-switches '("-f") +(defcustom lpr-page-header-switches '("-f") "*List of strings to use as options for the page-header-generating program. -The variable `lpr-page-header-program' specifies the program to use.") +The variable `lpr-page-header-program' specifies the program to use." + :type '(repeat string) + :group 'lpr) ;;;###autoload (defun lpr-buffer () diff --git a/lisp/progmodes/prolog.el b/lisp/progmodes/prolog.el index 05a3c7ed5a..3bb39760ec 100644 --- a/lisp/progmodes/prolog.el +++ b/lisp/progmodes/prolog.el @@ -33,21 +33,37 @@ (defvar prolog-mode-syntax-table nil) (defvar prolog-mode-abbrev-table nil) (defvar prolog-mode-map nil) - -(defvar prolog-program-name "prolog" - "*Program name for invoking an inferior Prolog with `run-prolog'.") - -(defvar prolog-consult-string "reconsult(user).\n" - "*(Re)Consult mode (for C-Prolog and Quintus Prolog). ") -(defvar prolog-compile-string "compile(user).\n" - "*Compile mode (for Quintus Prolog).") +(defgroup prolog nil + "Major mode for editing and running Prolog under Emacs" + :group 'languages) -(defvar prolog-eof-string "end_of_file.\n" + +(defcustom prolog-program-name "prolog" + "*Program name for invoking an inferior Prolog with `run-prolog'." + :type 'string + :group 'prolog) + +(defcustom prolog-consult-string "reconsult(user).\n" + "*(Re)Consult mode (for C-Prolog and Quintus Prolog). " + :type 'string + :group 'prolog) + +(defcustom prolog-compile-string "compile(user).\n" + "*Compile mode (for Quintus Prolog)." + :type 'string + :group 'prolog) + +(defcustom prolog-eof-string "end_of_file.\n" "*String that represents end of file for prolog. -nil means send actual operating system end of file.") - -(defvar prolog-indent-width 4) +nil means send actual operating system end of file." + :type 'string + :group 'prolog) + +(defcustom prolog-indent-width 4 + "Level of indentation in Prolog buffers." + :type 'integer + :group 'prolog) (if prolog-mode-syntax-table () diff --git a/lisp/rcompile.el b/lisp/rcompile.el index c2d5b3f62d..c91627160e 100644 --- a/lisp/rcompile.el +++ b/lisp/rcompile.el @@ -5,7 +5,6 @@ ;; Author: Albert ;; Maintainer: FSF ;; Created: 1993 Oct 6 -;; Version: 1.1 ;; Keywords: tools, processes ;; This file is part of GNU Emacs. @@ -70,25 +69,41 @@ ;;;; user defined variables -(defvar remote-compile-host nil - "*Host for remote compilations.") +(defgroup remote-compile nil + "Run a compilation on a remote machine" + :group 'processes + :group 'tools) -(defvar remote-compile-user nil + +(defcustom remote-compile-host nil + "*Host for remote compilations." + :type '(choice string (const nil)) + :group 'remote-compile) + +(defcustom remote-compile-user nil "User for remote compilations. -nil means use the value returned by \\[user-login-name].") +nil means use the value returned by \\[user-login-name]." + :type '(choice string (const nil)) + :group 'remote-compile) -(defvar remote-compile-run-before nil +(defcustom remote-compile-run-before nil "*Command to run before compilation. This can be used for setting up environment variables, since rsh does not invoke the shell as a login shell and files like .login \(tcsh\) and .bash_profile \(bash\) are not run. -nil means run no commands.") - -(defvar remote-compile-prompt-for-host nil - "*Non-nil means prompt for host if not available from filename.") - -(defvar remote-compile-prompt-for-user nil - "*Non-nil means prompt for user if not available from filename.") +nil means run no commands." + :type '(choice string (const nil)) + :group 'remote-compile) + +(defcustom remote-compile-prompt-for-host nil + "*Non-nil means prompt for host if not available from filename." + :type 'boolean + :group 'remote-compile) + +(defcustom remote-compile-prompt-for-user nil + "*Non-nil means prompt for user if not available from filename." + :type 'boolean + :group 'remote-compile) ;;;; internal variables diff --git a/lisp/uniquify.el b/lisp/uniquify.el index 5d2f210722..4366f8d7ab 100644 --- a/lisp/uniquify.el +++ b/lisp/uniquify.el @@ -84,7 +84,12 @@ ;;; User-visible variables -(defvar uniquify-buffer-name-style 'post-forward +(defgroup uniquify nil + "Unique buffer names dependent on file name" + :group 'applications) + + +(defcustom uniquify-buffer-name-style 'post-forward "*If non-nil, buffer names are uniquified with parts of directory name. The value determines the buffer name style and is one of `forward', `reverse', `post-forward' (the default), or `post-forward-angle-brackets'. @@ -94,33 +99,49 @@ would have the following buffer names in the various styles: reverse name\\mumble\\bar name\\mumble\\quux post-forward name|bar/mumble name|quux/mumble post-forward-angle-brackets name name - nil name name<2>") - -(defvar uniquify-after-kill-buffer-p nil + nil name name<2>" + :type '(radio (const forward) + (const reverse) + (const post-forward) + (const podt-forward-angle-brackets) + (const nil)) + :group 'uniquify) + +(defcustom uniquify-after-kill-buffer-p nil "*If non-nil, rerationalize buffer names after a buffer has been killed. This can be dangerous if Emacs Lisp code is keeping track of buffers by their -names (rather than keeping pointers to the buffers themselves).") +names (rather than keeping pointers to the buffers themselves)." + :type 'boolean + :group 'uniquify) -(defconst uniquify-ask-about-buffer-names-p nil +(defcustom uniquify-ask-about-buffer-names-p nil "*If non-nil, permit user to choose names for buffers with same base file. If the user chooses to name a buffer, uniquification is preempted and no -other buffer names are changed.") +other buffer names are changed." + :type 'boolean + :group 'uniquify) -(defvar uniquify-min-dir-content 0 - "*Minimum parts of directory name included in buffer name.") +(defcustom uniquify-min-dir-content 0 + "*Minimum parts of directory name included in buffer name." + :type 'integer + :group 'uniquify) -(defvar uniquify-separator nil +(defcustom uniquify-separator nil "*String separator for buffer name components. When `uniquify-buffer-name-style' is `post-forward', separates base file name from directory part in buffer names (default \"|\"). When `uniquify-buffer-name-style' is `reverse', separates all -file name components (default \"\\\").") +file name components (default \"\\\")." + :type '(choice (const nil) string) + :group 'uniquify) -(defvar uniquify-trailing-separator-p nil +(defcustom uniquify-trailing-separator-p nil "*If non-nil, add a file name separator to dired buffer names. If `uniquify-buffer-name-style' is `forward', add the separator at the end; if it is `reverse', add the separator at the beginning; otherwise, this -variable is ignored.") +variable is ignored." + :type 'boolean + :group 'uniquify) ;;; Utilities -- 2.39.2