diff options
| author | Stefan Kangas | 2025-02-21 18:48:12 +0100 |
|---|---|---|
| committer | Stefan Kangas | 2025-02-21 19:05:48 +0100 |
| commit | 4ece0e2e46b1eeb315b9ebcdcee09679319128f9 (patch) | |
| tree | c85391655a3f6a7effb326d5be3be8ac5e8f5162 | |
| parent | ecddc8227d9be8283d9bb47639a61c888a036896 (diff) | |
| download | emacs-4ece0e2e46b1eeb315b9ebcdcee09679319128f9.tar.gz emacs-4ece0e2e46b1eeb315b9ebcdcee09679319128f9.zip | |
Delete note on Emacs 19 modes from comint.el
* lisp/comint.el: Delete note on how to convert pre-Emacs 20 modes to
use comint.el. Emacs 20 was released in 1997, so it's safe to assume
that any relevant code has been updated in the last three decades.
| -rw-r--r-- | lisp/comint.el | 80 |
1 files changed, 0 insertions, 80 deletions
diff --git a/lisp/comint.el b/lisp/comint.el index cece5545bfb..c1028bc93dc 100644 --- a/lisp/comint.el +++ b/lisp/comint.el | |||
| @@ -4350,85 +4350,5 @@ return nil." | |||
| 4350 | (setq comint--indirect-buffer nil))) | 4350 | (setq comint--indirect-buffer nil))) |
| 4351 | 4351 | ||
| 4352 | 4352 | ||
| 4353 | |||
| 4354 | ;;; Converting process modes to use comint mode | ||
| 4355 | ;;============================================================================ | ||
| 4356 | ;; The code in the Emacs 19 distribution has all been modified to use comint | ||
| 4357 | ;; where needed. However, there are `third-party' packages out there that | ||
| 4358 | ;; still use the old shell mode. Here's a guide to conversion. | ||
| 4359 | ;; | ||
| 4360 | ;; Renaming variables | ||
| 4361 | ;; Most of the work is renaming variables and functions. These are the common | ||
| 4362 | ;; ones: | ||
| 4363 | ;; Local variables: | ||
| 4364 | ;; last-input-start comint-last-input-start | ||
| 4365 | ;; last-input-end comint-last-input-end | ||
| 4366 | ;; shell-prompt-pattern comint-prompt-regexp | ||
| 4367 | ;; shell-set-directory-error-hook <no equivalent> | ||
| 4368 | ;; Miscellaneous: | ||
| 4369 | ;; shell-set-directory <unnecessary> | ||
| 4370 | ;; shell-mode-map comint-mode-map | ||
| 4371 | ;; Commands: | ||
| 4372 | ;; shell-send-input comint-send-input | ||
| 4373 | ;; shell-send-eof comint-delchar-or-maybe-eof | ||
| 4374 | ;; kill-shell-input comint-kill-input | ||
| 4375 | ;; interrupt-shell-subjob comint-interrupt-subjob | ||
| 4376 | ;; stop-shell-subjob comint-stop-subjob | ||
| 4377 | ;; quit-shell-subjob comint-quit-subjob | ||
| 4378 | ;; kill-shell-subjob comint-kill-subjob | ||
| 4379 | ;; kill-output-from-shell comint-delete-output | ||
| 4380 | ;; show-output-from-shell comint-show-output | ||
| 4381 | ;; copy-last-shell-input Use comint-previous-input/comint-next-input | ||
| 4382 | ;; | ||
| 4383 | ;; SHELL-SET-DIRECTORY is gone, its functionality taken over by | ||
| 4384 | ;; SHELL-DIRECTORY-TRACKER, the shell mode's comint-input-filter-functions. | ||
| 4385 | ;; Comint mode does not provide functionality equivalent to | ||
| 4386 | ;; shell-set-directory-error-hook; it is gone. | ||
| 4387 | ;; | ||
| 4388 | ;; comint-last-input-start is provided for modes which want to munge | ||
| 4389 | ;; the buffer after input is sent, perhaps because the inferior | ||
| 4390 | ;; insists on echoing the input. The LAST-INPUT-START variable in | ||
| 4391 | ;; the old shell package was used to implement a history mechanism, | ||
| 4392 | ;; but you should think twice before using comint-last-input-start | ||
| 4393 | ;; for this; the input history ring often does the job better. | ||
| 4394 | ;; | ||
| 4395 | ;; If you are implementing some process-in-a-buffer mode, called foo-mode, do | ||
| 4396 | ;; *not* create the comint-mode local variables in your foo-mode function. | ||
| 4397 | ;; This is not modular. Instead, call comint-mode, and let *it* create the | ||
| 4398 | ;; necessary comint-specific local variables. Then create the | ||
| 4399 | ;; foo-mode-specific local variables in foo-mode. Set the buffer's keymap to | ||
| 4400 | ;; be foo-mode-map, and its mode to be foo-mode. Set the comint-mode hooks | ||
| 4401 | ;; (comint-{prompt-regexp, input-filter, input-filter-functions, | ||
| 4402 | ;; get-old-input) that need to be different from the defaults. Call | ||
| 4403 | ;; foo-mode-hook, and you're done. Don't run the comint-mode hook yourself; | ||
| 4404 | ;; comint-mode will take care of it. The following example, from shell.el, | ||
| 4405 | ;; is typical: | ||
| 4406 | ;; | ||
| 4407 | ;; (defvar shell-mode-map | ||
| 4408 | ;; (let ((map (make-sparse-keymap))) | ||
| 4409 | ;; (set-keymap-parent map comint-mode-map) | ||
| 4410 | ;; (define-key map "\C-c\C-f" 'shell-forward-command) | ||
| 4411 | ;; (define-key map "\C-c\C-b" 'shell-backward-command) | ||
| 4412 | ;; (define-key map "\t" 'completion-at-point) | ||
| 4413 | ;; (define-key map "\M-?" | ||
| 4414 | ;; 'comint-dynamic-list-filename-completions) | ||
| 4415 | ;; map)) | ||
| 4416 | ;; | ||
| 4417 | ;; (define-derived-mode shell-mode comint-mode "Shell" | ||
| 4418 | ;; "Doc." | ||
| 4419 | ;; (setq comint-prompt-regexp shell-prompt-pattern) | ||
| 4420 | ;; (setq-local shell-directory-stack nil) | ||
| 4421 | ;; (add-hook 'comint-input-filter-functions 'shell-directory-tracker)) | ||
| 4422 | ;; | ||
| 4423 | ;; | ||
| 4424 | ;; Completion for comint-mode users | ||
| 4425 | ;; | ||
| 4426 | ;; For modes that use comint-mode, comint-dynamic-complete-functions is the | ||
| 4427 | ;; hook to add completion functions to. Functions on this list should return | ||
| 4428 | ;; the completion data according to the documentation of | ||
| 4429 | ;; `completion-at-point-functions' | ||
| 4430 | |||
| 4431 | |||
| 4432 | (provide 'comint) | 4353 | (provide 'comint) |
| 4433 | |||
| 4434 | ;;; comint.el ends here | 4354 | ;;; comint.el ends here |