aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1997-04-13 02:39:56 +0000
committerRichard M. Stallman1997-04-13 02:39:56 +0000
commited366e8726109aaabd7b0e44d59b3e434b70ca9a (patch)
treefe7056041f463caaf2fe6d80ba01c3546db92800
parent4d100a01c9dadb3e604bff2b94650e92b3397fc7 (diff)
downloademacs-ed366e8726109aaabd7b0e44d59b3e434b70ca9a.tar.gz
emacs-ed366e8726109aaabd7b0e44d59b3e434b70ca9a.zip
Add defgroup's; use defcustom for user vars.
-rw-r--r--lisp/comint.el150
-rw-r--r--lisp/shell.el99
2 files changed, 185 insertions, 64 deletions
diff --git a/lisp/comint.el b/lisp/comint.el
index 2be96265d02..1421338781d 100644
--- a/lisp/comint.el
+++ b/lisp/comint.el
@@ -137,6 +137,20 @@
137;; comint-completion-autolist boolean completion behavior 137;; comint-completion-autolist boolean completion behavior
138;; comint-completion-recexact boolean ... 138;; comint-completion-recexact boolean ...
139 139
140(defgroup comint nil
141 "General command interpreter in a window stuff."
142 :group 'processes)
143
144(defgroup comint-completion nil
145 "Completion facilities in comint"
146 :group 'comint)
147
148(defgroup comint-source nil
149 "Source finding facilities in comint"
150 :prefix "comint-"
151 :group 'comint)
152
153
140(defvar comint-prompt-regexp "^" 154(defvar comint-prompt-regexp "^"
141 "Regexp to recognise prompts in the inferior process. 155 "Regexp to recognise prompts in the inferior process.
142Defaults to \"^\", the null string at BOL. 156Defaults to \"^\", the null string at BOL.
@@ -162,7 +176,7 @@ For shells, a good value is (?\\| ?& ?< ?> ?\\( ?\\) ?;).
162 176
163This is a good thing to set in mode hooks.") 177This is a good thing to set in mode hooks.")
164 178
165(defvar comint-input-autoexpand nil 179(defcustom comint-input-autoexpand nil
166 "*If non-nil, expand input command history references on completion. 180 "*If non-nil, expand input command history references on completion.
167This mirrors the optional behavior of tcsh (its autoexpand and histlit). 181This mirrors the optional behavior of tcsh (its autoexpand and histlit).
168 182
@@ -171,30 +185,55 @@ If the value is `history', then the expansion is only when inserting
171into the buffer's input ring. See also `comint-magic-space' and 185into the buffer's input ring. See also `comint-magic-space' and
172`comint-dynamic-complete'. 186`comint-dynamic-complete'.
173 187
174This variable is buffer-local.") 188This variable is buffer-local."
175 189 :type '(choice (const :tag "off" nil)
176(defvar comint-input-ignoredups nil 190 (const :tag "on" t)
191 (const input)
192 (const history))
193 :group 'comint)
194
195(defface comint-input-face '((((class color)
196 (background dark))
197 (:foreground "red"))
198 (((class color)
199 (background light))
200 (:foreground "blue"))
201 (t
202 (:bold t)))
203 "How to display user input for comint shells."
204 :group 'comint)
205
206(defcustom comint-input-ignoredups nil
177 "*If non-nil, don't add input matching the last on the input ring. 207 "*If non-nil, don't add input matching the last on the input ring.
178This mirrors the optional behavior of bash. 208This mirrors the optional behavior of bash.
179 209
180This variable is buffer-local.") 210This variable is buffer-local."
211 :type 'boolean
212 :group 'comint)
181 213
182(defvar comint-input-ring-file-name nil 214(defcustom comint-input-ring-file-name nil
183 "*If non-nil, name of the file to read/write input history. 215 "*If non-nil, name of the file to read/write input history.
184See also `comint-read-input-ring' and `comint-write-input-ring'. 216See also `comint-read-input-ring' and `comint-write-input-ring'.
185 217
186This variable is buffer-local, and is a good thing to set in mode hooks.") 218This variable is buffer-local, and is a good thing to set in mode hooks."
219 :type 'boolean
220 :group 'comint)
187 221
188(defvar comint-scroll-to-bottom-on-input nil 222(defcustom comint-scroll-to-bottom-on-input nil
189 "*Controls whether input to interpreter causes window to scroll. 223 "*Controls whether input to interpreter causes window to scroll.
190If nil, then do not scroll. If t or `all', scroll all windows showing buffer. 224If nil, then do not scroll. If t or `all', scroll all windows showing buffer.
191If `this', scroll only the selected window. 225If `this', scroll only the selected window.
192 226
193The default is nil. 227The default is nil.
194 228
195See `comint-preinput-scroll-to-bottom'. This variable is buffer-local.") 229See `comint-preinput-scroll-to-bottom'. This variable is buffer-local."
230 :type '(choice (const :tag "off" nil)
231 (const t)
232 (const all)
233 (const this))
234 :group 'comint)
196 235
197(defvar comint-scroll-to-bottom-on-output nil 236(defcustom comint-scroll-to-bottom-on-output nil
198 "*Controls whether interpreter output causes window to scroll. 237 "*Controls whether interpreter output causes window to scroll.
199If nil, then do not scroll. If t or `all', scroll all windows showing buffer. 238If nil, then do not scroll. If t or `all', scroll all windows showing buffer.
200If `this', scroll only the selected window. 239If `this', scroll only the selected window.
@@ -203,34 +242,49 @@ If `others', scroll only those that are not the selected window.
203The default is nil. 242The default is nil.
204 243
205See variable `comint-scroll-show-maximum-output' and function 244See variable `comint-scroll-show-maximum-output' and function
206`comint-postoutput-scroll-to-bottom'. This variable is buffer-local.") 245`comint-postoutput-scroll-to-bottom'. This variable is buffer-local."
207 246 :type '(choice (const :tag "off" nil)
208(defvar comint-scroll-show-maximum-output nil 247 (const t)
248 (const all)
249 (const this)
250 (const others))
251 :group 'comint)
252
253(defcustom comint-scroll-show-maximum-output nil
209 "*Controls how interpreter output causes window to scroll. 254 "*Controls how interpreter output causes window to scroll.
210If non-nil, then show the maximum output when the window is scrolled. 255If non-nil, then show the maximum output when the window is scrolled.
211 256
212See variable `comint-scroll-to-bottom-on-output' and function 257See variable `comint-scroll-to-bottom-on-output' and function
213`comint-postoutput-scroll-to-bottom'. This variable is buffer-local.") 258`comint-postoutput-scroll-to-bottom'. This variable is buffer-local."
259 :type 'boolean
260 :group 'comint)
214 261
215(defvar comint-buffer-maximum-size 1024 262(defcustom comint-buffer-maximum-size 1024
216 "*The maximum size in lines for comint buffers. 263 "*The maximum size in lines for comint buffers.
217Comint buffers are truncated from the top to be no greater than this number, if 264Comint buffers are truncated from the top to be no greater than this number, if
218the function `comint-truncate-buffer' is on `comint-output-filter-functions'.") 265the function `comint-truncate-buffer' is on `comint-output-filter-functions'."
266 :type 'integer
267 :group 'comint)
219 268
220(defvar comint-input-ring-size 32 269(defvar comint-input-ring-size 32
221 "Size of input history ring.") 270 "Size of input history ring.")
222 271
223(defvar comint-process-echoes nil 272(defcustom comint-process-echoes nil
224 "*If non-nil, assume that the subprocess echoes any input. 273 "*If non-nil, assume that the subprocess echoes any input.
225If so, delete one copy of the input so that only one copy eventually 274If so, delete one copy of the input so that only one copy eventually
226appears in the buffer. 275appears in the buffer.
227 276
228This variable is buffer-local.") 277This variable is buffer-local."
278 :type 'boolean
279 :group 'comint)
229 280
230(defvar comint-password-prompt-regexp 281;; AIX puts the name of the person being su'd to in from of the prompt.
282(defcustom comint-password-prompt-regexp
231 "\\(\\([Oo]ld \\|[Nn]ew \\|'s \\|^\\)[Pp]assword\\|pass phrase\\):\\s *\\'" 283 "\\(\\([Oo]ld \\|[Nn]ew \\|'s \\|^\\)[Pp]assword\\|pass phrase\\):\\s *\\'"
232 "*Regexp matching prompts for passwords in the inferior process. 284 "*Regexp matching prompts for passwords in the inferior process.
233This is used by `comint-watch-for-password-prompt'.") 285This is used by `comint-watch-for-password-prompt'."
286 :type 'regexp
287 :group 'comint)
234 288
235;; Here are the per-interpreter hooks. 289;; Here are the per-interpreter hooks.
236(defvar comint-get-old-input (function comint-get-old-input-default) 290(defvar comint-get-old-input (function comint-get-old-input-default)
@@ -240,6 +294,18 @@ It returns the text to be submitted as process input. The default is
240`comint-get-old-input-default', which grabs the current line, and strips off 294`comint-get-old-input-default', which grabs the current line, and strips off
241leading text matching `comint-prompt-regexp'.") 295leading text matching `comint-prompt-regexp'.")
242 296
297;; XEmacs - fsf doesn't have this, and I think it ought to default to 't'
298;; because it's good idiot-proof interface. --stig
299(defcustom comint-append-old-input t
300 "*If nil, old text selected by \\[comint-send-input] is re-sent immediately.
301If non-nil, the old text is appended to the end of the buffer,
302and a prompting message is printed.
303
304This flag does not affect the behavior of \\[comint-send-input]
305after the process output mark."
306 :type 'boolean
307 :group 'comint)
308
243(defvar comint-dynamic-complete-functions 309(defvar comint-dynamic-complete-functions
244 '(comint-replace-by-expanded-history comint-dynamic-complete-filename) 310 '(comint-replace-by-expanded-history comint-dynamic-complete-filename)
245 "List of functions called to perform completion. 311 "List of functions called to perform completion.
@@ -277,20 +343,26 @@ massage the input string, put a different function here.
277`comint-simple-send' just sends the string plus a newline. 343`comint-simple-send' just sends the string plus a newline.
278This is called from the user command `comint-send-input'.") 344This is called from the user command `comint-send-input'.")
279 345
280(defvar comint-eol-on-send t 346(defcustom comint-eol-on-send t
281 "*Non-nil means go to the end of the line before sending input. 347 "*Non-nil means go to the end of the line before sending input.
282See `comint-send-input'.") 348See `comint-send-input'."
349 :type 'boolean
350 :group 'comint)
283 351
284(defvar comint-mode-hook '() 352(defcustom comint-mode-hook '()
285 "Called upon entry into comint-mode 353 "Called upon entry into comint-mode
286This is run before the process is cranked up.") 354This is run before the process is cranked up."
355 :type 'hook
356 :group 'comint)
287 357
288(defvar comint-exec-hook '() 358(defcustom comint-exec-hook '()
289 "Called each time a process is exec'd by `comint-exec'. 359 "Called each time a process is exec'd by `comint-exec'.
290This is called after the process is cranked up. It is useful for things that 360This is called after the process is cranked up. It is useful for things that
291must be done each time a process is executed in a comint mode buffer (e.g., 361must be done each time a process is executed in a comint mode buffer (e.g.,
292`(process-kill-without-query)'). In contrast, the `comint-mode-hook' is only 362`(process-kill-without-query)'). In contrast, the `comint-mode-hook' is only
293executed once when the buffer is created.") 363executed once when the buffer is created."
364 :type 'hook
365 :group 'comint)
294 366
295(defvar comint-mode-map nil) 367(defvar comint-mode-map nil)
296 368
@@ -1813,27 +1885,35 @@ See `comint-prompt-regexp'."
1813;; Commands like this are fine things to put in load hooks if you 1885;; Commands like this are fine things to put in load hooks if you
1814;; want them present in specific modes. 1886;; want them present in specific modes.
1815 1887
1816(defvar comint-completion-autolist nil 1888(defcustom comint-completion-autolist nil
1817 "*If non-nil, automatically list possibilities on partial completion. 1889 "*If non-nil, automatically list possibilities on partial completion.
1818This mirrors the optional behavior of tcsh.") 1890This mirrors the optional behavior of tcsh."
1891 :type 'boolean
1892 :group 'comint-completion)
1819 1893
1820(defvar comint-completion-addsuffix t 1894(defcustom comint-completion-addsuffix t
1821 "*If non-nil, add a `/' to completed directories, ` ' to file names. 1895 "*If non-nil, add a `/' to completed directories, ` ' to file names.
1822If a cons pair, it should be of the form (DIRSUFFIX . FILESUFFIX) where 1896If a cons pair, it should be of the form (DIRSUFFIX . FILESUFFIX) where
1823DIRSUFFIX and FILESUFFIX are strings added on unambiguous or exact completion. 1897DIRSUFFIX and FILESUFFIX are strings added on unambiguous or exact completion.
1824This mirrors the optional behavior of tcsh.") 1898This mirrors the optional behavior of tcsh."
1899 :type 'boolean
1900 :group 'comint-completion)
1825 1901
1826(defvar comint-completion-recexact nil 1902(defcustom comint-completion-recexact nil
1827 "*If non-nil, use shortest completion if characters cannot be added. 1903 "*If non-nil, use shortest completion if characters cannot be added.
1828This mirrors the optional behavior of tcsh. 1904This mirrors the optional behavior of tcsh.
1829 1905
1830A non-nil value is useful if `comint-completion-autolist' is non-nil too.") 1906A non-nil value is useful if `comint-completion-autolist' is non-nil too."
1907 :type 'boolean
1908 :group 'comint-completion)
1831 1909
1832(defvar comint-completion-fignore nil 1910(defcustom comint-completion-fignore nil
1833 "*List of suffixes to be disregarded during file completion. 1911 "*List of suffixes to be disregarded during file completion.
1834This mirrors the optional behavior of bash and tcsh. 1912This mirrors the optional behavior of bash and tcsh.
1835 1913
1836Note that this applies to `comint-dynamic-complete-filename' only.") 1914Note that this applies to `comint-dynamic-complete-filename' only."
1915 :type '(repeat (string :tag "Suffix"))
1916 :group 'comint-completion)
1837 1917
1838(defvar comint-file-name-prefix "" 1918(defvar comint-file-name-prefix ""
1839 "Prefix prepended to absolute file names taken from process input. 1919 "Prefix prepended to absolute file names taken from process input.
@@ -1849,7 +1929,7 @@ directory tracking functions.")
1849This is a good thing to set in mode hooks.") 1929This is a good thing to set in mode hooks.")
1850 1930
1851(defvar comint-file-name-quote-list nil 1931(defvar comint-file-name-quote-list nil
1852 "List of characters to quote with `\\' when in a file name. 1932 "List of characters to quote with `\' when in a file name.
1853 1933
1854This is a good thing to set in mode hooks.") 1934This is a good thing to set in mode hooks.")
1855 1935
diff --git a/lisp/shell.el b/lisp/shell.el
index 97e9589be27..690ff34fc2c 100644
--- a/lisp/shell.el
+++ b/lisp/shell.el
@@ -1,6 +1,6 @@
1;;; shell.el --- specialized comint.el for running the shell. 1;;; shell.el --- specialized comint.el for running the shell.
2 2
3;; Copyright (C) 1988, 1993, 1994, 1995, 1996 Free Software Foundation, Inc. 3;; Copyright (C) 1988, 93, 94, 95, 96, 1997 Free Software Foundation, Inc.
4 4
5;; Author: Olin Shivers <shivers@cs.cmu.edu> 5;; Author: Olin Shivers <shivers@cs.cmu.edu>
6;; Maintainer: Simon Marshall <simon@gnu.ai.mit.edu> 6;; Maintainer: Simon Marshall <simon@gnu.ai.mit.edu>
@@ -106,6 +106,19 @@
106 106
107;;; Customization and Buffer Variables 107;;; Customization and Buffer Variables
108 108
109(defgroup shell nil
110 "Running shell from within Emacs buffers"
111 :group 'processes
112 :group 'unix)
113
114(defgroup shell-directories nil
115 "Directory support in shell mode"
116 :group 'shell)
117
118(defgroup shell-faces nil
119 "Faces in shell buffers"
120 :group 'shell)
121
109;;;###autoload 122;;;###autoload
110(defvar shell-prompt-pattern "^[^#$%>\n]*[#$%>] *" 123(defvar shell-prompt-pattern "^[^#$%>\n]*[#$%>] *"
111 "Regexp to match prompts in the inferior shell. 124 "Regexp to match prompts in the inferior shell.
@@ -119,13 +132,15 @@ on lines which don't start with a prompt.
119 132
120This is a fine thing to set in your `.emacs' file.") 133This is a fine thing to set in your `.emacs' file.")
121 134
122(defvar shell-completion-fignore nil 135(defcustom shell-completion-fignore nil
123 "*List of suffixes to be disregarded during file/command completion. 136 "*List of suffixes to be disregarded during file/command completion.
124This variable is used to initialize `comint-completion-fignore' in the shell 137This variable is used to initialize `comint-completion-fignore' in the shell
125buffer. The default is nil, for compatibility with most shells. 138buffer. The default is nil, for compatibility with most shells.
126Some people like (\"~\" \"#\" \"%\"). 139Some people like (\"~\" \"#\" \"%\").
127 140
128This is a fine thing to set in your `.emacs' file.") 141This is a fine thing to set in your `.emacs' file."
142 :type '(repeat (string :tag "Suffix"))
143 :group 'shell)
129 144
130(defvar shell-delimiter-argument-list '(?\| ?& ?< ?> ?\( ?\) ?\;) 145(defvar shell-delimiter-argument-list '(?\| ?& ?< ?> ?\( ?\) ?\;)
131 "List of characters to recognise as separate arguments. 146 "List of characters to recognise as separate arguments.
@@ -166,57 +181,79 @@ shell buffer.
166 181
167This is a fine thing to set in your `.emacs' file.") 182This is a fine thing to set in your `.emacs' file.")
168 183
169(defvar shell-command-regexp "[^;&|\n]+" 184(defcustom shell-command-regexp "[^;&|\n]+"
170 "*Regexp to match a single command within a pipeline. 185 "*Regexp to match a single command within a pipeline.
171This is used for directory tracking and does not do a perfect job.") 186This is used for directory tracking and does not do a perfect job."
187 :type 'regexp
188 :group 'shell)
172 189
173(defvar shell-completion-execonly t 190(defcustom shell-completion-execonly t
174 "*If non-nil, use executable files only for completion candidates. 191 "*If non-nil, use executable files only for completion candidates.
175This mirrors the optional behavior of tcsh. 192This mirrors the optional behavior of tcsh.
176 193
177Detecting executability of files may slow command completion considerably.") 194Detecting executability of files may slow command completion considerably."
195 :type 'boolean
196 :group 'shell)
178 197
179(defvar shell-popd-regexp "popd" 198(defcustom shell-popd-regexp "popd"
180 "*Regexp to match subshell commands equivalent to popd.") 199 "*Regexp to match subshell commands equivalent to popd."
200 :type 'regexp
201 :group 'shell-directories)
181 202
182(defvar shell-pushd-regexp "pushd" 203(defcustom shell-pushd-regexp "pushd"
183 "*Regexp to match subshell commands equivalent to pushd.") 204 "*Regexp to match subshell commands equivalent to pushd."
205 :type 'regexp
206 :group 'shell-directories)
184 207
185(defvar shell-pushd-tohome nil 208(defcustom shell-pushd-tohome nil
186 "*If non-nil, make pushd with no arg behave as \"pushd ~\" (like cd). 209 "*If non-nil, make pushd with no arg behave as \"pushd ~\" (like cd).
187This mirrors the optional behavior of tcsh.") 210This mirrors the optional behavior of tcsh."
211 :type 'boolean
212 :group 'shell-directories)
188 213
189(defvar shell-pushd-dextract nil 214(defcustom shell-pushd-dextract nil
190 "*If non-nil, make \"pushd +n\" pop the nth dir to the stack top. 215 "*If non-nil, make \"pushd +n\" pop the nth dir to the stack top.
191This mirrors the optional behavior of tcsh.") 216This mirrors the optional behavior of tcsh."
217 :type 'boolean
218 :group 'shell-directories)
192 219
193(defvar shell-pushd-dunique nil 220(defcustom shell-pushd-dunique nil
194 "*If non-nil, make pushd only add unique directories to the stack. 221 "*If non-nil, make pushd only add unique directories to the stack.
195This mirrors the optional behavior of tcsh.") 222This mirrors the optional behavior of tcsh."
223 :type 'boolean
224 :group 'shell-directories)
196 225
197(defvar shell-cd-regexp "cd" 226(defcustom shell-cd-regexp "cd"
198 "*Regexp to match subshell commands equivalent to cd.") 227 "*Regexp to match subshell commands equivalent to cd."
228 :type 'regexp
229 :group 'shell-directories)
199 230
200(defvar shell-chdrive-regexp 231(defcustom shell-chdrive-regexp
201 (if (memq system-type '(ms-dos windows-nt)) 232 (if (memq system-type '(ms-dos windows-nt))
202 ; NetWare allows the five chars between upper and lower alphabetics. 233 ; NetWare allows the five chars between upper and lower alphabetics.
203 "[]a-zA-Z^_`\\[\\\\]:" 234 "[]a-zA-Z^_`\\[\\\\]:"
204 nil) 235 nil)
205 "*If non-nil, is regexp used to track drive changes.") 236 "*If non-nil, is regexp used to track drive changes."
237 :type 'regexp
238 :group 'shell-directories)
206 239
207(defvar explicit-shell-file-name nil 240(defcustom explicit-shell-file-name nil
208 "*If non-nil, is file name to use for explicitly requested inferior shell.") 241 "*If non-nil, is file name to use for explicitly requested inferior shell."
242 :type '(choice (const :tag "None" nil) file)
243 :group 'shell)
209 244
210(defvar explicit-csh-args 245(defcustom explicit-csh-args
211 (if (eq system-type 'hpux) 246 (if (eq system-type 'hpux)
212 ;; -T persuades HP's csh not to think it is smarter 247 ;; -T persuades HP's csh not to think it is smarter
213 ;; than us about what terminal modes to use. 248 ;; than us about what terminal modes to use.
214 '("-i" "-T") 249 '("-i" "-T")
215 '("-i")) 250 '("-i"))
216 "*Args passed to inferior shell by M-x shell, if the shell is csh. 251 "*Args passed to inferior shell by M-x shell, if the shell is csh.
217Value is a list of strings, which may be nil.") 252Value is a list of strings, which may be nil."
253 :type '(repeat (string :tag "Argument"))
254 :group 'shell)
218 255
219(defvar shell-input-autoexpand 'history 256(defcustom shell-input-autoexpand 'history
220 "*If non-nil, expand input command history references on completion. 257 "*If non-nil, expand input command history references on completion.
221This mirrors the optional behavior of tcsh (its autoexpand and histlit). 258This mirrors the optional behavior of tcsh (its autoexpand and histlit).
222 259
@@ -226,7 +263,9 @@ into the buffer's input ring. See also `comint-magic-space' and
226`comint-dynamic-complete'. 263`comint-dynamic-complete'.
227 264
228This variable supplies a default for `comint-input-autoexpand', 265This variable supplies a default for `comint-input-autoexpand',
229for Shell mode only.") 266for Shell mode only."
267 :type '(choice (const nil) (const input) (const history))
268 :type 'shell)
230 269
231(defvar shell-dirstack nil 270(defvar shell-dirstack nil
232 "List of directories saved by pushd in this buffer's shell. 271 "List of directories saved by pushd in this buffer's shell.
@@ -260,8 +299,10 @@ Thus, this does not include the shell's current directory.")
260 shell-replace-by-expanded-directory) 299 shell-replace-by-expanded-directory)
261 'complete-expand))) 300 'complete-expand)))
262 301
263(defvar shell-mode-hook '() 302(defcustom shell-mode-hook '()
264 "*Hook for customising Shell mode.") 303 "*Hook for customising Shell mode."
304 :type 'hook
305 :group 'shell)
265 306
266(defvar shell-font-lock-keywords 307(defvar shell-font-lock-keywords
267 (list (cons shell-prompt-pattern 'font-lock-keyword-face) 308 (list (cons shell-prompt-pattern 'font-lock-keyword-face)