From cdd622c1b2225ea59b8eb0a6bdac7e560296f05e Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Fri, 21 Feb 2025 18:48:12 +0100 Subject: [PATCH] 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. (cherry picked from commit 4ece0e2e46b1eeb315b9ebcdcee09679319128f9) --- lisp/comint.el | 80 -------------------------------------------------- 1 file changed, 80 deletions(-) diff --git a/lisp/comint.el b/lisp/comint.el index 94a40550229..4d60849c248 100644 --- a/lisp/comint.el +++ b/lisp/comint.el @@ -4341,85 +4341,5 @@ return nil." (setq comint--indirect-buffer nil))) - -;;; Converting process modes to use comint mode -;;============================================================================ -;; The code in the Emacs 19 distribution has all been modified to use comint -;; where needed. However, there are `third-party' packages out there that -;; still use the old shell mode. Here's a guide to conversion. -;; -;; Renaming variables -;; Most of the work is renaming variables and functions. These are the common -;; ones: -;; Local variables: -;; last-input-start comint-last-input-start -;; last-input-end comint-last-input-end -;; shell-prompt-pattern comint-prompt-regexp -;; shell-set-directory-error-hook -;; Miscellaneous: -;; shell-set-directory -;; shell-mode-map comint-mode-map -;; Commands: -;; shell-send-input comint-send-input -;; shell-send-eof comint-delchar-or-maybe-eof -;; kill-shell-input comint-kill-input -;; interrupt-shell-subjob comint-interrupt-subjob -;; stop-shell-subjob comint-stop-subjob -;; quit-shell-subjob comint-quit-subjob -;; kill-shell-subjob comint-kill-subjob -;; kill-output-from-shell comint-delete-output -;; show-output-from-shell comint-show-output -;; copy-last-shell-input Use comint-previous-input/comint-next-input -;; -;; SHELL-SET-DIRECTORY is gone, its functionality taken over by -;; SHELL-DIRECTORY-TRACKER, the shell mode's comint-input-filter-functions. -;; Comint mode does not provide functionality equivalent to -;; shell-set-directory-error-hook; it is gone. -;; -;; comint-last-input-start is provided for modes which want to munge -;; the buffer after input is sent, perhaps because the inferior -;; insists on echoing the input. The LAST-INPUT-START variable in -;; the old shell package was used to implement a history mechanism, -;; but you should think twice before using comint-last-input-start -;; for this; the input history ring often does the job better. -;; -;; If you are implementing some process-in-a-buffer mode, called foo-mode, do -;; *not* create the comint-mode local variables in your foo-mode function. -;; This is not modular. Instead, call comint-mode, and let *it* create the -;; necessary comint-specific local variables. Then create the -;; foo-mode-specific local variables in foo-mode. Set the buffer's keymap to -;; be foo-mode-map, and its mode to be foo-mode. Set the comint-mode hooks -;; (comint-{prompt-regexp, input-filter, input-filter-functions, -;; get-old-input) that need to be different from the defaults. Call -;; foo-mode-hook, and you're done. Don't run the comint-mode hook yourself; -;; comint-mode will take care of it. The following example, from shell.el, -;; is typical: -;; -;; (defvar shell-mode-map -;; (let ((map (make-sparse-keymap))) -;; (set-keymap-parent map comint-mode-map) -;; (define-key map "\C-c\C-f" 'shell-forward-command) -;; (define-key map "\C-c\C-b" 'shell-backward-command) -;; (define-key map "\t" 'completion-at-point) -;; (define-key map "\M-?" -;; 'comint-dynamic-list-filename-completions) -;; map)) -;; -;; (define-derived-mode shell-mode comint-mode "Shell" -;; "Doc." -;; (setq comint-prompt-regexp shell-prompt-pattern) -;; (setq-local shell-directory-stack nil) -;; (add-hook 'comint-input-filter-functions 'shell-directory-tracker)) -;; -;; -;; Completion for comint-mode users -;; -;; For modes that use comint-mode, comint-dynamic-complete-functions is the -;; hook to add completion functions to. Functions on this list should return -;; the completion data according to the documentation of -;; `completion-at-point-functions' - - (provide 'comint) - ;;; comint.el ends here -- 2.39.5