0

I sometimes experience "color bleeding" in auctex, and wasn't able to find the source of the problem for a long time. In particular because I wasn't able to reproduce the issue. I also can't post documents where it occurred because they contain non public data, are complex, not minimal etc.

Now I noticed that the problem is gone if I comment out the following sections of my init.el:

(defcustom pm-inner/python (pm-inner-chunkmode "python" :head-matcher "\\\\begin{\\(pycode\\|pythontexcustomcode\\|sagecode\\)}\\(\\[[^]\\]+]\\)?" :tail-matcher "\\\\end{\\(pycode\\|pythontexcustomcode\\|sagecode\\)}" :mode 'python-mode) "python typical chunk." :group 'innermodes :type 'object) (defcustom pm-poly/latex-python (pm-polymode "latex-python" :hostmode 'pm-host/latex :innermodes '(pm-inner/python)) "latex-python typical polymode." :group 'polymodes :type 'object) (define-polymode poly-latex+python-mode pm-poly/latex-python) (add-to-list 'auto-mode-alist '("\\.tex$" . poly-latex+python-mode)) 

It is a polymode configuration for automatically going to python mode inside a latex document if python-chunks (inside a pycode environment for example) occur.

So do you have any idea, why this code could lead to color bleeding and how to investigate it further (in particular to get a reproducible minimal example which shows the problem).

5
  • 1
    Can you please explain what you mean by "colour bleeding", perhaps with a screenshot if that helps to make it clearer? Commented Mar 21, 2024 at 22:36
  • What @FranBurstall said - define color bleeding. Commented Mar 22, 2024 at 2:14
  • I added a link to the auctex manual for a description of the problem. I cannot post a screenshot because I can't reproduce the problem with documents I could share in public. Commented Mar 22, 2024 at 8:54
  • @student - Does it mean that you have unbalanced number of $ in your pycode environment and that causes the bleeding? Commented Mar 22, 2024 at 12:39
  • @student - And I think your regexp for matching the opt. argument \\(\\[[^]\\]+]\\)? is wrong; it should read "\\(\\[[^]]+\\]\\)?" Commented Mar 22, 2024 at 12:43

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.