Skip to content

Instantly share code, notes, and snippets.

@alexholehouse
Last active October 23, 2022 23:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alexholehouse/2259580ed2cb2caf75a16ee31d927465 to your computer and use it in GitHub Desktop.
Save alexholehouse/2259580ed2cb2caf75a16ee31d927465 to your computer and use it in GitHub Desktop.
emacs_bug
## ...........................................................................
## DEMO CODE
## ...........................................................................
## Note - this file may crash emacs on opening. If this is the case,
## edit the docstring in function0() to close the triple double-quotes (not using emacs!), and the
## file should open fine. You can then crash emacs by deleting one of the triple double quotes!
def padder_function(self, input):
"""
The font parsing code in emacs uses a JIT approach, so I think we need to pad the initial set of characters
so that emacs loads up, and then crashes as we scroll through the document. This is speculation though...
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam dictum mi et tincidunt pulvinar.
Fusce vitae urna id tortor imperdiet laoreet. Integer lobortis arcu at ullamcorper suscipit.
Vivamus tristique, nulla laoreet finibus cursus, lorem nisi malesuada velit, in tempus diam elit et turpis.
Pellentesque eu tempus leo. Suspendisse sed fringilla libero, a vulputate nibh. Nam turpis velit, viverra
sit amet bibendum ac, semper sed ex. Curabitur vitae ullamcorper mi, in volutpat lorem. Sed nec tellus congue
odio mollis volutpat. Pellentesque faucibus at tellus id euismod. Pellentesque pharetra, purus bibendum elementum
suscipit, eros erat dictum nunc, hendrerit viverra diam justo id orci. Nunc lorem quam, cursus ac mauris sed,
dapibus efficitur urna. Praesent in lacus et nunc porta tempus malesuada sit amet massa. Cras nisl nulla, tristique
et turpis quis, euismod ultrices enim. In tincidunt urna sed justo tincidunt, in convallis turpis porta. Praesent
gravida mauris nec volutpat iaculis.
"""
for i in range(0,100):
print(i)
def function0(value=True):
"""
# this function signature is unfinished, which, when combined with the single-quotation marks
# in the docstring for the later functions leads...
## NOTE - if emacs crashes on opening this file, just add three more double quotes below
## this line and all will be well (you can then delete those double quotes from inside
## emacs to crash emacs in realtime
if value:
self.hardwall=1
else:
self.hardwall=0
def function1(self, input):
"""
This has three single-quotation marks in the docstring
Lorem ipsum'
Lorem ipsum'
Lorem ipsum'
"""
for i in range(0,100):
print(i)
def function2(self, input):
"""
This has one single-quotation marks in the docstring. Tentatively it seems like you
need 4 or more single quotation marks to trigger this bug
Lorem ipsum'
"""
for i in range(0,100):
print(i)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment