Mercurial > emacs
changeset 17634:247c2a11843d
Use defgroup and defcustom.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Sat, 03 May 1997 19:53:57 +0000 |
parents | 3b746ca2bca9 |
children | e687d30cbf1a |
files | lisp/goto-addr.el lisp/hippie-exp.el lisp/ielm.el lisp/imenu.el |
diffstat | 4 files changed, 127 insertions(+), 53 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/goto-addr.el Sat May 03 19:28:12 1997 +0000 +++ b/lisp/goto-addr.el Sat May 03 19:53:57 1997 +0000 @@ -72,16 +72,28 @@ (require 'browse-url) -;;; I don't expect users to want fontify'ing without highlighting. -(defvar 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.") +(defgroup goto-address nil + "Click to browse URL or to send to e-mail address." + :group 'mouse + :group 'hypermedia) + -(defvar goto-address-highlight-p t - "*If t, URL's and e-mail addresses in buffer are highlighted.") +;;; I don't expect users to want fontify'ing without highlighting. +(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." + :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-highlight-p t + "*If t, URL's and e-mail addresses in buffer are highlighted." + :type 'boolean + :group 'goto-address) + +(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 @@ "[-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 @@ m) "keymap to hold goto-addr's mouse key defs under highlighted URLs.") -(defvar goto-address-url-face 'bold - "*Face to use for URLs.") +(defcustom goto-address-url-face 'bold + "*Face to use for URLs." + :type 'face + :group 'goto-address) -(defvar goto-address-url-mouse-face 'highlight - "*Face to use for URLs when the mouse is on them.") +(defcustom goto-address-url-mouse-face 'highlight + "*Face to use for URLs when the mouse is on them." + :type 'face + :group 'goto-address) -(defvar goto-address-mail-face 'italic - "*Face to use for e-mail addresses.") +(defcustom goto-address-mail-face 'italic + "*Face to use for e-mail addresses." + :type 'face + :group 'goto-address) -(defvar goto-address-mail-mouse-face 'secondary-selection - "*Face to use for e-mail addresses when the mouse is on them.") +(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.
--- a/lisp/hippie-exp.el Sat May 03 19:28:12 1997 +0000 +++ b/lisp/hippie-exp.el Sat May 03 19:53:57 1997 +0000 @@ -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 @@ 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)
--- a/lisp/ielm.el Sat May 03 19:28:12 1997 +0000 +++ b/lisp/ielm.el Sat May 03 19:53:57 1997 +0000 @@ -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 @@ (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.")
--- a/lisp/imenu.el Sat May 03 19:28:12 1997 +0000 +++ b/lisp/imenu.el Sat May 03 19:53:57 1997 +0000 @@ -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 @@ 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