Function: comint--fontify-input-on

comint--fontify-input-on is a byte-compiled function defined in comint.el.gz.

Signature

(comint--fontify-input-on)

Documentation

Enable input fontification in the current comint buffer.

Source Code

;; Defined in /usr/src/emacs/lisp/comint.el.gz
(defun comint--fontify-input-on ()
  "Enable input fontification in the current comint buffer."
  (comint--fontify-input-off)

  (when comint-use-prompt-regexp
    (error
     "Input fontification is incompatible with `comint-use-prompt-regexp'"))

  (add-function :around (local 'font-lock-fontify-region-function)
                #'comint--fontify-input-fontify-region)
  ;; `before-change-functions' are only run in the current buffer and
  ;; not in its indirect buffers, which means that we must manually
  ;; flush ppss cache
  (add-hook 'before-change-functions
            #'comint--fontify-input-ppss-flush-indirect 99 t)

  ;; Set up contextual fontification
  (unless (booleanp jit-lock-contextually)
    (setq comint--fontify-input-saved-jit-lock-contextually
          jit-lock-contextually)
    (setq-local jit-lock-contextually t)
    (when jit-lock-mode
      (jit-lock-mode t))))