1

I have a lisp function which performs a transformation on a buffer. It's usually quick, but sometimes it's very slow when the buffer is big.

I can see it's working, because it prints out its progress in the echo area, yet I cannot stop it with pressing C-g.

Is there a way I can ensure it can be stopped? Like could adding a (sit-for 0) to the loop help, so it reacts to C-g?

Drew
  • 77,472
  • 10
  • 114
  • 243
Tom
  • 1,260
  • 8
  • 16
  • Consider filing a bug report: M-x report-emacs-bug, providing a step-by-step recipe to repro the problem, starting with emacs -Q (no init file). – Drew Feb 09 '21 at 18:48
  • You will need to provide more info here about what your function does, I'm afraid. We have no way of knowing whether it involves an external process, etc. Please consider elaborating. – Drew Feb 09 '21 at 18:50
  • You can also try ESC ESC ESC. Sometimes that works when C-g doesn't. – Drew Feb 09 '21 at 18:51
  • That didn't work either. The function is a simple rearranging of the buffer, so cutting some text form one place and pasting it to somewhere else. It is called from a process sentinel when the process is finished, so it does involve an external process, but the function runs after the process is finished. The strange thing is I thought if the echo area was updated then the lisp interpreter could be stopped, because emacs is not bogged down with some operation since it can update the display, but regardless it does not stop for C-g – Tom Feb 09 '21 at 21:31
  • Please add all info (about the process or whatever) that you think is relevant to the question to the question itself. Comments can be deleted at any time. A clearer question will likely help others help you better. – Drew Feb 09 '21 at 23:06

0 Answers0