Function: comint-fontify-input-mode

comint-fontify-input-mode is an interactive and byte-compiled function defined in comint.el.gz.

Signature

(comint-fontify-input-mode &optional ARG)

Documentation

Enable input fontification in the current comint buffer.

This minor mode is useful if the current major mode derives from comint-mode and if comint-indirect-setup-function is set. Comint modes that support input fontification usually set this variable buffer-locally to a major-mode command whose font-locking is desired for input text.

Input text is fontified through an indirect buffer created with comint-indirect-buffer, which see.

This function signals an error if comint-use-prompt-regexp is non-nil. Input fontification isn't compatible with this setting.

This is a minor mode. If called interactively, toggle the Comint-Fontify-Input mode mode. If the prefix argument is positive, enable the mode, and if it is zero or negative, disable the mode.

If called from Lisp, toggle the mode if ARG is toggle. Enable the mode if ARG is nil, omitted, or is a positive number. Disable the mode if ARG is a negative number.

To check whether the minor mode is enabled in the current buffer, evaluate the variable comint-fontify-input-mode(var)/comint-fontify-input-mode(fun).

The mode's hook is called both when the mode is enabled and when it is disabled.

Probably introduced at or before Emacs version 29.1.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/comint.el.gz
(define-minor-mode comint-fontify-input-mode
  "Enable input fontification in the current comint buffer.
This minor mode is useful if the current major mode derives from
`comint-mode' and if `comint-indirect-setup-function' is set.
Comint modes that support input fontification usually set this
variable buffer-locally to a major-mode command whose
font-locking is desired for input text.

Input text is fontified through an indirect buffer created with
`comint-indirect-buffer', which see.

This function signals an error if `comint-use-prompt-regexp' is
non-nil.  Input fontification isn't compatible with this
setting."
  :lighter nil
  :interactive (comint-mode)
  (if comint-fontify-input-mode
      (let ((success nil))
        (unwind-protect
            (progn
              (comint--fontify-input-on)
              (setq success t))
          (unless success
            (setq comint-fontify-input-mode nil)
            (comint--fontify-input-off))))
    (comint--fontify-input-off)))