From cd482e0573c6e9b4fe1be13c25d9f0f3f8626cb8 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sat, 12 Apr 1997 02:51:38 +0000 Subject: [PATCH] Add defgroup's; change use defcustom for user vars. --- lisp/progmodes/sh-script.el | 124 +++++++++++++++++++++++++++++++++----------- lisp/term.el | 60 ++++++++++++++------- lisp/textmodes/texinfo.el | 32 ++++++++---- 3 files changed, 159 insertions(+), 57 deletions(-) diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el index 1b014faf40d..782a5b32bf1 100644 --- a/lisp/progmodes/sh-script.el +++ b/lisp/progmodes/sh-script.el @@ -1,6 +1,6 @@ ;;; sh-script.el --- shell-script editing commands for Emacs -;; Copyright (C) 1993, 1994, 1995, 1996 by Free Software Foundation, Inc. +;; Copyright (C) 1993, 94, 95, 96, 1997 by Free Software Foundation, Inc. ;; Author: Daniel.Pfeiffer@Informatik.START.dbp.de, fax (+49 69) 7588-2389 ;; Version: 2.0e @@ -53,7 +53,18 @@ (defvar sh-set-shell-hook nil "*Hook run by `sh-set-shell'.") -(defvar sh-ancestor-alist +(defgroup sh nil + "Shell programming utilities" + :group 'unix + :group 'languages) + +(defgroup sh-script nil + "Shell script mode" + :group 'sh + :prefix "sh-") + + +(defcustom sh-ancestor-alist '((ash . sh) (bash . jsh) (dtksh . ksh) @@ -92,10 +103,12 @@ sh Bourne Shell zsh Z Shell oash SCO OA (curses) Shell posix IEEE 1003.2 Shell Standard - wsh ? Shell") + wsh ? Shell" + :type '(repeat (cons symbol symbol)) + :group 'sh-script) -(defvar sh-alias-alist +(defcustom sh-alias-alist (nconc (if (eq system-type 'gnu/linux) '((csh . tcsh) (ksh . pdksh))) @@ -104,10 +117,12 @@ sh Bourne Shell (sh5 . sh))) "*Alist for transforming shell names to what they really are. Use this where the name of the executable doesn't correspond to the type of -shell it really is.") +shell it really is." + :type '(repeat (cons symbol symbol)) + :group 'sh-script) -(defvar sh-shell-file +(defcustom sh-shell-file (or ;; On MSDOS and Windows, collapse $SHELL to lower-case and remove ;; the executable extension, so comparisons with the list of @@ -116,10 +131,12 @@ shell it really is.") (file-name-sans-extension (downcase (getenv "SHELL")))) (getenv "SHELL") "/bin/sh") - "*The executable file name for the shell being programmed.") + "*The executable file name for the shell being programmed." + :type 'string + :group 'sh-script) -(defvar sh-shell-arg +(defcustom sh-shell-arg ;; bash does not need any options when run in a shell script, '((bash) (csh . "-f") @@ -133,7 +150,14 @@ shell it really is.") (wksh) ;; -f means don't run .zshrc. (zsh . "-f")) - "*Single argument string for the magic number. See `sh-feature'.") + "*Single argument string for the magic number. See `sh-feature'." + :type '(repeat (cons (symbol :tag "Shell") + (choice (const :tag "No Arguments" nil) + (string :tag "Arguments") + (cons :format "Evaluate: %v" + (const :format "" eval) + sexp)))) + :group 'sh-script) (defvar sh-shell-variables nil "Alist of shell variable names that should be included in completion. @@ -274,23 +298,31 @@ the car and cdr are the same symbol.") -(defvar sh-dynamic-complete-functions +(defcustom sh-dynamic-complete-functions '(shell-dynamic-complete-environment-variable shell-dynamic-complete-command comint-dynamic-complete-filename) - "*Functions for doing TAB dynamic completion.") + "*Functions for doing TAB dynamic completion." + :type '(repeat function) + :group 'sh-script) -(defvar sh-require-final-newline +(defcustom sh-require-final-newline '((csh . t) (pdksh . t) (rc eval . require-final-newline) (sh eval . require-final-newline)) "*Value of `require-final-newline' in Shell-Script mode buffers. -See `sh-feature'.") +See `sh-feature'." + :type '(repeat (cons (symbol :tag "Shell") + (choice (const :tag "require" t) + (cons :format "Evaluate: %v" + (const :format "" eval) + sexp)))) + :group 'sh-script) -(defvar sh-assignment-regexp +(defcustom sh-assignment-prefix '((csh . "\\<\\([a-zA-Z0-9_]+\\)\\(\\[.+\\]\\)?[ \t]*[-+*/%^]?=") ;; actually spaces are only supported in let/(( ... )) (ksh88 . "\\<\\([a-zA-Z0-9_]+\\)\\(\\[.+\\]\\)?[ \t]*\\([-+*/%&|~^]\\|<<\\|>>\\)?=") @@ -298,15 +330,25 @@ See `sh-feature'.") (sh . "\\<\\([a-zA-Z0-9_]+\\)=")) "*Regexp for the variable name and what may follow in an assignment. First grouping matches the variable name. This is upto and including the `=' -sign. See `sh-feature'.") +sign. See `sh-feature'." + :type '(repeat (cons (symbol :tag "Shell") + (choice regexp + (cons :format "Evaluate: %v" + (const :format "" eval) + sexp)))) + :group 'sh-script) -(defvar sh-indentation 4 - "The width for further indentation in Shell-Script mode.") +(defcustom sh-indentation 4 + "The width for further indentation in Shell-Script mode." + :type 'integer + :group 'sh-script) -(defvar sh-remember-variable-min 3 - "*Don't remember variables less than this length for completing reads.") +(defcustom sh-remember-variable-min 3 + "*Don't remember variables less than this length for completing reads." + :type 'integer + :group 'sh-script) (defvar sh-header-marker nil @@ -314,16 +356,20 @@ sign. See `sh-feature'.") That command is also used for setting this variable.") -(defvar sh-beginning-of-command +(defcustom sh-beginning-of-command "\\([;({`|&]\\|\\`\\|[^\\]\n\\)[ \t]*\\([/~a-zA-Z0-9:]\\)" "*Regexp to determine the beginning of a shell command. -The actual command starts at the beginning of the second \\(grouping\\).") +The actual command starts at the beginning of the second \\(grouping\\)." + :type 'regexp + :group 'sh-script) -(defvar sh-end-of-command +(defcustom sh-end-of-command "\\([/~a-zA-Z0-9:]\\)[ \t]*\\([;#)}`|&]\\|$\\)" "*Regexp to determine the end of a shell command. -The actual command ends at the end of the first \\(grouping\\).") +The actual command ends at the end of the first \\(grouping\\)." + :type 'regexp + :group 'sh-script) @@ -336,7 +382,9 @@ The actual command ends at the end of the first \\(grouping\\).") "Initial input in Bourne if, while and until skeletons. See `sh-feature'.") -(defvar sh-builtins +;; customized this out of sheer bravado. not for the faint of heart. +;; but it *did* have an asterisk in the docstring! +(defcustom sh-builtins '((bash eval sh-append posix "alias" "bg" "bind" "builtin" "declare" "dirs" "enable" "fc" "fg" "help" "history" "jobs" "kill" "let" "local" "popd" "pushd" "source" @@ -399,11 +447,17 @@ The actual command ends at the end of the first \\(grouping\\).") "which")) "*List of all shell builtins for completing read and fontification. Note that on some systems not all builtins are available or some are -implemented as aliases. See `sh-feature'.") +implemented as aliases. See `sh-feature'." + :type '(repeat (cons (symbol :tag "Shell") + (choice (repeat string) + (cons :format "Evaluate: %v" + (const :format "" eval) + sexp)))) + :group 'sh-script) -(defvar sh-leading-keywords +(defcustom sh-leading-keywords '((csh "else") (es "true" "unwind-protect" "whatis") @@ -414,10 +468,16 @@ implemented as aliases. See `sh-feature'.") "*List of keywords that may be immediately followed by a builtin or keyword. Given some confusion between keywords and builtins depending on shell and system, the distinction here has been based on whether they influence the -flow of control or syntax. See `sh-feature'.") +flow of control or syntax. See `sh-feature'." + :type '(repeat (cons (symbol :tag "Shell") + (choice (repeat string) + (cons :format "Evaluate: %v" + (const :format "" eval) + sexp)))) + :group 'sh-script) -(defvar sh-other-keywords +(defcustom sh-other-keywords '((bash eval sh-append bourne "bye" "logout") @@ -447,7 +507,13 @@ flow of control or syntax. See `sh-feature'.") (zsh eval sh-append bash "select")) "*List of keywords not in `sh-leading-keywords'. -See `sh-feature'.") +See `sh-feature'." + :type '(repeat (cons (symbol :tag "Shell") + (choice (repeat string) + (cons :format "Evaluate: %v" + (const :format "" eval) + sexp)))) + :group 'sh-script) diff --git a/lisp/term.el b/lisp/term.el index 63624fecc09..c5143c636e2 100644 --- a/lisp/term.el +++ b/lisp/term.el @@ -378,6 +378,12 @@ (require 'ring) (require 'ehelp) + +(defgroup term nil + "General command interpreter in a window" + :group 'processes + :group 'unix) + ;;; Buffer Local Variables: ;;;============================================================================ @@ -448,8 +454,10 @@ (defvar term-pager-old-local-map nil) ;; Saves old keymap while paging. (defvar term-pager-old-filter) ;; Saved process-filter while paging. -(defvar explicit-shell-file-name nil - "*If non-nil, is file name to use for explicitly requested inferior shell.") +(defcustom explicit-shell-file-name nil + "*If non-nil, is file name to use for explicitly requested inferior shell." + :type '(choice (const nil) file) + :group 'term) (defvar term-prompt-regexp "^" "Regexp to recognise prompts in the inferior process. @@ -476,7 +484,7 @@ For shells, a good value is (?\\| ?& ?< ?> ?\\( ?\\) ?;). This is a good thing to set in mode hooks.") -(defvar term-input-autoexpand nil +(defcustom term-input-autoexpand nil "*If non-nil, expand input command history references on completion. This mirrors the optional behavior of tcsh (its autoexpand and histlit). @@ -485,21 +493,27 @@ If the value is `history', then the expansion is only when inserting into the buffer's input ring. See also `term-magic-space' and `term-dynamic-complete'. -This variable is buffer-local.") +This variable is buffer-local." + :type '(choice (const nil) (const t) (const input) (const history)) + :group 'term) -(defvar term-input-ignoredups nil +(defcustom term-input-ignoredups nil "*If non-nil, don't add input matching the last on the input ring. This mirrors the optional behavior of bash. -This variable is buffer-local.") +This variable is buffer-local." + :type 'boolean + :group 'term) -(defvar term-input-ring-file-name nil +(defcustom term-input-ring-file-name nil "*If non-nil, name of the file to read/write input history. See also `term-read-input-ring' and `term-write-input-ring'. -This variable is buffer-local, and is a good thing to set in mode hooks.") +This variable is buffer-local, and is a good thing to set in mode hooks." + :type 'boolean + :group 'term) -(defvar term-scroll-to-bottom-on-output nil +(defcustom term-scroll-to-bottom-on-output nil "*Controls whether interpreter output causes window to scroll. If nil, then do not scroll. If t or `all', scroll all windows showing buffer. If `this', scroll only the selected window. @@ -508,14 +522,18 @@ If `others', scroll only those that are not the selected window. The default is nil. See variable `term-scroll-show-maximum-output'. -This variable is buffer-local.") +This variable is buffer-local." + :type 'boolean + :group 'term) -(defvar term-scroll-show-maximum-output nil +(defcustom term-scroll-show-maximum-output nil "*Controls how interpreter output causes window to scroll. If non-nil, then show the maximum output when the window is scrolled. See variable `term-scroll-to-bottom-on-output'. -This variable is buffer-local.") +This variable is buffer-local." + :type 'boolean + :group 'term) ;; Where gud-display-frame should put the debugging arrow. This is ;; set by the marker-filter, which scans the debugger's output for @@ -557,20 +575,26 @@ massage the input string, this is your hook. This is called from the user command term-send-input. term-simple-send just sends the string plus a newline.") -(defvar term-eol-on-send t +(defcustom term-eol-on-send t "*Non-nil means go to the end of the line before sending input. -See `term-send-input'.") +See `term-send-input'." + :type 'boolean + :group 'term) -(defvar term-mode-hook '() +(defcustom term-mode-hook '() "Called upon entry into term-mode -This is run before the process is cranked up.") +This is run before the process is cranked up." + :type 'hook + :group 'term) -(defvar term-exec-hook '() +(defcustom term-exec-hook '() "Called each time a process is exec'd by term-exec. This is called after the process is cranked up. It is useful for things that must be done each time a process is executed in a term-mode buffer (e.g., \(process-kill-without-query)). In contrast, the term-mode-hook is only -executed once when the buffer is created.") +executed once when the buffer is created." + :type 'hook + :group 'term) (defvar term-mode-map nil) (defvar term-raw-map nil diff --git a/lisp/textmodes/texinfo.el b/lisp/textmodes/texinfo.el index ea16b03a4ae..1a62fbc9fa0 100644 --- a/lisp/textmodes/texinfo.el +++ b/lisp/textmodes/texinfo.el @@ -1,7 +1,7 @@ ;;; texinfo.el --- major mode for editing Texinfo files -;; Copyright (C) 1985, 1988, 1989, 1990, 1991, 1992, 1993 Free Software -;; Foundation, Inc. +;; Copyright (C) 1985, 1988, 1989, 1990, 1991, 1992, 1993, 1997 +;; Free Software Foundation, Inc. ;; Author: Robert J. Chassell ;; Maintainer: FSF @@ -23,6 +23,10 @@ ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, ;; Boston, MA 02111-1307, USA. +(defgroup texinfo nil + "Texinfo Mode" + :group 'docs) + ;;; Autoloads: @@ -662,20 +666,28 @@ to jump to the corresponding spot in the Texinfo source file." ;;; The tex and print function definitions: -(defvar texinfo-texi2dvi-command "texi2dvi" - "*Command used by `texinfo-tex-buffer' to run TeX and texindex on a buffer.") +(defcustom texinfo-texi2dvi-command "texi2dvi" + "*Command used by `texinfo-tex-buffer' to run TeX and texindex on a buffer." + :type 'string + :group 'texinfo) -(defvar texinfo-tex-command "tex" - "*Command used by `texinfo-tex-region' to run TeX on a region.") +(defcustom texinfo-tex-command "tex" + "*Command used by `texinfo-tex-region' to run TeX on a region." + :type 'string + :group 'texinfo) -(defvar texinfo-texindex-command "texindex" - "*Command used by `texinfo-texindex' to sort unsorted index files.") +(defcustom texinfo-texindex-command "texindex" + "*Command used by `texinfo-texindex' to sort unsorted index files." + :type 'string + :group 'texinfo) -(defvar texinfo-delete-from-print-queue-command "lprm" +(defcustom texinfo-delete-from-print-queue-command "lprm" "*Command string used to delete a job from the line printer queue. Command is used by \\[texinfo-delete-from-print-queue] based on number provided by a previous \\[tex-show-print-queue] -command.") +command." + :type 'string + :group 'texinfo) (defvar texinfo-tex-trailer "@bye" "String appended after a region sent to TeX by `texinfo-tex-region'.") -- 2.11.4.GIT