diff options
| author | Stefan Monnier | 2001-11-16 14:22:03 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2001-11-16 14:22:03 +0000 |
| commit | 038eed72fd6cadccfdeefcff653863144e251ee5 (patch) | |
| tree | 35fd44bccdd31754b98d0126f1654e02f44805c8 | |
| parent | 1508c0c8da4c75bcd1f9b271cb3d0ce81cc028e4 (diff) | |
| download | emacs-038eed72fd6cadccfdeefcff653863144e251ee5.tar.gz emacs-038eed72fd6cadccfdeefcff653863144e251ee5.zip | |
(comint-mode): Simplify.
(make-comint-in-buffer): Run `comint-mode' only if necessary.
| -rw-r--r-- | lisp/comint.el | 22 |
1 files changed, 6 insertions, 16 deletions
diff --git a/lisp/comint.el b/lisp/comint.el index 64f04904557..645e2ec1c7d 100644 --- a/lisp/comint.el +++ b/lisp/comint.el | |||
| @@ -478,14 +478,9 @@ to continue it. | |||
| 478 | 478 | ||
| 479 | Entry to this mode runs the hooks on `comint-mode-hook'." | 479 | Entry to this mode runs the hooks on `comint-mode-hook'." |
| 480 | (setq mode-line-process '(":%s")) | 480 | (setq mode-line-process '(":%s")) |
| 481 | (make-local-variable 'comint-last-input-start) | 481 | (set (make-local-variable 'comint-last-input-start) (point-min-marker)) |
| 482 | (setq comint-last-input-start (make-marker)) | 482 | (set (make-local-variable 'comint-last-input-end) (point-min-marker)) |
| 483 | (set-marker comint-last-input-start (point-min)) | 483 | (set (make-local-variable 'comint-last-output-start) (make-marker)) |
| 484 | (make-local-variable 'comint-last-input-end) | ||
| 485 | (setq comint-last-input-end (make-marker)) | ||
| 486 | (set-marker comint-last-input-end (point-min)) | ||
| 487 | (make-local-variable 'comint-last-output-start) | ||
| 488 | (setq comint-last-output-start (make-marker)) | ||
| 489 | (make-local-variable 'comint-last-output-overlay) | 484 | (make-local-variable 'comint-last-output-overlay) |
| 490 | (make-local-variable 'comint-last-prompt-overlay) | 485 | (make-local-variable 'comint-last-prompt-overlay) |
| 491 | (make-local-variable 'comint-prompt-regexp) ; Don't set; default | 486 | (make-local-variable 'comint-prompt-regexp) ; Don't set; default |
| @@ -504,10 +499,8 @@ Entry to this mode runs the hooks on `comint-mode-hook'." | |||
| 504 | (make-local-variable 'comint-input-autoexpand) | 499 | (make-local-variable 'comint-input-autoexpand) |
| 505 | (make-local-variable 'comint-input-ignoredups) | 500 | (make-local-variable 'comint-input-ignoredups) |
| 506 | (make-local-variable 'comint-delimiter-argument-list) | 501 | (make-local-variable 'comint-delimiter-argument-list) |
| 507 | (make-local-hook 'comint-dynamic-complete-functions) | ||
| 508 | (make-local-variable 'comint-completion-fignore) | 502 | (make-local-variable 'comint-completion-fignore) |
| 509 | (make-local-variable 'comint-get-old-input) | 503 | (make-local-variable 'comint-get-old-input) |
| 510 | (make-local-hook 'comint-input-filter-functions) | ||
| 511 | (make-local-variable 'comint-input-filter) | 504 | (make-local-variable 'comint-input-filter) |
| 512 | (make-local-variable 'comint-input-sender) | 505 | (make-local-variable 'comint-input-sender) |
| 513 | (make-local-variable 'comint-eol-on-send) | 506 | (make-local-variable 'comint-eol-on-send) |
| @@ -515,15 +508,11 @@ Entry to this mode runs the hooks on `comint-mode-hook'." | |||
| 515 | (make-local-variable 'comint-scroll-to-bottom-on-output) | 508 | (make-local-variable 'comint-scroll-to-bottom-on-output) |
| 516 | (make-local-variable 'comint-scroll-show-maximum-output) | 509 | (make-local-variable 'comint-scroll-show-maximum-output) |
| 517 | (add-hook 'pre-command-hook 'comint-preinput-scroll-to-bottom t t) | 510 | (add-hook 'pre-command-hook 'comint-preinput-scroll-to-bottom t t) |
| 518 | (make-local-hook 'comint-output-filter-functions) | ||
| 519 | (make-local-hook 'comint-exec-hook) | ||
| 520 | (make-local-variable 'comint-ptyp) | 511 | (make-local-variable 'comint-ptyp) |
| 521 | (make-local-variable 'comint-process-echoes) | 512 | (make-local-variable 'comint-process-echoes) |
| 522 | (make-local-variable 'comint-file-name-chars) | 513 | (make-local-variable 'comint-file-name-chars) |
| 523 | (make-local-variable 'comint-file-name-quote-list) | 514 | (make-local-variable 'comint-file-name-quote-list) |
| 524 | (make-local-variable 'comint-accum-marker) | 515 | (set (make-local-variable 'comint-accum-marker) (make-marker)) |
| 525 | (setq comint-accum-marker (make-marker)) | ||
| 526 | (set-marker comint-accum-marker nil) | ||
| 527 | ;; This behavior is not useful in comint buffers, and is annoying | 516 | ;; This behavior is not useful in comint buffers, and is annoying |
| 528 | (set (make-local-variable 'next-line-add-newlines) nil)) | 517 | (set (make-local-variable 'next-line-add-newlines) nil)) |
| 529 | 518 | ||
| @@ -660,7 +649,8 @@ If PROGRAM is a string, any more args are arguments to PROGRAM." | |||
| 660 | ;; comint mode. Otherwise, leave buffer and existing process alone. | 649 | ;; comint mode. Otherwise, leave buffer and existing process alone. |
| 661 | (unless (comint-check-proc buffer) | 650 | (unless (comint-check-proc buffer) |
| 662 | (with-current-buffer buffer | 651 | (with-current-buffer buffer |
| 663 | (comint-mode)) ; Install local vars, mode, keymap, ... | 652 | (unless (derived-mode-p 'comint-mode) |
| 653 | (comint-mode))) ; Install local vars, mode, keymap, ... | ||
| 664 | (comint-exec buffer name program startfile switches)) | 654 | (comint-exec buffer name program startfile switches)) |
| 665 | buffer) | 655 | buffer) |
| 666 | 656 | ||