From fcad51995cb19634708db88b2efcbed581be979f Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sat, 12 Apr 1997 04:15:03 +0000 Subject: [PATCH] Add defgroup's; use defcustom for user vars. --- lisp/add-log.el | 43 ++++++--- lisp/emacs-lisp/cl-indent.el | 23 +++-- lisp/progmodes/f90.el | 110 +++++++++++++++-------- lisp/progmodes/fortran.el | 164 ++++++++++++++++++++++++----------- 4 files changed, 236 insertions(+), 104 deletions(-) diff --git a/lisp/add-log.el b/lisp/add-log.el index ef0e83dbca..4dbea70094 100644 --- a/lisp/add-log.el +++ b/lisp/add-log.el @@ -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 @@ Prefix arg means justify as well." (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 () diff --git a/lisp/emacs-lisp/cl-indent.el b/lisp/emacs-lisp/cl-indent.el index 8d199c1445..9e179432de 100644 --- a/lisp/emacs-lisp/cl-indent.el +++ b/lisp/emacs-lisp/cl-indent.el @@ -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 indentation is relative to the indentation of the parenthesis enclosing 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 diff --git a/lisp/progmodes/f90.el b/lisp/progmodes/f90.el index ada277ffc0..0fd525b07b 100644 --- a/lisp/progmodes/f90.el +++ b/lisp/progmodes/f90.el @@ -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 ;; 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.") -(defvar f90-if-indent 3 - "*Extra indentation applied to IF, SELECT CASE, WHERE and FORALL blocks.") +(defgroup f90 nil + "Fortran-90 mode" + :group 'fortran) -(defvar f90-type-indent 3 - "*Extra indentation applied to TYPE, INTERFACE and BLOCK DATA blocks.") +(defgroup f90-indent nil + "Fortran-90 indentation" + :prefix "f90-" + :group 'f90) -(defvar f90-program-indent 2 - "*Extra indentation applied to PROGRAM/MODULE/SUBROUTINE/FUNCTION blocks.") -(defvar f90-continuation-indent 5 - "*Extra indentation applied to F90 continuation lines.") +(defcustom f90-do-indent 3 + "*Extra indentation applied to DO blocks." + :type 'integer + :group 'f90-indent) -(defvar f90-comment-region "!!$" - "*String inserted by \\[f90-comment-region]\ - at start of each line in region.") +(defcustom f90-if-indent 3 + "*Extra indentation applied to IF, SELECT CASE, WHERE and FORALL blocks." + :type 'integer + :group 'f90-indent) -(defvar f90-indented-comment-re "!" - "*Regexp saying which comments to be indented like code.") +(defcustom f90-type-indent 3 + "*Extra indentation applied to TYPE, INTERFACE and BLOCK DATA blocks." + :type 'integer + :group 'f90-indent) -(defvar f90-directive-comment-re "!hpf\\$" - "*Regexp of comment-like directive like \"!HPF\\\\$\", not to be indented.") +(defcustom f90-program-indent 2 + "*Extra indentation applied to PROGRAM/MODULE/SUBROUTINE/FUNCTION blocks." + :type 'integer + :group 'f90-indent) -(defvar f90-beginning-ampersand t - "*t makes automatic insertion of \& at beginning of continuation line.") +(defcustom f90-continuation-indent 5 + "*Extra indentation applied to F90 continuation lines." + :type 'integer + :group 'f90-indent) -(defvar f90-smart-end 'blink +(defcustom f90-comment-region "!!$" + "*String inserted by \\[f90-comment-region]\ + at start of each line in region." + :type 'string + :group 'f90-indent) + +(defcustom f90-indented-comment-re "!" + "*Regexp saying which comments to be indented like code." + :type 'regexp + :group 'f90-indent) + +(defcustom f90-directive-comment-re "!hpf\\$" + "*Regexp of comment-like directive like \"!HPF\\\\$\", not to be indented." + :type 'regexp + :group 'f90-indent) + +(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") - -(defvar f90-leave-line-no nil - "*If nil, left-justify linenumbers.") - -(defvar f90-startup-message t - "*Non-nil displays a startup message when F90 mode is first called.") + 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) + +(defcustom f90-leave-line-no nil + "*If nil, left-justify linenumbers." + :type 'boolean + :group 'f90) + +(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" diff --git a/lisp/progmodes/fortran.el b/lisp/progmodes/fortran.el index 1c255b12a8..bf79414dd7 100644 --- a/lisp/progmodes/fortran.el +++ b/lisp/progmodes/fortran.el @@ -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 ;; 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.") - -(defvar fortran-do-indent 3 - "*Extra indentation applied to DO blocks.") - -(defvar fortran-if-indent 3 - "*Extra indentation applied to IF blocks.") - -(defvar fortran-structure-indent 3 - "*Extra indentation applied to STRUCTURE, UNION, MAP and INTERFACE blocks.") - -(defvar fortran-continuation-indent 5 - "*Extra indentation applied to Fortran continuation lines.") - -(defvar fortran-comment-indent-style 'fixed +(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) + +(defcustom fortran-do-indent 3 + "*Extra indentation applied to DO blocks." + :type 'integer + :group 'fortran-indent) + +(defcustom fortran-if-indent 3 + "*Extra indentation applied to IF blocks." + :type 'integer + :group 'fortran-indent) + +(defcustom fortran-structure-indent 3 + "*Extra indentation applied to STRUCTURE, UNION, MAP and INTERFACE blocks." + :type 'integer + :group 'fortran-indent) + +(defcustom fortran-continuation-indent 5 + "*Extra indentation applied to Fortran continuation lines." + :type 'integer + :group 'fortran-indent) + +(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'.") - -(defvar fortran-comment-line-extra-indent 0 - "*Amount of extra indentation for text within full-line comments.") - -(defvar comment-line-start nil - "*Delimiter inserted to start new full-line comment.") - -(defvar comment-line-start-skip nil - "*Regexp to match the start of a full-line comment.") - -(defvar fortran-minimum-statement-indent-fixed 6 - "*Minimum statement indentation for fixed format continuation style.") - -(defvar fortran-minimum-statement-indent-tab (max tab-width 6) - "*Minimum statement indentation for TAB format continuation style.") +Fortran indentation plus `fortran-comment-line-extra-indent'." + :type '(radio (const nil) (const fixed) (const relative)) + :group 'fortran-indent) + +(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) + +(defcustom comment-line-start nil + "*Delimiter inserted to start new full-line comment." + :type '(choice string (const nil)) + :group 'fortran-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) + +(defcustom fortran-minimum-statement-indent-fixed 6 + "*Minimum statement indentation for fixed format continuation style." + :type 'integer + :group 'fortran-indent) + +(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 @@ This variable used in TAB format mode.") "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 () -- 2.20.1