When I edit a file with EMACS I get a strange error. How do I fix this?

Viewed 431

This is what I am doing:

  1. Make a file or use an existing file.
  2. Emacs filename.txt.
  3. Type some new text into the file.
  4. Save file.

After step 2, I receive an error after the emacs editor window pops up.

Here is the error:

2022-01-19 22:11:53.935 Emacs-x86_64-10_14[33893:994906] It's not legal to call -layoutSubtreeIfNeeded on a view which is already being laid out. If you are implementing the view's -layout method, you can call -[super layout] instead. Break on void _NSDetectedLayoutRecursion(void) to debug. This will be logged only once. This may break in the future.

I have already tried updating emacs and that didn't help, and googling didn't give me an answer. Currently, I have GNU Emacs 27.1 version.

How do I fix this error?

2 Answers

As far as I know you shouldn't need to "fix" the error at all and it won't cause any problems while you're actually running Emacs. In fact I'm somewhat surprised you see it at all.

I was only able to see the error (in both Emacs 27 and in pretest-28.0.90) only by running the Emacs binary (eg. ./Emacs-27.app/Contents/MacOS/Emacs) directly from a terminal, which isn't the normal way of starting Emacs on macOS. If you just run Emacs by starting it from Finder, the Dock, or via the "open" utility then you shouldn't see the error at all, and it shouldn't cause any problems.

The whole point of keyboard interaction (and emacs in particular) is that there's no need to touch the mouse. It's possible to log in (using e.g. ssh) and edit remotely, with no gui (so no way to drag and drop), and this is the 'normal' way of invoking emacs. Run 'emacs --help' from the command line to see a bunch of options. In particular see 'emacs --no-window-system' which uses a raw terminal even when a gui is available (no error message appears when it's run this way).

The gui however adds font and image support, which can be useful if you're sitting at the machine. The error message you get when you invoke 'emacs' from the command line in its default mode, with no arguments, is a diagnostic describing a bug in the mac gui implementation.

The error's still there if you start emacs through the finder; you can see that by running (e.g.)

$ open /Applications/Emacs.app/Contents/MacOS/Emacs-x86_64-10_14

which both opens an emacs gui and a terminal window containing the program's text output.

As it says in the message, 'this may break in the future'; it's not helpful to say 'you're using it wrong.'

Related