From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.bugs Subject: bug#32344: [PATCH] 26.3/27 Option to avoid comint override colorization provided by major modes Date: Wed, 19 Aug 2020 13:11:41 +0200 Message-ID: <878sea7uvm.fsf@gnus.org> References: <875z9q64vv.fsf@gnus.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="15425"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: behrmann@physik.fu-berlin.de, eggert@cs.ucla.edu, 32344@debbugs.gnu.org To: Carlos Pita Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Aug 19 13:12:17 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1k8M0v-0003sn-De for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 19 Aug 2020 13:12:17 +0200 Original-Received: from localhost ([::1]:35410 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k8M0u-0005Fx-6H for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 19 Aug 2020 07:12:16 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:46792) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k8M0g-0005Fi-Gd for bug-gnu-emacs@gnu.org; Wed, 19 Aug 2020 07:12:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:54855) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1k8M0g-0007Fu-7e for bug-gnu-emacs@gnu.org; Wed, 19 Aug 2020 07:12:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1k8M0g-0001EA-21 for bug-gnu-emacs@gnu.org; Wed, 19 Aug 2020 07:12:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 19 Aug 2020 11:12:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 32344 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 32344-submit@debbugs.gnu.org id=B32344.15978355174704 (code B ref 32344); Wed, 19 Aug 2020 11:12:02 +0000 Original-Received: (at 32344) by debbugs.gnu.org; 19 Aug 2020 11:11:57 +0000 Original-Received: from localhost ([127.0.0.1]:38168 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k8M0a-0001Do-Kd for submit@debbugs.gnu.org; Wed, 19 Aug 2020 07:11:56 -0400 Original-Received: from quimby.gnus.org ([95.216.78.240]:43526) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k8M0Y-0001DZ-RG for 32344@debbugs.gnu.org; Wed, 19 Aug 2020 07:11:55 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=8D01oVnZIxaR6L46XzZ7/xR+BMPZjxeCVsXcPGMaqfo=; b=bbONLf/l13ZGJqwroviM8PheJB T5+xz+N2o/SOqzGcncUry/z0AJ7cQanAodtjRvsNK4v0RCJ70E81wiQzsAFF5mtfcVQ3KWX+JIWt9 5B5jBiuR13sxyNIEogs0Vs//Vhkloo+bO3ihDXrtfBzxeGLj+LZUnyMZo0nsiiLnyxQo=; Original-Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1k8M0M-0003ye-OQ; Wed, 19 Aug 2020 13:11:47 +0200 X-Now-Playing: AR Kane's _Lollita_ In-Reply-To: <875z9q64vv.fsf@gnus.org> (Lars Ingebrigtsen's message of "Mon, 10 Aug 2020 14:51:16 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:185574 Archived-At: --=-=-= Content-Type: text/plain Lars Ingebrigtsen writes: > Could you post the patch here instead? It's nice to have the proposed > patches in the bug tracker. (Included below.) > Anyway, while Juri's suggestion makes sense (merging faces) in general, > I think the mechanism here (making comint not do any face mangling for > the modes that do it themselves) is cleaner. So I think Carlos' patch > should be applied to Emacs. Which I'm doing now. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=pita.patch >From 27acd97dfec7ecd9667a032e3a94650cb01244c1 Mon Sep 17 00:00:00 2001 From: memeplex Date: Sun, 13 Oct 2019 18:42:37 -0300 Subject: [PATCH] Keep python colorization in comint (Bug#32344) * lisp/comint.el (comint-highlight-input, comint-send-input): add option to let major modes that colorize their input stop comint from overriding that specialized colorization. * lisp/progmodes/python.el (inferior-python-mode): Use the new comint `comint-highlight-input' customization option in order to keep colorization done by python.el. --- lisp/comint.el | 13 ++++++++++--- lisp/progmodes/python.el | 1 + 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/lisp/comint.el b/lisp/comint.el index 4bb43670354..b8f5205d9e5 100644 --- a/lisp/comint.el +++ b/lisp/comint.el @@ -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) @@ -1881,9 +1887,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 diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index b168b62c291..8f823532802 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -2796,6 +2796,7 @@ variable. python-pdbtrack-comint-output-filter-function python-comint-postoutput-scroll-to-bottom comint-watch-for-password-prompt)) + (set (make-local-variable 'comint-highlight-input) nil) (set (make-local-variable 'compilation-error-regexp-alist) python-shell-compilation-regexp-alist) (add-hook 'completion-at-point-functions --=-=-= Content-Type: text/plain -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no --=-=-=--