Mercurial > emacs
comparison lisp/shell.el @ 5538:9d84549e89b4
(shell-input-autoexpand): New variable.
(shell-mode): Set comint-input-autoexpand.
(shell-mode): Don't call shell-dirstack-message.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Sun, 09 Jan 1994 17:11:57 +0000 |
parents | 239620e1795d |
children | 7051027369d6 |
comparison
equal
deleted
inserted
replaced
5537:899159133053 | 5538:9d84549e89b4 |
---|---|
203 '("-i" "-T") | 203 '("-i" "-T") |
204 '("-i")) | 204 '("-i")) |
205 "*Args passed to inferior shell by M-x shell, if the shell is csh. | 205 "*Args passed to inferior shell by M-x shell, if the shell is csh. |
206 Value is a list of strings, which may be nil.") | 206 Value is a list of strings, which may be nil.") |
207 | 207 |
208 (defvar shell-input-autoexpand 'history | |
209 "*If non-nil, expand input command history references on completion. | |
210 This mirrors the optional behavior of tcsh (its autoexpand and histlit). | |
211 | |
212 If the value is `input', then the expansion is seen on input. | |
213 If the value is `history', then the expansion is only when inserting | |
214 into the buffer's input ring. See also `comint-magic-space' and | |
215 `comint-dynamic-complete'. | |
216 | |
217 This variable supplies a default for `comint-input-autoexpand', | |
218 for Shell mode only.") | |
219 | |
208 ;;; All the above vars aren't prefixed "cmushell-" to make them | 220 ;;; All the above vars aren't prefixed "cmushell-" to make them |
209 ;;; backwards compatible w/shell.el and old .emacs files. | 221 ;;; backwards compatible w/shell.el and old .emacs files. |
210 | 222 |
211 (defvar shell-dirstack nil | 223 (defvar shell-dirstack nil |
212 "List of directories saved by pushd in this buffer's shell. | 224 "List of directories saved by pushd in this buffer's shell. |
290 (setq shell-dirstack nil) | 302 (setq shell-dirstack nil) |
291 (setq shell-last-dir nil) | 303 (setq shell-last-dir nil) |
292 (make-local-variable 'shell-dirtrackp) | 304 (make-local-variable 'shell-dirtrackp) |
293 (setq shell-dirtrackp t) | 305 (setq shell-dirtrackp t) |
294 (setq comint-input-sentinel 'shell-directory-tracker) | 306 (setq comint-input-sentinel 'shell-directory-tracker) |
307 (setq comint-input-autoexpand shell-input-autoexpand) | |
295 ;; shell-dependent assignments. | 308 ;; shell-dependent assignments. |
296 (let ((shell (car (process-command (get-buffer-process (current-buffer)))))) | 309 (let ((shell (car (process-command (get-buffer-process (current-buffer)))))) |
297 (setq comint-input-ring-file-name | 310 (setq comint-input-ring-file-name |
298 (or (getenv "HISTFILE") | 311 (or (getenv "HISTFILE") |
299 (cond ((string-match "csh$" shell) "~/.history") | 312 (cond ((string-match "csh$" shell) "~/.history") |
300 ((string-match "bash$" shell) "~/.bash_history") | 313 ((string-match "bash$" shell) "~/.bash_history") |
301 ((string-match "ksh$" shell) "~/.sh_history") | 314 ((string-match "ksh$" shell) "~/.sh_history") |
302 (t "~/.history"))))) | 315 (t "~/.history"))))) |
303 (run-hooks 'shell-mode-hook) | 316 (run-hooks 'shell-mode-hook) |
304 (comint-read-input-ring t) | 317 (comint-read-input-ring t)) |
305 (shell-dirstack-message)) | |
306 | 318 |
307 ;;;###autoload | 319 ;;;###autoload |
308 (defun shell () | 320 (defun shell () |
309 "Run an inferior shell, with I/O through buffer *shell*. | 321 "Run an inferior shell, with I/O through buffer *shell*. |
310 If buffer exists but shell process is not running, make new shell. | 322 If buffer exists but shell process is not running, make new shell. |