Emacs is freezing when trying to insert a class attribute comment when it's not at the end. E.g.,

class Foo:
   _bar: int
   """Some attribute."""
   _biz: int
   """Another attribute."""

I cannot edit the above to create the below

class Foo:
   _bar: int
   """Some attribute."""
   _bat: int
   """I can type the 2 quotes but the 3rd causes a freeze!!"""
   _biz: int
   """Another attribute."""

but I can add one at the very end, e.g.,

class Foo:
   _bar: int
   """Some attribute."""
   _biz: int
   """Another attribute."""
   _winning: int
   """This works!"""

This happens both with and without the -Q option. Has anyone else ever seen this behavior? Toubleshooting steps are much appreciated!!

  • OS: MacOS 12.6
  • Emacs Version: 28.2 installed via Homebrew

Output of brew info --cask emacs:

==> emacs: 28.2
/usr/local/Caskroom/emacs/28.2 (5 files, 275KB)
From: https://github.com/Homebrew/homebrew-cask/blob/HEAD/Casks/emacs.rb
==> Name
==> Description
Text editor
==> Artifacts
Emacs.app (App)
/Applications/Emacs.app/Contents/MacOS/Emacs -> emacs (Binary)
/Applications/Emacs.app/Contents/MacOS/bin/ebrowse (Binary)
/Applications/Emacs.app/Contents/MacOS/bin/emacsclient (Binary)
/Applications/Emacs.app/Contents/MacOS/bin/etags (Binary)
/Applications/Emacs.app/Contents/Resources/man/man1/ebrowse.1.gz (Manpage)
/Applications/Emacs.app/Contents/Resources/man/man1/emacs.1.gz (Manpage)
/Applications/Emacs.app/Contents/Resources/man/man1/emacsclient.1.gz (Manpage)
/Applications/Emacs.app/Contents/Resources/man/man1/etags.1.gz (Manpage)
==> Analytics
install: 3,531 (30 days), 10,356 (90 days), 43,386 (365 days)

Update: Rolling back to Emacs 27.2 resolves this issue.

  • Update: Rolling back to Emacs 27.2 resolves this issue Commented Oct 19, 2022 at 20:50
  • 1
    I added your comment to the question (where all relevant information should be added - comments are for questions and minor clarifications). If you want, you can delete the comment now.
    – NickD
    Commented Oct 20, 2022 at 2:12
  • i'm also seeing an issue with python and quotes in 28.2, although not exactly the same scenario. found this bug report: lists.gnu.org/archive/html/bug-gnu-emacs/2023-01/msg01702.html
    – jdigital
    Commented Mar 30, 2023 at 14:43
  • Starting Emacs with the --debug-on-error might help trace the problem. There are other options for triggering debugging too, to --debug-on-{event,message,next-call,quit,signal}.
    – slackline
    Commented Jan 7 at 18:50

1 Answer 1


Not sure of the actual issue which causes this but since this question I've moved to Emacs 29 installed via Homebrew's emacs-plus@29 and am not seeing the issue.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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