Don't override python font locking in comint

* lisp/comint.el (comint-highlight-input): New variable (bug#32344).
(comint-send-input): Use it.

* lisp/progmodes/python.el (inferior-python-mode): Set it.
This commit is contained in:
Carlos Pita 2020-08-19 13:13:46 +02:00 committed by Lars Ingebrigtsen
parent 9e586ac1d1
commit c570a79a77
2 changed files with 11 additions and 3 deletions

View file

@ -223,6 +223,12 @@ This variable is buffer-local."
(other :tag "on" t))
:group 'comint)
(defcustom comint-highlight-input t
"If non-nil, highlight input with `comint-highlight-input' face.
Otherwise keep the original highlighting untouched."
:type 'boolean
:group 'comint)
(defface comint-highlight-input '((t (:weight bold)))
"Face to use to highlight user input."
:group 'comint)
@ -1897,9 +1903,10 @@ Similarly for Soar, Scheme, etc."
(end (if no-newline (point) (1- (point)))))
(with-silent-modifications
(when (> end beg)
(add-text-properties beg end
'(front-sticky t
font-lock-face comint-highlight-input))
(when comint-highlight-input
(add-text-properties beg end
'(front-sticky t
font-lock-face comint-highlight-input)))
(unless comint-use-prompt-regexp
;; Give old user input a field property of `input', to
;; distinguish it from both process output and unsent

View file

@ -2791,6 +2791,7 @@ variable.
python-shell-comint-watch-for-first-prompt-output-filter
python-comint-postoutput-scroll-to-bottom
comint-watch-for-password-prompt))
(setq-local comint-highlight-input nil)
(set (make-local-variable 'compilation-error-regexp-alist)
python-shell-compilation-regexp-alist)
(add-hook 'completion-at-point-functions