aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarlos Pita2020-08-19 13:13:46 +0200
committerLars Ingebrigtsen2020-08-19 13:13:46 +0200
commitc570a79a77add5482826b42912d3fe95edc9b146 (patch)
tree1ebbb06d4ca4470c2f6fe56523cb9104f3ba1c4c
parent9e586ac1d1b3bbabbd73a119698df742c0bfa523 (diff)
downloademacs-c570a79a77add5482826b42912d3fe95edc9b146.tar.gz
emacs-c570a79a77add5482826b42912d3fe95edc9b146.zip
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.
-rw-r--r--lisp/comint.el13
-rw-r--r--lisp/progmodes/python.el1
2 files changed, 11 insertions, 3 deletions
diff --git a/lisp/comint.el b/lisp/comint.el
index df4937a7d6f..4094969ae8e 100644
--- a/lisp/comint.el
+++ b/lisp/comint.el
@@ -223,6 +223,12 @@ This variable is buffer-local."
223 (other :tag "on" t)) 223 (other :tag "on" t))
224 :group 'comint) 224 :group 'comint)
225 225
226(defcustom comint-highlight-input t
227 "If non-nil, highlight input with `comint-highlight-input' face.
228Otherwise keep the original highlighting untouched."
229 :type 'boolean
230 :group 'comint)
231
226(defface comint-highlight-input '((t (:weight bold))) 232(defface comint-highlight-input '((t (:weight bold)))
227 "Face to use to highlight user input." 233 "Face to use to highlight user input."
228 :group 'comint) 234 :group 'comint)
@@ -1897,9 +1903,10 @@ Similarly for Soar, Scheme, etc."
1897 (end (if no-newline (point) (1- (point))))) 1903 (end (if no-newline (point) (1- (point)))))
1898 (with-silent-modifications 1904 (with-silent-modifications
1899 (when (> end beg) 1905 (when (> end beg)
1900 (add-text-properties beg end 1906 (when comint-highlight-input
1901 '(front-sticky t 1907 (add-text-properties beg end
1902 font-lock-face comint-highlight-input)) 1908 '(front-sticky t
1909 font-lock-face comint-highlight-input)))
1903 (unless comint-use-prompt-regexp 1910 (unless comint-use-prompt-regexp
1904 ;; Give old user input a field property of `input', to 1911 ;; Give old user input a field property of `input', to
1905 ;; distinguish it from both process output and unsent 1912 ;; distinguish it from both process output and unsent
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index f8c18021ffa..d83af83b32e 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -2791,6 +2791,7 @@ variable.
2791 python-shell-comint-watch-for-first-prompt-output-filter 2791 python-shell-comint-watch-for-first-prompt-output-filter
2792 python-comint-postoutput-scroll-to-bottom 2792 python-comint-postoutput-scroll-to-bottom
2793 comint-watch-for-password-prompt)) 2793 comint-watch-for-password-prompt))
2794 (setq-local comint-highlight-input nil)
2794 (set (make-local-variable 'compilation-error-regexp-alist) 2795 (set (make-local-variable 'compilation-error-regexp-alist)
2795 python-shell-compilation-regexp-alist) 2796 python-shell-compilation-regexp-alist)
2796 (add-hook 'completion-at-point-functions 2797 (add-hook 'completion-at-point-functions