emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Org mode fontification error in #<buffer myfile.org> in python and ipython source blocks
@ 2020-10-31  2:01 Sebastian Gimeno
  2020-11-01 20:19 ` Jack Kamm
  2020-11-03  5:49 ` stardiviner
  0 siblings, 2 replies; 9+ messages in thread
From: Sebastian Gimeno @ 2020-10-31  2:01 UTC (permalink / raw)
  To: emacs-orgmode

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

Hi,

I am using emacs 27.1 and org-plus-contrib 20201026.

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: #<subr progn>

If changing the code snippet to:

#+BEGIN_SRC python :results drawer
import matplotlib.pyplot as plt
plt.plot([1,2,3])
plt.show()
a=1
print("a=%s" % a)
#+END_SRC

the block fontifies and the file is exported to HTML correctly.

Can you reproduce this behaviour?

Many thanks in advance!

[-- Attachment #2: Type: text/html, Size: 1566 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2020-11-04  3:23 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-10-31  2:01 Org mode fontification error in #<buffer myfile.org> in python and ipython source blocks Sebastian Gimeno
2020-11-01 20:19 ` Jack Kamm
2020-11-01 23:43   ` Sebastian Gimeno
2020-11-02  0:41     ` Sebastian Gimeno
2020-11-03  5:49 ` stardiviner
2020-11-03  9:53   ` Sebastian Gimeno
2020-11-03 15:55     ` John Kitchin
2020-11-04  3:10       ` Kyle Meyer
2020-11-04  3:22     ` stardiviner

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.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).