unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Carlos Pita <carlosjosepita@gmail.com>
To: behrmann@physik.fu-berlin.de, 32344@debbugs.gnu.org
Subject: bug#32344:
Date: Sun, 13 Oct 2019 15:36:34 -0300	[thread overview]
Message-ID: <CAELgYheJNjeek=3j6Rce5NpgiH+2E4516R6SjG2JtHUbeW+Ggg@mail.gmail.com> (raw)
In-Reply-To: <CAELgYhefSaSpYFFBMN9JQDeuk9ophm8arwkq=qjyHjs19vDzvQ@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 141 bytes --]

I can confirm that the patch cleanly applies on top of emacs-26 branch
too, but in any case here is a version rebased on top of that branch.

[-- Attachment #2: 0001-Option-for-comint-to-honour-original-input-highlight.patch --]
[-- Type: text/x-patch, Size: 1782 bytes --]

From 1f2392f09b9c0193e79382512a8a30388ce54bf8 Mon Sep 17 00:00:00 2001
From: memeplex <carlosjosepita@gmail.com>
Date: Sun, 13 Oct 2019 13:57:11 -0300
Subject: [PATCH] Option for comint to honour original input highlighting

* comint.el (comint-send-input): add option to let major modes that
colorize their input (for example, python-mode) stop comint from
overriding that specialized colorization.
---
 lisp/comint.el | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/lisp/comint.el b/lisp/comint.el
index 4bb4367..b8f5205 100644
--- a/lisp/comint.el
+++ b/lisp/comint.el
@@ -223,6 +223,12 @@ comint-input-autoexpand
 		 (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 @@ comint-send-input
               (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
-- 
2.20.1


  reply	other threads:[~2019-10-13 18:36 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-02  0:14 bug#32344: 26.1; Option to avoid comint highlighting input Carlos Pita
2018-08-02  1:19 ` bug#32344: Carlos Pita
2018-09-12 17:04 ` bug#32344: Carlos Pita
2018-09-17 16:36 ` bug#32344: (no subject) Jörg Behrmann
2019-10-13 17:18 ` bug#32344: Carlos Pita
2019-10-13 18:36   ` Carlos Pita [this message]
2019-10-13 19:23     ` bug#32344: Carlos Pita
2019-10-13 19:24       ` bug#32344: Carlos Pita
2019-10-13 21:53         ` bug#32344: [PATCH] 26.3/27 Option to avoid comint override colorization provided by major modes Carlos Pita
2019-10-21 20:39           ` Carlos Pita
2020-08-10 12:51             ` Lars Ingebrigtsen
2020-08-19 11:11               ` Lars Ingebrigtsen
2019-10-20 15:57         ` bug#32344: Juri Linkov
2019-10-14 17:16 ` bug#32344: [PATCH] 26.3/27 Option to avoid comint override colorization provided by major modes Gaby Launay via Bug reports for GNU Emacs, the Swiss army knife of text editors
2019-10-21 20:53 ` bug#32344: Add option to keep colorization in comint, use it in python.el Carlos Pita
2019-10-22 18:25   ` Carlos Pita
2019-10-22 20:37   ` Juri Linkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAELgYheJNjeek=3j6Rce5NpgiH+2E4516R6SjG2JtHUbeW+Ggg@mail.gmail.com' \
    --to=carlosjosepita@gmail.com \
    --cc=32344@debbugs.gnu.org \
    --cc=behrmann@physik.fu-berlin.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).