By default pressing Alt+. or calling Abort[]
within the evaluation causes abort of the currently evaluating input. But when working in the FrontEnd we usually send to the kernel a sequence of inputs. For example, if we type the following three expressions on separate lines in one Cell
and then press Shift+Enter we get infinite evaluation:
f := CheckAbort[Pause[.1], Abort[]]
While[True, f]
While[True, f]
While[True, f]
To stop this infinite evaluation we must to press Alt+. three times.
How to define the function f
in the example above in such a way that pressing Alt+. one time will abort the evaluation of the full sequence of inputs without quitting the kernel?
EDIT
I think that if the FrontEnd creates an input queue for MathKernel it probably can also cancel this queue.
EvaluationNotebook[]
not just the current input line. It is very strange that up to this time we have no way to do this in the FrontEnd! A keyboard combination for this would be VERY useful for many people and it is so easy to implement this! FrontEnd must just cancel unsent input packets queried for sending to the kernel! – Waves