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 | |
| 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.
| -rw-r--r-- | lisp/ChangeLog | 7 | ||||
| -rw-r--r-- | lisp/shell.el | 39 | ||||
| -rw-r--r-- | lisp/simple.el | 25 |
3 files changed, 35 insertions, 36 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index beaee515a52..bac4931f4eb 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,10 @@ | |||
| 1 | 2011-05-12 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 2 | |||
| 3 | * shell.el (shell-completion-vars): New function. | ||
| 4 | (shell-mode): | ||
| 5 | * simple.el (read-shell-command): Use it. | ||
| 6 | (blink-matching-open): No need for " [...]" in minibuffer-message. | ||
| 7 | |||
| 1 | 2011-05-12 Glenn Morris <rgm@gnu.org> | 8 | 2011-05-12 Glenn Morris <rgm@gnu.org> |
| 2 | 9 | ||
| 3 | * calendar/appt.el (appt-now-displayed): Remove pointless variable. | 10 | * calendar/appt.el (appt-now-displayed): Remove pointless variable. |
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. |
diff --git a/lisp/simple.el b/lisp/simple.el index 5efb6769e17..ac53ce3add1 100644 --- a/lisp/simple.el +++ b/lisp/simple.el | |||
| @@ -36,10 +36,6 @@ | |||
| 36 | ;;; From compile.el | 36 | ;;; From compile.el |
| 37 | (defvar compilation-current-error) | 37 | (defvar compilation-current-error) |
| 38 | (defvar compilation-context-lines) | 38 | (defvar compilation-context-lines) |
| 39 | ;;; From comint.el | ||
| 40 | (defvar comint-file-name-quote-list) | ||
| 41 | (defvar comint-file-name-chars) | ||
| 42 | (defvar comint-delimiter-argument-list) | ||
| 43 | 39 | ||
| 44 | (defcustom idle-update-delay 0.5 | 40 | (defcustom idle-update-delay 0.5 |
| 45 | "Idle time delay before updating various things on the screen. | 41 | "Idle time delay before updating various things on the screen. |
| @@ -2167,12 +2163,7 @@ to the end of the list of defaults just after the default value." | |||
| 2167 | (append minibuffer-default commands) | 2163 | (append minibuffer-default commands) |
| 2168 | (cons minibuffer-default commands)))) | 2164 | (cons minibuffer-default commands)))) |
| 2169 | 2165 | ||
| 2170 | (defvar shell-delimiter-argument-list) | 2166 | (declare-function shell-completion-vars "shell" ()) |
| 2171 | (defvar shell-file-name-chars) | ||
| 2172 | (defvar shell-file-name-quote-list) | ||
| 2173 | (defvar shell-dynamic-complete-functions) | ||
| 2174 | ;; shell requires comint. | ||
| 2175 | (defvar comint-dynamic-complete-functions) | ||
| 2176 | 2167 | ||
| 2177 | (defvar minibuffer-local-shell-command-map | 2168 | (defvar minibuffer-local-shell-command-map |
| 2178 | (let ((map (make-sparse-keymap))) | 2169 | (let ((map (make-sparse-keymap))) |
| @@ -2189,15 +2180,7 @@ to `shell-command-history'." | |||
| 2189 | (require 'shell) | 2180 | (require 'shell) |
| 2190 | (minibuffer-with-setup-hook | 2181 | (minibuffer-with-setup-hook |
| 2191 | (lambda () | 2182 | (lambda () |
| 2192 | (set (make-local-variable 'comint-delimiter-argument-list) | 2183 | (shell-completion-vars) |
| 2193 | shell-delimiter-argument-list) | ||
| 2194 | (set (make-local-variable 'comint-file-name-chars) shell-file-name-chars) | ||
| 2195 | (set (make-local-variable 'comint-file-name-quote-list) | ||
| 2196 | shell-file-name-quote-list) | ||
| 2197 | (set (make-local-variable 'comint-dynamic-complete-functions) | ||
| 2198 | shell-dynamic-complete-functions) | ||
| 2199 | (add-hook 'completion-at-point-functions | ||
| 2200 | 'comint-completion-at-point nil 'local) | ||
| 2201 | (set (make-local-variable 'minibuffer-default-add-function) | 2184 | (set (make-local-variable 'minibuffer-default-add-function) |
| 2202 | 'minibuffer-default-add-shell-commands)) | 2185 | 'minibuffer-default-add-shell-commands)) |
| 2203 | (apply 'read-from-minibuffer prompt initial-contents | 2186 | (apply 'read-from-minibuffer prompt initial-contents |
| @@ -5589,10 +5572,10 @@ The function should return non-nil if the two tokens do not match.") | |||
| 5589 | (mismatch | 5572 | (mismatch |
| 5590 | (if blinkpos | 5573 | (if blinkpos |
| 5591 | (if (minibufferp) | 5574 | (if (minibufferp) |
| 5592 | (minibuffer-message " [Mismatched parentheses]") | 5575 | (minibuffer-message "Mismatched parentheses") |
| 5593 | (message "Mismatched parentheses")) | 5576 | (message "Mismatched parentheses")) |
| 5594 | (if (minibufferp) | 5577 | (if (minibufferp) |
| 5595 | (minibuffer-message " [Unmatched parenthesis]") | 5578 | (minibuffer-message "Unmatched parenthesis") |
| 5596 | (message "Unmatched parenthesis")))) | 5579 | (message "Unmatched parenthesis")))) |
| 5597 | ((not blinkpos) nil) | 5580 | ((not blinkpos) nil) |
| 5598 | ((pos-visible-in-window-p blinkpos) | 5581 | ((pos-visible-in-window-p blinkpos) |