-;;; 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 <no equivalent>
-;;; Miscellaneous:
-;;; shell-set-directory <unnecessary>
-;;; 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-kill-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 '())
-;;; (cond ((not shell-mode-map)
-;;; (setq shell-mode-map (copy-keymap comint-mode-map))
-;;; (define-key shell-mode-map "\C-c\C-f" 'shell-forward-command)
-;;; (define-key shell-mode-map "\C-c\C-b" 'shell-backward-command)
-;;; (define-key shell-mode-map "\t" 'comint-dynamic-complete)
-;;; (define-key shell-mode-map "\M-?"
-;;; 'comint-dynamic-list-filename-completions)))
-;;;
-;;; (defun shell-mode ()
-;;; (interactive)
-;;; (comint-mode)
-;;; (setq comint-prompt-regexp shell-prompt-pattern)
-;;; (setq major-mode 'shell-mode)
-;;; (setq mode-name "Shell")
-;;; (use-local-map shell-mode-map)
-;;; (make-local-variable 'shell-directory-stack)
-;;; (setq shell-directory-stack nil)
-;;; (add-hook 'comint-input-filter-functions 'shell-directory-tracker)
-;;; (run-hooks 'shell-mode-hook))
-;;;
-;;;
-;;; Note that make-comint is different from make-shell in that it
-;;; doesn't have a default program argument. If you give make-shell
-;;; a program name of NIL, it cleverly chooses one of explicit-shell-name,
-;;; $ESHELL, $SHELL, or /bin/sh. If you give make-comint a program argument
-;;; of NIL, it barfs. Adjust your code accordingly...
-;;;
-;;; 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
-;;; non-nil if completion occurs (i.e., further completion should not occur).
-;;; You could use comint-dynamic-simple-complete to do the bulk of the
-;;; completion job.
+;; 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 <no equivalent>
+;; Miscellaneous:
+;; shell-set-directory <unnecessary>
+;; 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-kill-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 '())
+;; (cond ((not shell-mode-map)
+;; (setq shell-mode-map (copy-keymap comint-mode-map))
+;; (define-key shell-mode-map "\C-c\C-f" 'shell-forward-command)
+;; (define-key shell-mode-map "\C-c\C-b" 'shell-backward-command)
+;; (define-key shell-mode-map "\t" 'comint-dynamic-complete)
+;; (define-key shell-mode-map "\M-?"
+;; 'comint-dynamic-list-filename-completions)))
+;;
+;; (defun shell-mode ()
+;; (interactive)
+;; (comint-mode)
+;; (setq comint-prompt-regexp shell-prompt-pattern)
+;; (setq major-mode 'shell-mode)
+;; (setq mode-name "Shell")
+;; (use-local-map shell-mode-map)
+;; (make-local-variable 'shell-directory-stack)
+;; (setq shell-directory-stack nil)
+;; (add-hook 'comint-input-filter-functions 'shell-directory-tracker)
+;; (run-hooks 'shell-mode-hook))
+;;
+;;
+;; Note that make-comint is different from make-shell in that it
+;; doesn't have a default program argument. If you give make-shell
+;; a program name of NIL, it cleverly chooses one of explicit-shell-name,
+;; $ESHELL, $SHELL, or /bin/sh. If you give make-comint a program argument
+;; of NIL, it barfs. Adjust your code accordingly...
+;;
+;; 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
+;; non-nil if completion occurs (i.e., further completion should not occur).
+;; You could use comint-dynamic-simple-complete to do the bulk of the
+;; completion job.