changeset 17413:9fa0ed8da0b1

Add defgroup's; use defcustom for user vars.
author Richard M. Stallman <rms@gnu.org>
date Sat, 12 Apr 1997 04:15:03 +0000
parents cd7152c1ca13
children f967f12c8ec8
files lisp/add-log.el lisp/emacs-lisp/cl-indent.el lisp/progmodes/f90.el lisp/progmodes/fortran.el
diffstat 4 files changed, 224 insertions(+), 92 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/add-log.el	Sat Apr 12 03:22:41 1997 +0000
+++ b/lisp/add-log.el	Sat Apr 12 04:15:03 1997 +0000
@@ -1,6 +1,6 @@
 ;;; add-log.el --- change log maintenance commands for Emacs
 
-;; Copyright (C) 1985, 1986, 1988, 1993, 1994 Free Software Foundation, Inc.
+;; Copyright (C) 1985, 86, 88, 93, 94, 1997 Free Software Foundation, Inc.
 
 ;; Keywords: maint
 
@@ -27,24 +27,43 @@
 
 ;;; Code:
 
-(defvar change-log-default-name nil
-  "*Name of a change log file for \\[add-change-log-entry].")
+(defgroup change-log nil
+  "Change log maintenance"
+  :group 'tools
+  :prefix "change-log-"
+  :prefix "add-log-")
+
 
-(defvar add-log-current-defun-function nil
+(defcustom change-log-default-name nil
+  "*Name of a change log file for \\[add-change-log-entry]."
+  :type '(choice (const :tag "default" nil)
+		 string)
+  :group 'change-log)
+
+(defcustom add-log-current-defun-function nil
   "\
 *If non-nil, function to guess name of current function from surrounding text.
 \\[add-change-log-entry] calls this function (if nil, `add-log-current-defun'
-instead) with no arguments.  It returns a string or nil if it cannot guess.")
+instead) with no arguments.  It returns a string or nil if it cannot guess."
+  :type 'boolean
+  :group 'change-log)
 
 ;;;###autoload
-(defvar add-log-full-name nil
+(defcustom add-log-full-name nil
   "*Full name of user, for inclusion in ChangeLog daily headers.
-This defaults to the value returned by the `user-full-name' function.")
+This defaults to the value returned by the `user-full-name' function."
+  :type '(choice (const :tag "Default" nil)
+		 string)
+  :group 'change-log)
 
 ;;;###autoload
-(defvar add-log-mailing-address nil
+(defcustom add-log-mailing-address nil
   "*Electronic mail address of user, for inclusion in ChangeLog daily headers.
-This defaults to the value of `user-mail-address'.")
+This defaults to the value of `user-mail-address'."
+  :type '(choice (const :tag "Default" nil)
+		 string)
+  :group 'change-log)
+
 
 (defvar change-log-font-lock-keywords
   '(;;
@@ -361,9 +380,11 @@
     (fill-region beg end justify)
     t))
 
-(defvar add-log-current-defun-header-regexp
+(defcustom add-log-current-defun-header-regexp
   "^\\([A-Z][A-Z_ ]*[A-Z_]\\|[-_a-zA-Z]+\\)[ \t]*[:=]"
-  "*Heuristic regexp used by `add-log-current-defun' for unknown major modes.")
+  "*Heuristic regexp used by `add-log-current-defun' for unknown major modes."
+  :type 'regexp
+  :group 'change-log)
 
 ;;;###autoload
 (defun add-log-current-defun ()
--- a/lisp/emacs-lisp/cl-indent.el	Sat Apr 12 03:22:41 1997 +0000
+++ b/lisp/emacs-lisp/cl-indent.el	Sat Apr 12 04:15:03 1997 +0000
@@ -48,16 +48,25 @@
 
 ;;; Code:
 
-(defvar lisp-indent-maximum-backtracking 3
+(defgroup lisp-indent nil
+  "Indentation in Lisp"
+  :group 'lisp)
+
+
+(defcustom lisp-indent-maximum-backtracking 3
   "*Maximum depth to backtrack out from a sublist for structured indentation.
 If this variable is  0, no backtracking will occur and forms such as flet
-may not be correctly indented.")
+may not be correctly indented."
+  :type 'integer
+  :group 'lisp-indent)
 
-(defvar lisp-tag-indentation 1
+(defcustom lisp-tag-indentation 1
   "*Indentation of tags relative to containing list.
-This variable is used by the function `lisp-indent-tagbody'.")
+This variable is used by the function `lisp-indent-tagbody'."
+  :type 'integer
+  :group 'lisp-indent)
 
-(defvar lisp-tag-body-indentation 3
+(defcustom lisp-tag-body-indentation 3
   "*Indentation of non-tagged lines relative to containing list.
 This variable is used by the function `lisp-indent-tagbody' to indent normal
 lines (lines without tags).
@@ -65,7 +74,9 @@
 the special form.  If the value is t, the body of tags will be indented
 as a block at the same indentation as the first s-expression following
 the tag.  In this case, any forms before the first tag are indented
-by `lisp-body-indent'.")
+by `lisp-body-indent'."
+  :type 'integer
+  :group 'lisp-indent)
 
 
 ;;;###autoload
--- a/lisp/progmodes/f90.el	Sat Apr 12 03:22:41 1997 +0000
+++ b/lisp/progmodes/f90.el	Sat Apr 12 04:15:03 1997 +0000
@@ -1,6 +1,6 @@
 ;;; f90.el --- Fortran-90 mode (free format)
 
-;; Copyright (C) 1995, 1996 Free Software Foundation, Inc.
+;; Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
 
 ;; Author: Torbj\"orn Einarsson <T.Einarsson@clab.ericsson.se>
 ;; Last Change: Oct. 14, 1996
@@ -148,54 +148,96 @@
   "Address of mailing list for F90 mode bugs.")
 
 ;; User options
-(defvar f90-do-indent 3
-  "*Extra indentation applied to DO blocks.")
+
+(defgroup f90 nil
+  "Fortran-90 mode"
+  :group 'fortran)
 
-(defvar f90-if-indent 3
-  "*Extra indentation applied to IF, SELECT CASE, WHERE and FORALL blocks.")
+(defgroup f90-indent nil
+  "Fortran-90 indentation"
+  :prefix "f90-"
+  :group 'f90)
+
 
-(defvar f90-type-indent 3
-  "*Extra indentation applied to TYPE, INTERFACE and BLOCK DATA blocks.")
+(defcustom f90-do-indent 3
+  "*Extra indentation applied to DO blocks."
+  :type 'integer
+  :group 'f90-indent)
 
-(defvar f90-program-indent 2
-  "*Extra indentation applied to PROGRAM/MODULE/SUBROUTINE/FUNCTION blocks.")
+(defcustom f90-if-indent 3
+  "*Extra indentation applied to IF, SELECT CASE, WHERE and FORALL blocks."
+  :type 'integer
+  :group 'f90-indent)
 
-(defvar f90-continuation-indent 5
-  "*Extra indentation applied to F90 continuation lines.")
+(defcustom f90-type-indent 3
+  "*Extra indentation applied to TYPE, INTERFACE and BLOCK DATA blocks."
+  :type 'integer
+  :group 'f90-indent)
 
-(defvar f90-comment-region "!!$"
+(defcustom f90-program-indent 2
+  "*Extra indentation applied to PROGRAM/MODULE/SUBROUTINE/FUNCTION blocks."
+  :type 'integer
+  :group 'f90-indent)
+
+(defcustom f90-continuation-indent 5
+  "*Extra indentation applied to F90 continuation lines."
+  :type 'integer
+  :group 'f90-indent)
+
+(defcustom f90-comment-region "!!$"
   "*String inserted by \\[f90-comment-region]\
- at start of each line in region.")
-
-(defvar f90-indented-comment-re "!"
-  "*Regexp saying which comments to be indented like code.")
+ at start of each line in region."
+  :type 'string
+  :group 'f90-indent)
 
-(defvar f90-directive-comment-re "!hpf\\$"
-  "*Regexp of comment-like directive like \"!HPF\\\\$\", not to be indented.")
+(defcustom f90-indented-comment-re "!"
+  "*Regexp saying which comments to be indented like code."
+  :type 'regexp
+  :group 'f90-indent)
 
-(defvar f90-beginning-ampersand t
-  "*t makes automatic insertion of \& at beginning of continuation line.")
+(defcustom f90-directive-comment-re "!hpf\\$"
+  "*Regexp of comment-like directive like \"!HPF\\\\$\", not to be indented."
+  :type 'regexp
+  :group 'f90-indent)
 
-(defvar f90-smart-end 'blink
+(defcustom f90-beginning-ampersand t
+  "*t makes automatic insertion of \& at beginning of continuation line."
+  :type 'boolean
+  :group 'f90)
+
+(defcustom f90-smart-end 'blink
   "*From an END statement, check and fill the end using matching block start.
 Allowed values are 'blink, 'no-blink, and nil, which determine
-whether to blink the matching beginning.")
+whether to blink the matching beginning."
+  :type '(choice (const blink) (const no-blink) (const nil))
+  :group 'f90)
 
-(defvar f90-break-delimiters "[-+\\*/><=,% \t]"
-  "*Regexp holding list of delimiters at which lines may be broken.")
+(defcustom f90-break-delimiters "[-+\\*/><=,% \t]"
+  "*Regexp holding list of delimiters at which lines may be broken."
+  :type 'regexp
+  :group 'f90)
 
-(defvar f90-break-before-delimiters t
-  "*Non-nil causes `f90-do-auto-fill' to break lines before delimiters.")
+(defcustom f90-break-before-delimiters t
+  "*Non-nil causes `f90-do-auto-fill' to break lines before delimiters."
+  :type 'regexp
+  :group 'f90)
 
-(defvar f90-auto-keyword-case nil
+(defcustom f90-auto-keyword-case nil
   "*Automatic case conversion of keywords.
-  The options are 'downcase-word, 'upcase-word, 'capitalize-word and nil")
+  The options are 'downcase-word, 'upcase-word, 'capitalize-word and nil"
+  :type '(choice (const downcase-word) (const upcase-word)
+		 (const capitalize-word) (const nil))
+  :group 'f90)
 
-(defvar f90-leave-line-no nil
-  "*If nil, left-justify linenumbers.")
+(defcustom f90-leave-line-no nil
+  "*If nil, left-justify linenumbers."
+  :type 'boolean
+  :group 'f90)
 
-(defvar f90-startup-message t
-  "*Non-nil displays a startup message when F90 mode is first called.")
+(defcustom f90-startup-message t
+  "*Non-nil displays a startup message when F90 mode is first called."
+  :type 'boolean
+  :group 'f90)
 
 (defconst f90-keywords-re
   ;;("allocate" "allocatable" "assign" "assignment" "backspace" "block"
--- a/lisp/progmodes/fortran.el	Sat Apr 12 03:22:41 1997 +0000
+++ b/lisp/progmodes/fortran.el	Sat Apr 12 04:15:03 1997 +0000
@@ -1,6 +1,6 @@
 ;;; fortran.el --- Fortran mode for GNU Emacs
 
-;; Copyright (c) 1986, 1993, 1994, 1995 Free Software Foundation, Inc.
+;; Copyright (c) 1986, 1993, 1994, 1995, 1997 Free Software Foundation, Inc.
 
 ;; Author: Michael D. Prange <prange@erl.mit.edu>
 ;; Maintainer: bug-fortran-mode@erl.mit.edu (Steve Gildea and others)
@@ -51,88 +51,144 @@
 
 (defconst fortran-mode-version "version 1.30.6")
 
+(defgroup fortran nil
+  "Fortran mode for Emacs"
+  :group 'languages)
+
+(defgroup fortran-indent nil
+  "Indentation variables in Fortran mode"
+  :prefix "fortran-"
+  :group 'fortran)
+
+(defgroup fortran-comment nil
+  "Comment-handling variables in Fortran mode"
+  :prefix "fortran-"
+  :group 'fortran)
+
+
 ;;;###autoload
-(defvar fortran-tab-mode-default nil
+(defcustom fortran-tab-mode-default nil
   "*Default tabbing/carriage control style for empty files in Fortran mode.
 A value of t specifies tab-digit style of continuation control.
 A value of nil specifies that continuation lines are marked
-with a character in column 6.")
+with a character in column 6."
+  :type 'boolean
+  :group 'fortran-indent)
 
 ;; Buffer local, used to display mode line.
-(defvar fortran-tab-mode-string nil
-  "String to appear in mode line when TAB format mode is on.")
+(defcustom fortran-tab-mode-string nil
+  "String to appear in mode line when TAB format mode is on."
+  :type '(choice (const nil) string)
+  :group 'fortran-indent)
 
-(defvar fortran-do-indent 3
-  "*Extra indentation applied to DO blocks.")
+(defcustom fortran-do-indent 3
+  "*Extra indentation applied to DO blocks."
+  :type 'integer
+  :group 'fortran-indent)
 
-(defvar fortran-if-indent 3
-  "*Extra indentation applied to IF blocks.")
+(defcustom fortran-if-indent 3
+  "*Extra indentation applied to IF blocks."
+  :type 'integer
+  :group 'fortran-indent)
 
-(defvar fortran-structure-indent 3
-  "*Extra indentation applied to STRUCTURE, UNION, MAP and INTERFACE blocks.")
+(defcustom fortran-structure-indent 3
+  "*Extra indentation applied to STRUCTURE, UNION, MAP and INTERFACE blocks."
+  :type 'integer
+  :group 'fortran-indent)
 
-(defvar fortran-continuation-indent 5
-  "*Extra indentation applied to Fortran continuation lines.")
+(defcustom fortran-continuation-indent 5
+  "*Extra indentation applied to Fortran continuation lines."
+  :type 'integer
+  :group 'fortran-indent)
 
-(defvar fortran-comment-indent-style 'fixed
+(defcustom fortran-comment-indent-style 'fixed
   "*nil forces comment lines not to be touched,
 'fixed makes fixed comment indentation to `fortran-comment-line-extra-indent'
 columns beyond `fortran-minimum-statement-indent-fixed' (for
 `indent-tabs-mode' of nil) or `fortran-minimum-statement-indent-tab' (for
 `indent-tabs-mode' of t), and 'relative indents to current
-Fortran indentation plus `fortran-comment-line-extra-indent'.")
+Fortran indentation plus `fortran-comment-line-extra-indent'."
+  :type '(radio (const nil) (const fixed) (const relative))
+  :group 'fortran-indent)
 
-(defvar fortran-comment-line-extra-indent 0
-  "*Amount of extra indentation for text within full-line comments.")
+(defcustom fortran-comment-line-extra-indent 0
+  "*Amount of extra indentation for text within full-line comments."
+  :type 'integer
+  :group 'fortran-indent
+  :group 'fortran-comment)
 
-(defvar comment-line-start nil
-  "*Delimiter inserted to start new full-line comment.")
+(defcustom comment-line-start nil
+  "*Delimiter inserted to start new full-line comment."
+  :type '(choice string (const nil))
+  :group 'fortran-comment)
 
-(defvar comment-line-start-skip nil
-  "*Regexp to match the start of a full-line comment.")
+(defcustom comment-line-start-skip nil
+  "*Regexp to match the start of a full-line comment."
+  :type '(choice string (const nil))
+  :group 'fortran-comment)
 
-(defvar fortran-minimum-statement-indent-fixed 6
-  "*Minimum statement indentation for fixed format continuation style.")
+(defcustom fortran-minimum-statement-indent-fixed 6
+  "*Minimum statement indentation for fixed format continuation style."
+  :type 'integer
+  :group 'fortran-indent)
 
-(defvar fortran-minimum-statement-indent-tab (max tab-width 6)
-  "*Minimum statement indentation for TAB format continuation style.")
+(defcustom fortran-minimum-statement-indent-tab (max tab-width 6)
+  "*Minimum statement indentation for TAB format continuation style."
+  :type 'integer
+  :group 'fortran-indent)
 
 ;; Note that this is documented in the v18 manuals as being a string
 ;; of length one rather than a single character.
 ;; The code in this file accepts either format for compatibility.
-(defvar fortran-comment-indent-char " "
+(defcustom fortran-comment-indent-char " "
   "*Single-character string inserted for Fortran comment indentation.
-Normally a space.")
+Normally a space."
+  :type 'string
+  :group 'fortran-comment)
 
-(defvar fortran-line-number-indent 1
+(defcustom fortran-line-number-indent 1
   "*Maximum indentation for Fortran line numbers.
-5 means right-justify them within their five-column field.")
+5 means right-justify them within their five-column field."
+  :type 'integer
+  :group 'fortran-indent)
 
-(defvar fortran-check-all-num-for-matching-do nil
-  "*Non-nil causes all numbered lines to be treated as possible DO loop ends.")
+(defcustom fortran-check-all-num-for-matching-do nil
+  "*Non-nil causes all numbered lines to be treated as possible DO loop ends."
+  :type 'boolean
+  :group 'fortran)
 
-(defvar fortran-blink-matching-if nil
+(defcustom fortran-blink-matching-if nil
   "*Non-nil causes \\[fortran-indent-line] on ENDIF statement to blink on matching IF.
-Also, from an ENDDO statement blink on matching DO [WHILE] statement.")
+Also, from an ENDDO statement blink on matching DO [WHILE] statement."
+  :type 'boolean
+  :group 'fortran)
 
-(defvar fortran-continuation-string "$"
+(defcustom fortran-continuation-string "$"
   "*Single-character string used for Fortran continuation lines.
 In fixed format continuation style, this character is inserted in
 column 6 by \\[fortran-split-line] to begin a continuation line.
 Also, if \\[fortran-indent-line] finds this at the beginning of a line, it will
 convert the line into a continuation line of the appropriate style.
-Normally $.")
+Normally $."
+  :type 'string
+  :group 'fortran)
 
-(defvar fortran-comment-region "c$$$"
+(defcustom fortran-comment-region "c$$$"
   "*String inserted by \\[fortran-comment-region]\
- at start of each line in region.")
+ at start of each line in region."
+  :type 'string
+  :group 'fortran-comment)
 
-(defvar fortran-electric-line-number t
+(defcustom fortran-electric-line-number t
   "*Non-nil causes line number digits to be moved to the correct column as\
- typed.")
+ typed."
+  :type 'boolean
+  :group 'fortran)
 
-(defvar fortran-startup-message t
-  "*Non-nil displays a startup message when Fortran mode is first called.")
+(defcustom fortran-startup-message t
+  "*Non-nil displays a startup message when Fortran mode is first called."
+  :type 'boolean
+  :group 'fortran)
 
 (defvar fortran-column-ruler-fixed
   "0   4 6  10        20        30        40        5\
@@ -160,8 +216,10 @@
   "Number of lines to scan to determine whether to use fixed or TAB format\
  style.")
 
-(defvar fortran-break-before-delimiters t
-  "*Non-nil causes `fortran-fill' to break lines before delimiters.")
+(defcustom fortran-break-before-delimiters t
+  "*Non-nil causes `fortran-fill' to break lines before delimiters."
+  :type 'boolean
+  :group 'fortran)
 
 (if fortran-mode-syntax-table
     ()