diff options
| author | Stefan Monnier | 2011-05-12 09:55:10 -0300 |
|---|---|---|
| committer | Stefan Monnier | 2011-05-12 09:55:10 -0300 |
| commit | 914a0ae1bab4f6f76c0b2654e0ca78fdb07f294a (patch) | |
| tree | 8e185992974b0d3fd7ee592300f14444c53d2ef1 /lisp/shell.el | |
| parent | 98dc3df322a2706803625ddfce0038ce94eec5d8 (diff) | |
| download | emacs-914a0ae1bab4f6f76c0b2654e0ca78fdb07f294a.tar.gz emacs-914a0ae1bab4f6f76c0b2654e0ca78fdb07f294a.zip | |
* lisp/shell.el (shell-completion-vars): New function.
(shell-mode):
* lisp/simple.el (read-shell-command): Use it.
(blink-matching-open): No need for " [...]" in minibuffer-message.
Diffstat (limited to 'lisp/shell.el')
| -rw-r--r-- | lisp/shell.el | 39 |
1 files changed, 24 insertions, 15 deletions
diff --git a/lisp/shell.el b/lisp/shell.el index d6bc685618c..a05fefa9c11 100644 --- a/lisp/shell.el +++ b/lisp/shell.el | |||
| @@ -380,6 +380,25 @@ to `dirtrack-mode'." | |||
| 380 | :group 'shell | 380 | :group 'shell |
| 381 | :type '(choice (const nil) regexp)) | 381 | :type '(choice (const nil) regexp)) |
| 382 | 382 | ||
| 383 | (defun shell-completion-vars () | ||
| 384 | "Setup completion vars for `shell-mode' and `read-shell-command'." | ||
| 385 | (set (make-local-variable 'comint-completion-fignore) | ||
| 386 | shell-completion-fignore) | ||
| 387 | (set (make-local-variable 'comint-delimiter-argument-list) | ||
| 388 | shell-delimiter-argument-list) | ||
| 389 | (set (make-local-variable 'comint-file-name-chars) shell-file-name-chars) | ||
| 390 | (set (make-local-variable 'comint-file-name-quote-list) | ||
| 391 | shell-file-name-quote-list) | ||
| 392 | (set (make-local-variable 'comint-dynamic-complete-functions) | ||
| 393 | shell-dynamic-complete-functions) | ||
| 394 | (set (make-local-variable 'pcomplete-parse-arguments-function) | ||
| 395 | ;; FIXME: This function should be moved to shell.el. | ||
| 396 | #'pcomplete-parse-comint-arguments) | ||
| 397 | (setq comint-input-autoexpand shell-input-autoexpand) | ||
| 398 | ;; Not needed in shell-mode because it's inherited from comint-mode, but | ||
| 399 | ;; placed here for read-shell-command. | ||
| 400 | (add-hook 'completion-at-point-functions 'comint-completion-at-point nil t)) | ||
| 401 | |||
| 383 | (put 'shell-mode 'mode-class 'special) | 402 | (put 'shell-mode 'mode-class 'special) |
| 384 | 403 | ||
| 385 | (define-derived-mode shell-mode comint-mode "Shell" | 404 | (define-derived-mode shell-mode comint-mode "Shell" |
| @@ -437,22 +456,12 @@ Variables `comint-output-filter-functions', a hook, and | |||
| 437 | control whether input and output cause the window to scroll to the end of the | 456 | control whether input and output cause the window to scroll to the end of the |
| 438 | buffer." | 457 | buffer." |
| 439 | (setq comint-prompt-regexp shell-prompt-pattern) | 458 | (setq comint-prompt-regexp shell-prompt-pattern) |
| 440 | (setq comint-completion-fignore shell-completion-fignore) | 459 | (shell-completion-vars) |
| 441 | (setq comint-delimiter-argument-list shell-delimiter-argument-list) | ||
| 442 | (setq comint-file-name-chars shell-file-name-chars) | ||
| 443 | (setq comint-file-name-quote-list shell-file-name-quote-list) | ||
| 444 | (set (make-local-variable 'comint-dynamic-complete-functions) | ||
| 445 | shell-dynamic-complete-functions) | ||
| 446 | (set (make-local-variable 'paragraph-separate) "\\'") | 460 | (set (make-local-variable 'paragraph-separate) "\\'") |
| 447 | (make-local-variable 'paragraph-start) | 461 | (set (make-local-variable 'paragraph-start) comint-prompt-regexp) |
| 448 | (setq paragraph-start comint-prompt-regexp) | 462 | (set (make-local-variable 'font-lock-defaults) '(shell-font-lock-keywords t)) |
| 449 | (make-local-variable 'font-lock-defaults) | 463 | (set (make-local-variable 'shell-dirstack) nil) |
| 450 | (setq font-lock-defaults '(shell-font-lock-keywords t)) | 464 | (set (make-local-variable 'shell-last-dir) nil) |
| 451 | (make-local-variable 'shell-dirstack) | ||
| 452 | (setq shell-dirstack nil) | ||
| 453 | (make-local-variable 'shell-last-dir) | ||
| 454 | (setq shell-last-dir nil) | ||
| 455 | (setq comint-input-autoexpand shell-input-autoexpand) | ||
| 456 | (shell-dirtrack-mode 1) | 465 | (shell-dirtrack-mode 1) |
| 457 | ;; This is not really correct, since the shell buffer does not really | 466 | ;; This is not really correct, since the shell buffer does not really |
| 458 | ;; edit this directory. But it is useful in the buffer list and menus. | 467 | ;; edit this directory. But it is useful in the buffer list and menus. |