summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1997-05-03 19:53:57 +0000
committerRichard M. Stallman <rms@gnu.org>1997-05-03 19:53:57 +0000
commitbe0c053fb9799f6cffa185b0e43862f80610faa5 (patch)
tree6f8266f353162c2da31f05ea5c607e342f81b55b
parent30595e2d9595c72ac6b59e2f66aa3d72c6b38592 (diff)
downloademacs-be0c053fb9799f6cffa185b0e43862f80610faa5.tar.gz
Use defgroup and defcustom.
-rw-r--r--lisp/goto-addr.el60
-rw-r--r--lisp/hippie-exp.el23
-rw-r--r--lisp/ielm.el31
-rw-r--r--lisp/imenu.el68
4 files changed, 128 insertions, 54 deletions
diff --git a/lisp/goto-addr.el b/lisp/goto-addr.el
index ecf64b3dcfb..7a4026158a8 100644
--- a/lisp/goto-addr.el
+++ b/lisp/goto-addr.el
@@ -72,16 +72,28 @@
(require 'browse-url)
+(defgroup goto-address nil
+ "Click to browse URL or to send to e-mail address."
+ :group 'mouse
+ :group 'hypermedia)
+
+
;;; I don't expect users to want fontify'ing without highlighting.
-(defvar goto-address-fontify-p t
+(defcustom goto-address-fontify-p t
"*If t, URL's and e-mail addresses in buffer are fontified.
-But only if `goto-address-highlight-p' is also non-nil.")
+But only if `goto-address-highlight-p' is also non-nil."
+ :type 'boolean
+ :group 'goto-address)
-(defvar goto-address-highlight-p t
- "*If t, URL's and e-mail addresses in buffer are highlighted.")
+(defcustom goto-address-highlight-p t
+ "*If t, URL's and e-mail addresses in buffer are highlighted."
+ :type 'boolean
+ :group 'goto-address)
-(defvar goto-address-fontify-maximum-size 30000
- "*Maximum size of file in which to fontify and/or highlight URL's.")
+(defcustom goto-address-fontify-maximum-size 30000
+ "*Maximum size of file in which to fontify and/or highlight URL's."
+ :type 'integer
+ :group 'goto-address)
(defvar goto-address-mail-regexp
"[-a-zA-Z0-9._]+@\\([-a-zA-z0-9_]+\\.\\)+[a-zA-Z0-9]+"
@@ -94,11 +106,13 @@ But only if `goto-address-highlight-p' is also non-nil.")
"[-a-zA-Z0-9_=#$@~`%&*+|\\/]")
"A regular expression probably matching a URL.")
-(defvar goto-address-mail-method
+(defcustom goto-address-mail-method
'goto-address-send-using-mail
"*Function to compose mail.
Two pre-made functions are `goto-address-send-using-mail' (sendmail);
-and `goto-address-send-using-mh-e' (MH-E).")
+and `goto-address-send-using-mh-e' (MH-E)."
+ :type 'function
+ :group 'goto-address)
(defvar goto-address-highlight-keymap
(let ((m (make-sparse-keymap)))
@@ -106,17 +120,25 @@ and `goto-address-send-using-mh-e' (MH-E).")
m)
"keymap to hold goto-addr's mouse key defs under highlighted URLs.")
-(defvar goto-address-url-face 'bold
- "*Face to use for URLs.")
-
-(defvar goto-address-url-mouse-face 'highlight
- "*Face to use for URLs when the mouse is on them.")
-
-(defvar goto-address-mail-face 'italic
- "*Face to use for e-mail addresses.")
-
-(defvar goto-address-mail-mouse-face 'secondary-selection
- "*Face to use for e-mail addresses when the mouse is on them.")
+(defcustom goto-address-url-face 'bold
+ "*Face to use for URLs."
+ :type 'face
+ :group 'goto-address)
+
+(defcustom goto-address-url-mouse-face 'highlight
+ "*Face to use for URLs when the mouse is on them."
+ :type 'face
+ :group 'goto-address)
+
+(defcustom goto-address-mail-face 'italic
+ "*Face to use for e-mail addresses."
+ :type 'face
+ :group 'goto-address)
+
+(defcustom goto-address-mail-mouse-face 'secondary-selection
+ "*Face to use for e-mail addresses when the mouse is on them."
+ :type 'face
+ :group 'goto-address)
(defun goto-address-fontify ()
"Fontify the URL's and e-mail addresses in the current buffer.
diff --git a/lisp/hippie-exp.el b/lisp/hippie-exp.el
index caa479d9ec8..aeaa747659c 100644
--- a/lisp/hippie-exp.el
+++ b/lisp/hippie-exp.el
@@ -157,6 +157,10 @@
;;; Code:
+(defgroup hippie-expand nil
+ "Expand text trying various ways to find its expansion."
+ :group 'abbrev)
+
(defvar he-num -1)
(defvar he-string-beg (make-marker))
@@ -197,19 +201,26 @@ To change the behavior of `hippie-expand', remove, change the order of,
or insert functions in this list.")
;;;###autoload
-(defvar hippie-expand-verbose t
- "*Non-nil makes `hippie-expand' output which function it is trying.")
+(defcustom hippie-expand-verbose t
+ "*Non-nil makes `hippie-expand' output which function it is trying."
+ :type 'boolean
+ :group 'hippie-expand)
;;;###autoload
-(defvar hippie-expand-max-buffers ()
+(defcustom hippie-expand-max-buffers ()
"*The maximum number of buffers (apart from the current) searched.
-If nil, all buffers are searched.")
+If nil, all buffers are searched."
+ :type '(choice (const :tag "All" nil)
+ integer)
+ :group 'hippie-expand)
;;;###autoload
-(defvar hippie-expand-ignore-buffers '("^ \\*.*\\*$" dired-mode)
+(defcustom hippie-expand-ignore-buffers '("^ \\*.*\\*$" dired-mode)
"*A list specifying which buffers not to search (if not current).
Can contain both regexps matching buffer names (as strings) and major modes
-\(as atoms)")
+\(as atoms)"
+ :type '(repeat (choice regexp (symbol :tag "Major Mode")))
+ :group 'hippie-expand)
;;;###autoload
(defun hippie-expand (arg)
diff --git a/lisp/ielm.el b/lisp/ielm.el
index a5ce307a3d1..6a603c6f31b 100644
--- a/lisp/ielm.el
+++ b/lisp/ielm.el
@@ -59,26 +59,39 @@
;;; User variables
-(defvar ielm-noisy t
- "*If non-nil, IELM will beep on error.")
+(defgroup ielm nil
+ "Interaction mode for Emacs Lisp."
+ :group 'lisp)
+
+
+(defcustom ielm-noisy t
+ "*If non-nil, IELM will beep on error."
+ :type 'boolean
+ :group 'ielm)
(defvar ielm-prompt "ELISP> "
"Prompt used in IELM.")
-(defvar ielm-dynamic-return t
+(defcustom ielm-dynamic-return t
"*Controls whether \\<ielm-map>\\[ielm-return] has intelligent behaviour in IELM.
If non-nil, \\[ielm-return] evaluates input for complete sexps, or inserts a newline
-and indents for incomplete sexps. If nil, always inserts newlines.")
+and indents for incomplete sexps. If nil, always inserts newlines."
+ :type 'boolean
+ :group 'ielm)
-(defvar ielm-dynamic-multiline-inputs t
+(defcustom ielm-dynamic-multiline-inputs t
"*Force multiline inputs to start from column zero?
If non-nil, after entering the first line of an incomplete sexp, a newline
will be inserted after the prompt, moving the input to the next line.
This gives more frame width for large indented sexps, and allows functions
-such as `edebug-defun' to work with such inputs.")
+such as `edebug-defun' to work with such inputs."
+ :type 'boolean
+ :group 'ielm)
-(defvar ielm-mode-hook nil
- "*Hooks to be run when IELM (`inferior-emacs-lisp-mode') is started.")
+(defcustom ielm-mode-hook nil
+ "*Hooks to be run when IELM (`inferior-emacs-lisp-mode') is started."
+ :type 'hook
+ :group 'ielm)
;;; System variables
@@ -89,7 +102,7 @@ This variable is buffer-local.")
(defvar ielm-header
(concat
"*** Welcome to IELM version "
- (substring "$Revision: 1.8 $" 11 -2)
+ (substring "$Revision: 1.9 $" 11 -2)
" *** Type (describe-mode) for help.\n"
"IELM has ABSOLUTELY NO WARRANTY; type (describe-no-warranty) for details.\n")
"Message to display when IELM is started.")
diff --git a/lisp/imenu.el b/lisp/imenu.el
index 495ca8f1b8e..78fcfa38982 100644
--- a/lisp/imenu.el
+++ b/lisp/imenu.el
@@ -65,31 +65,49 @@
;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-(defvar imenu-use-markers t
+(defgroup imenu nil
+ "Mode-specific buffer indexes."
+ :group 'matching
+ :group 'frames)
+
+(defcustom imenu-use-markers t
"*Non-nil means use markers instead of integers for Imenu buffer positions.
Setting this to nil makes Imenu work faster.
-This might not yet be honored by all index-building functions.")
+This might not yet be honored by all index-building functions."
+ :type 'boolean
+ :group 'imenu)
+
-(defvar imenu-max-item-length 60
- "*If a number, truncate Imenu entries to that length.")
+(defcustom imenu-max-item-length 60
+ "*If a number, truncate Imenu entries to that length."
+ :type 'integer
+ :group 'imenu)
-(defvar imenu-auto-rescan nil
- "*Non-nil means Imenu should always rescan the buffers.")
+(decustom imenu-auto-rescan nil
+ "*Non-nil means Imenu should always rescan the buffers."
+ :type 'boolean
+ :group 'imenu)
-(defvar imenu-auto-rescan-maxout 60000
+(defcustom imenu-auto-rescan-maxout 60000
"*Imenu auto-rescan is disabled in buffers larger than this size.
-This variable is buffer-local.")
+This variable is buffer-local."
+ :type 'integer
+ :group 'imenu)
-(defvar imenu-always-use-completion-buffer-p nil
+(defcustom imenu-always-use-completion-buffer-p nil
"*Set this to non-nil for displaying the index in a completion buffer.
`never' means never automatically display a listing of any kind.
A value of nil (the default) means display the index as a mouse menu
if the mouse was used to invoke `imenu'.
-Another non-nil value means always display the index in a completion buffer.")
+Another non-nil value means always display the index in a completion buffer."
+ :type '(choice (const :tag "On Mouse" nil)
+ (const :tag "Never" never)
+ (sexp :tag "Always" :format "%t\n" t))
+ :group 'imenu)
-(defvar imenu-sort-function nil
+(defcustom imenu-sort-function nil
"*The function to use for sorting the index mouse-menu.
Affects only the mouse index menu.
@@ -102,27 +120,37 @@ Set it to `imenu--sort-by-name' if you want alphabetic sorting.
The function should take two arguments and return T if the first
element should come before the second. The arguments are cons cells;
-\(NAME . POSITION). Look at `imenu--sort-by-name' for an example.")
+\(NAME . POSITION). Look at `imenu--sort-by-name' for an example."
+ :type 'function
+ :group 'imenu)
-(defvar imenu-max-items 25
- "*Maximum number of elements in a mouse menu for Imenu.")
+(defcustom imenu-max-items 25
+ "*Maximum number of elements in a mouse menu for Imenu."
+ :type 'integer
+ :group 'imenu)
-(defvar imenu-scanning-message "Scanning buffer for index (%3d%%)"
+(defcustom imenu-scanning-message "Scanning buffer for index (%3d%%)"
"*Progress message during the index scanning of the buffer.
If non-nil, user gets a message during the scanning of the buffer.
Relevant only if the mode-specific function that creates the buffer
-index use `imenu-progress-message'.")
+index use `imenu-progress-message'."
+ :type 'string
+ :group 'imenu)
-(defvar imenu-space-replacement "^"
+(defcustom imenu-space-replacement "^"
"*The replacement string for spaces in index names.
Used when presenting the index in a completion-buffer to make the
-names work as tokens.")
+names work as tokens."
+ :type 'string
+ :group 'imenu)
-(defvar imenu-level-separator ":"
+(defcustom imenu-level-separator ":"
"*The separator between index names of different levels.
Used for making mouse-menu titles and for flattening nested indexes
-with name concatenation.")
+with name concatenation."
+ :type 'string
+ :group 'imenu)
;;;###autoload
(defvar imenu-generic-expression nil