3

With Emacs 24.3 I get certain keywords highlighted in an inferior Python buffer:

This is no longer the case for Emacs 24.4:

What could possibly cause this? I've made sure it's not my configuration by running emacs -q and am not sure whether font-locking generally changed or the packaged python.el has regressed.

5
  • 4
    Might be intentional. It looks like regular words were being wrongly highlighted as keywords. – Malabarba Dec 3 '14 at 12:49
  • I very much doubt this since font-lock-defaults is (python-font-lock-keywords nil nil nil nil) which define all kinds of error classes as builtins. – wasamasa Dec 3 '14 at 12:53
  • It still highlights text you write on the prompt, right? Seems the highlighting has been turned off on messages, somehow. Which seems reasonable. – Meaningful Username Dec 3 '14 at 13:57
  • Yes, those still get highlighted. Still, I'm interested in what exactly changed for the output functions. – wasamasa Dec 3 '14 at 13:59
  • Yes, I believe it's on purpose, and it even requires some ugly/tricky code to get this behavior. – Stefan Dec 4 '14 at 13:44
1

I think it's intentional, since the old behaviour isn't really what you'd want. C-h n gives:

* Changes in Specialized Modes and Packages in Emacs 24.4
...
*** Python mode
...
*** Automatic shell prompt detection.  New user options:
**** `python-shell-interpreter-interactive-arg'.
**** `python-shell-prompt-detect-enabled'.
**** `python-shell-prompt-detect-failure-warning'.
**** `python-shell-prompt-input-regexps'.
**** `python-shell-prompt-output-regexps'.

That could possibly be related?

1
  • 1
    I've checked by looking for your options and it looks like the derived inferior Python mode makes sure both input and output aren't font-locked which avoids the problem of stray quotes fontifying your current prompt. Therefore, I'll accept your answer for leading me on to the right path behind this mystery. – wasamasa Dec 4 '14 at 20:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.