Hi Jack, I have cloned the git master. Running without configuration ("make vanilla"), emacs correctly fontifies the source block and it also gets exported to HTML. It seems that it is a configuration problem. Sorry for not double checking first! Many thanks for your help! Cheers, Sebastian On Mon, Nov 2, 2020 at 12:43 AM Sebastian Gimeno wrote: > Hi Jack, > > thanks for replying! > > The error does not happen using "emacs -q" (built-in package: org 9.3). I > haven't tried with the git version yet. i will and let you know. > > Cheers, > Sebastian > > On Sun, Nov 1, 2020 at 9:19 PM Jack Kamm wrote: > >> Hi Sebastian -- >> >> > I am having problems with the fontification of python and ipython source >> > blocks when the code contains curly brackets "{}" (other course blocks >> are >> > ok). For instance, the following snippet >> > >> > #+BEGIN_SRC python :results drawer >> > import matplotlib.pyplot as plt >> > plt.plot([1,2,3]) >> > plt.show() >> > a=1 >> > print("a={}".format{a}) >> > #+END_SRC >> > >> > does not fontify correctly in either python or ipython source blocks. >> > >> > As a consequence, when exporting the org file to HTML (C-c C-e h h), it >> > fails with the following message: >> > >> > font-lock-fontify-keywords-region: Invalid function: # >> >> I'm unable to reproduce this behavior on emacs 27.1 and git >> master. Fontification and export work fine with this code block for me. >> >> Does the error still happen when you use emacs -q ? Or if you use git >> master? >> >> Jack >> >>