diff options
| author | Richard M. Stallman | 1997-05-03 19:53:57 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1997-05-03 19:53:57 +0000 |
| commit | 94114394685bcb5eedb15288ebe6a715bf1d0eaf (patch) | |
| tree | cf53fd72f586dd029b3fcc3c2a3f762719263875 | |
| parent | da37a9b4641c763e391a0df997bda082f15ff569 (diff) | |
| download | emacs-94114394685bcb5eedb15288ebe6a715bf1d0eaf.tar.gz emacs-94114394685bcb5eedb15288ebe6a715bf1d0eaf.zip | |
Use defgroup and defcustom.
| -rw-r--r-- | lisp/goto-addr.el | 60 | ||||
| -rw-r--r-- | lisp/hippie-exp.el | 23 | ||||
| -rw-r--r-- | lisp/ielm.el | 31 | ||||
| -rw-r--r-- | lisp/imenu.el | 68 |
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 @@ | |||
| 72 | 72 | ||
| 73 | (require 'browse-url) | 73 | (require 'browse-url) |
| 74 | 74 | ||
| 75 | (defgroup goto-address nil | ||
| 76 | "Click to browse URL or to send to e-mail address." | ||
| 77 | :group 'mouse | ||
| 78 | :group 'hypermedia) | ||
| 79 | |||
| 80 | |||
| 75 | ;;; I don't expect users to want fontify'ing without highlighting. | 81 | ;;; I don't expect users to want fontify'ing without highlighting. |
| 76 | (defvar goto-address-fontify-p t | 82 | (defcustom goto-address-fontify-p t |
| 77 | "*If t, URL's and e-mail addresses in buffer are fontified. | 83 | "*If t, URL's and e-mail addresses in buffer are fontified. |
| 78 | But only if `goto-address-highlight-p' is also non-nil.") | 84 | But only if `goto-address-highlight-p' is also non-nil." |
| 85 | :type 'boolean | ||
| 86 | :group 'goto-address) | ||
| 79 | 87 | ||
| 80 | (defvar goto-address-highlight-p t | 88 | (defcustom goto-address-highlight-p t |
| 81 | "*If t, URL's and e-mail addresses in buffer are highlighted.") | 89 | "*If t, URL's and e-mail addresses in buffer are highlighted." |
| 90 | :type 'boolean | ||
| 91 | :group 'goto-address) | ||
| 82 | 92 | ||
| 83 | (defvar goto-address-fontify-maximum-size 30000 | 93 | (defcustom goto-address-fontify-maximum-size 30000 |
| 84 | "*Maximum size of file in which to fontify and/or highlight URL's.") | 94 | "*Maximum size of file in which to fontify and/or highlight URL's." |
| 95 | :type 'integer | ||
| 96 | :group 'goto-address) | ||
| 85 | 97 | ||
| 86 | (defvar goto-address-mail-regexp | 98 | (defvar goto-address-mail-regexp |
| 87 | "[-a-zA-Z0-9._]+@\\([-a-zA-z0-9_]+\\.\\)+[a-zA-Z0-9]+" | 99 | "[-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.") | |||
| 94 | "[-a-zA-Z0-9_=#$@~`%&*+|\\/]") | 106 | "[-a-zA-Z0-9_=#$@~`%&*+|\\/]") |
| 95 | "A regular expression probably matching a URL.") | 107 | "A regular expression probably matching a URL.") |
| 96 | 108 | ||
| 97 | (defvar goto-address-mail-method | 109 | (defcustom goto-address-mail-method |
| 98 | 'goto-address-send-using-mail | 110 | 'goto-address-send-using-mail |
| 99 | "*Function to compose mail. | 111 | "*Function to compose mail. |
| 100 | Two pre-made functions are `goto-address-send-using-mail' (sendmail); | 112 | Two pre-made functions are `goto-address-send-using-mail' (sendmail); |
| 101 | and `goto-address-send-using-mh-e' (MH-E).") | 113 | and `goto-address-send-using-mh-e' (MH-E)." |
| 114 | :type 'function | ||
| 115 | :group 'goto-address) | ||
| 102 | 116 | ||
| 103 | (defvar goto-address-highlight-keymap | 117 | (defvar goto-address-highlight-keymap |
| 104 | (let ((m (make-sparse-keymap))) | 118 | (let ((m (make-sparse-keymap))) |
| @@ -106,17 +120,25 @@ and `goto-address-send-using-mh-e' (MH-E).") | |||
| 106 | m) | 120 | m) |
| 107 | "keymap to hold goto-addr's mouse key defs under highlighted URLs.") | 121 | "keymap to hold goto-addr's mouse key defs under highlighted URLs.") |
| 108 | 122 | ||
| 109 | (defvar goto-address-url-face 'bold | 123 | (defcustom goto-address-url-face 'bold |
| 110 | "*Face to use for URLs.") | 124 | "*Face to use for URLs." |
| 111 | 125 | :type 'face | |
| 112 | (defvar goto-address-url-mouse-face 'highlight | 126 | :group 'goto-address) |
| 113 | "*Face to use for URLs when the mouse is on them.") | 127 | |
| 114 | 128 | (defcustom goto-address-url-mouse-face 'highlight | |
| 115 | (defvar goto-address-mail-face 'italic | 129 | "*Face to use for URLs when the mouse is on them." |
| 116 | "*Face to use for e-mail addresses.") | 130 | :type 'face |
| 117 | 131 | :group 'goto-address) | |
| 118 | (defvar goto-address-mail-mouse-face 'secondary-selection | 132 | |
| 119 | "*Face to use for e-mail addresses when the mouse is on them.") | 133 | (defcustom goto-address-mail-face 'italic |
| 134 | "*Face to use for e-mail addresses." | ||
| 135 | :type 'face | ||
| 136 | :group 'goto-address) | ||
| 137 | |||
| 138 | (defcustom goto-address-mail-mouse-face 'secondary-selection | ||
| 139 | "*Face to use for e-mail addresses when the mouse is on them." | ||
| 140 | :type 'face | ||
| 141 | :group 'goto-address) | ||
| 120 | 142 | ||
| 121 | (defun goto-address-fontify () | 143 | (defun goto-address-fontify () |
| 122 | "Fontify the URL's and e-mail addresses in the current buffer. | 144 | "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 @@ | |||
| 157 | 157 | ||
| 158 | ;;; Code: | 158 | ;;; Code: |
| 159 | 159 | ||
| 160 | (defgroup hippie-expand nil | ||
| 161 | "Expand text trying various ways to find its expansion." | ||
| 162 | :group 'abbrev) | ||
| 163 | |||
| 160 | (defvar he-num -1) | 164 | (defvar he-num -1) |
| 161 | 165 | ||
| 162 | (defvar he-string-beg (make-marker)) | 166 | (defvar he-string-beg (make-marker)) |
| @@ -197,19 +201,26 @@ To change the behavior of `hippie-expand', remove, change the order of, | |||
| 197 | or insert functions in this list.") | 201 | or insert functions in this list.") |
| 198 | 202 | ||
| 199 | ;;;###autoload | 203 | ;;;###autoload |
| 200 | (defvar hippie-expand-verbose t | 204 | (defcustom hippie-expand-verbose t |
| 201 | "*Non-nil makes `hippie-expand' output which function it is trying.") | 205 | "*Non-nil makes `hippie-expand' output which function it is trying." |
| 206 | :type 'boolean | ||
| 207 | :group 'hippie-expand) | ||
| 202 | 208 | ||
| 203 | ;;;###autoload | 209 | ;;;###autoload |
| 204 | (defvar hippie-expand-max-buffers () | 210 | (defcustom hippie-expand-max-buffers () |
| 205 | "*The maximum number of buffers (apart from the current) searched. | 211 | "*The maximum number of buffers (apart from the current) searched. |
| 206 | If nil, all buffers are searched.") | 212 | If nil, all buffers are searched." |
| 213 | :type '(choice (const :tag "All" nil) | ||
| 214 | integer) | ||
| 215 | :group 'hippie-expand) | ||
| 207 | 216 | ||
| 208 | ;;;###autoload | 217 | ;;;###autoload |
| 209 | (defvar hippie-expand-ignore-buffers '("^ \\*.*\\*$" dired-mode) | 218 | (defcustom hippie-expand-ignore-buffers '("^ \\*.*\\*$" dired-mode) |
| 210 | "*A list specifying which buffers not to search (if not current). | 219 | "*A list specifying which buffers not to search (if not current). |
| 211 | Can contain both regexps matching buffer names (as strings) and major modes | 220 | Can contain both regexps matching buffer names (as strings) and major modes |
| 212 | \(as atoms)") | 221 | \(as atoms)" |
| 222 | :type '(repeat (choice regexp (symbol :tag "Major Mode"))) | ||
| 223 | :group 'hippie-expand) | ||
| 213 | 224 | ||
| 214 | ;;;###autoload | 225 | ;;;###autoload |
| 215 | (defun hippie-expand (arg) | 226 | (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 @@ | |||
| 59 | 59 | ||
| 60 | ;;; User variables | 60 | ;;; User variables |
| 61 | 61 | ||
| 62 | (defvar ielm-noisy t | 62 | (defgroup ielm nil |
| 63 | "*If non-nil, IELM will beep on error.") | 63 | "Interaction mode for Emacs Lisp." |
| 64 | :group 'lisp) | ||
| 65 | |||
| 66 | |||
| 67 | (defcustom ielm-noisy t | ||
| 68 | "*If non-nil, IELM will beep on error." | ||
| 69 | :type 'boolean | ||
| 70 | :group 'ielm) | ||
| 64 | 71 | ||
| 65 | (defvar ielm-prompt "ELISP> " | 72 | (defvar ielm-prompt "ELISP> " |
| 66 | "Prompt used in IELM.") | 73 | "Prompt used in IELM.") |
| 67 | 74 | ||
| 68 | (defvar ielm-dynamic-return t | 75 | (defcustom ielm-dynamic-return t |
| 69 | "*Controls whether \\<ielm-map>\\[ielm-return] has intelligent behaviour in IELM. | 76 | "*Controls whether \\<ielm-map>\\[ielm-return] has intelligent behaviour in IELM. |
| 70 | If non-nil, \\[ielm-return] evaluates input for complete sexps, or inserts a newline | 77 | If non-nil, \\[ielm-return] evaluates input for complete sexps, or inserts a newline |
| 71 | and indents for incomplete sexps. If nil, always inserts newlines.") | 78 | and indents for incomplete sexps. If nil, always inserts newlines." |
| 79 | :type 'boolean | ||
| 80 | :group 'ielm) | ||
| 72 | 81 | ||
| 73 | (defvar ielm-dynamic-multiline-inputs t | 82 | (defcustom ielm-dynamic-multiline-inputs t |
| 74 | "*Force multiline inputs to start from column zero? | 83 | "*Force multiline inputs to start from column zero? |
| 75 | If non-nil, after entering the first line of an incomplete sexp, a newline | 84 | If non-nil, after entering the first line of an incomplete sexp, a newline |
| 76 | will be inserted after the prompt, moving the input to the next line. | 85 | will be inserted after the prompt, moving the input to the next line. |
| 77 | This gives more frame width for large indented sexps, and allows functions | 86 | This gives more frame width for large indented sexps, and allows functions |
| 78 | such as `edebug-defun' to work with such inputs.") | 87 | such as `edebug-defun' to work with such inputs." |
| 88 | :type 'boolean | ||
| 89 | :group 'ielm) | ||
| 79 | 90 | ||
| 80 | (defvar ielm-mode-hook nil | 91 | (defcustom ielm-mode-hook nil |
| 81 | "*Hooks to be run when IELM (`inferior-emacs-lisp-mode') is started.") | 92 | "*Hooks to be run when IELM (`inferior-emacs-lisp-mode') is started." |
| 93 | :type 'hook | ||
| 94 | :group 'ielm) | ||
| 82 | 95 | ||
| 83 | ;;; System variables | 96 | ;;; System variables |
| 84 | 97 | ||
| @@ -89,7 +102,7 @@ This variable is buffer-local.") | |||
| 89 | (defvar ielm-header | 102 | (defvar ielm-header |
| 90 | (concat | 103 | (concat |
| 91 | "*** Welcome to IELM version " | 104 | "*** Welcome to IELM version " |
| 92 | (substring "$Revision: 1.8 $" 11 -2) | 105 | (substring "$Revision: 1.9 $" 11 -2) |
| 93 | " *** Type (describe-mode) for help.\n" | 106 | " *** Type (describe-mode) for help.\n" |
| 94 | "IELM has ABSOLUTELY NO WARRANTY; type (describe-no-warranty) for details.\n") | 107 | "IELM has ABSOLUTELY NO WARRANTY; type (describe-no-warranty) for details.\n") |
| 95 | "Message to display when IELM is started.") | 108 | "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 @@ | |||
| 65 | ;;; | 65 | ;;; |
| 66 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 66 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
| 67 | 67 | ||
| 68 | (defvar imenu-use-markers t | 68 | (defgroup imenu nil |
| 69 | "Mode-specific buffer indexes." | ||
| 70 | :group 'matching | ||
| 71 | :group 'frames) | ||
| 72 | |||
| 73 | (defcustom imenu-use-markers t | ||
| 69 | "*Non-nil means use markers instead of integers for Imenu buffer positions. | 74 | "*Non-nil means use markers instead of integers for Imenu buffer positions. |
| 70 | Setting this to nil makes Imenu work faster. | 75 | Setting this to nil makes Imenu work faster. |
| 71 | 76 | ||
| 72 | This might not yet be honored by all index-building functions.") | 77 | This might not yet be honored by all index-building functions." |
| 78 | :type 'boolean | ||
| 79 | :group 'imenu) | ||
| 80 | |||
| 73 | 81 | ||
| 74 | (defvar imenu-max-item-length 60 | 82 | (defcustom imenu-max-item-length 60 |
| 75 | "*If a number, truncate Imenu entries to that length.") | 83 | "*If a number, truncate Imenu entries to that length." |
| 84 | :type 'integer | ||
| 85 | :group 'imenu) | ||
| 76 | 86 | ||
| 77 | (defvar imenu-auto-rescan nil | 87 | (decustom imenu-auto-rescan nil |
| 78 | "*Non-nil means Imenu should always rescan the buffers.") | 88 | "*Non-nil means Imenu should always rescan the buffers." |
| 89 | :type 'boolean | ||
| 90 | :group 'imenu) | ||
| 79 | 91 | ||
| 80 | (defvar imenu-auto-rescan-maxout 60000 | 92 | (defcustom imenu-auto-rescan-maxout 60000 |
| 81 | "*Imenu auto-rescan is disabled in buffers larger than this size. | 93 | "*Imenu auto-rescan is disabled in buffers larger than this size. |
| 82 | This variable is buffer-local.") | 94 | This variable is buffer-local." |
| 95 | :type 'integer | ||
| 96 | :group 'imenu) | ||
| 83 | 97 | ||
| 84 | (defvar imenu-always-use-completion-buffer-p nil | 98 | (defcustom imenu-always-use-completion-buffer-p nil |
| 85 | "*Set this to non-nil for displaying the index in a completion buffer. | 99 | "*Set this to non-nil for displaying the index in a completion buffer. |
| 86 | 100 | ||
| 87 | `never' means never automatically display a listing of any kind. | 101 | `never' means never automatically display a listing of any kind. |
| 88 | A value of nil (the default) means display the index as a mouse menu | 102 | A value of nil (the default) means display the index as a mouse menu |
| 89 | if the mouse was used to invoke `imenu'. | 103 | if the mouse was used to invoke `imenu'. |
| 90 | Another non-nil value means always display the index in a completion buffer.") | 104 | Another non-nil value means always display the index in a completion buffer." |
| 105 | :type '(choice (const :tag "On Mouse" nil) | ||
| 106 | (const :tag "Never" never) | ||
| 107 | (sexp :tag "Always" :format "%t\n" t)) | ||
| 108 | :group 'imenu) | ||
| 91 | 109 | ||
| 92 | (defvar imenu-sort-function nil | 110 | (defcustom imenu-sort-function nil |
| 93 | "*The function to use for sorting the index mouse-menu. | 111 | "*The function to use for sorting the index mouse-menu. |
| 94 | 112 | ||
| 95 | Affects only the mouse index menu. | 113 | Affects only the mouse index menu. |
| @@ -102,27 +120,37 @@ Set it to `imenu--sort-by-name' if you want alphabetic sorting. | |||
| 102 | 120 | ||
| 103 | The function should take two arguments and return T if the first | 121 | The function should take two arguments and return T if the first |
| 104 | element should come before the second. The arguments are cons cells; | 122 | element should come before the second. The arguments are cons cells; |
| 105 | \(NAME . POSITION). Look at `imenu--sort-by-name' for an example.") | 123 | \(NAME . POSITION). Look at `imenu--sort-by-name' for an example." |
| 124 | :type 'function | ||
| 125 | :group 'imenu) | ||
| 106 | 126 | ||
| 107 | (defvar imenu-max-items 25 | 127 | (defcustom imenu-max-items 25 |
| 108 | "*Maximum number of elements in a mouse menu for Imenu.") | 128 | "*Maximum number of elements in a mouse menu for Imenu." |
| 129 | :type 'integer | ||
| 130 | :group 'imenu) | ||
| 109 | 131 | ||
| 110 | (defvar imenu-scanning-message "Scanning buffer for index (%3d%%)" | 132 | (defcustom imenu-scanning-message "Scanning buffer for index (%3d%%)" |
| 111 | "*Progress message during the index scanning of the buffer. | 133 | "*Progress message during the index scanning of the buffer. |
| 112 | If non-nil, user gets a message during the scanning of the buffer. | 134 | If non-nil, user gets a message during the scanning of the buffer. |
| 113 | 135 | ||
| 114 | Relevant only if the mode-specific function that creates the buffer | 136 | Relevant only if the mode-specific function that creates the buffer |
| 115 | index use `imenu-progress-message'.") | 137 | index use `imenu-progress-message'." |
| 138 | :type 'string | ||
| 139 | :group 'imenu) | ||
| 116 | 140 | ||
| 117 | (defvar imenu-space-replacement "^" | 141 | (defcustom imenu-space-replacement "^" |
| 118 | "*The replacement string for spaces in index names. | 142 | "*The replacement string for spaces in index names. |
| 119 | Used when presenting the index in a completion-buffer to make the | 143 | Used when presenting the index in a completion-buffer to make the |
| 120 | names work as tokens.") | 144 | names work as tokens." |
| 145 | :type 'string | ||
| 146 | :group 'imenu) | ||
| 121 | 147 | ||
| 122 | (defvar imenu-level-separator ":" | 148 | (defcustom imenu-level-separator ":" |
| 123 | "*The separator between index names of different levels. | 149 | "*The separator between index names of different levels. |
| 124 | Used for making mouse-menu titles and for flattening nested indexes | 150 | Used for making mouse-menu titles and for flattening nested indexes |
| 125 | with name concatenation.") | 151 | with name concatenation." |
| 152 | :type 'string | ||
| 153 | :group 'imenu) | ||
| 126 | 154 | ||
| 127 | ;;;###autoload | 155 | ;;;###autoload |
| 128 | (defvar imenu-generic-expression nil | 156 | (defvar imenu-generic-expression nil |