Subject: bug#32344:

From: Carlos Pita <[email-masked]>
Date: Wed, 12 Sep 2018 14:04:15 -0300

Recently I've had some exchange with elpy maintainer and he said he
would be glad to support full history fontification for python mode
but he didn't want to add my advice (its final version is quoted
below) to elpy in order to instrument comint-send-input, so for now we
just have a wiki-level DIY solution. Now, I fully understand his
concern, so is there any interest in adding this option to comint? It
seems quite simple a change and it will allow inferior modes to fully
colorize their history, which is a rather nice feature. In case there
is any interest I could submit a patch.

---

(advice-add 'comint-send-input
            :around (lambda (f &rest args)
                      (if (eq major-mode 'inferior-python-mode)
                          (cl-letf ((g (symbol-function 'add-text-properties))
                                    ((symbol-function 'add-text-properties)
                                     (lambda (start end properties
&optional object)
                                       (unless (eq (nth 3 properties)
'comint-highlight-input)
                                         (funcall g start end
properties object)))))
                            (apply f args))
                        (apply f args))))