While developing, I would sometimes like to stop evaluation of selected cells at a certain point. The following example nearly seems to work, but repeated runs of Ctrl+A, Enter reveal something sticking in memory. Is there a good way break out of the evaluation queue?

the result of 1 + 1 behaves erratically under repeated evaluation of the whole expression sequence, but the result of 2 + 2 is always OK. I suggest you put a "don't care" expression into the first notebook cell as s work-around.

Edit

Since using "EvaluatorAbort" is unreliable, perhaps the following will be more satisfactory:

Thanks, but that still not great. After the abort any cell might be chosen for evaluation, with no telling whether it will evaluate or not.
–
Chris DegnenJun 28 '13 at 15:01

@ChrisDegnen. Don't understand your comment. Suggest you make it as edit to your question with an example of how it impacts your problem.
–
m_goldbergJun 28 '13 at 15:05

... for instance, after evaluating the notebook with Ctrl+A, Enter the next cell I want to evaluate could be Print[3], but it may or may not evaluate.
–
Chris DegnenJun 28 '13 at 16:00

1

@ChrisDegnen. I think I see what you are getting at now. However, if the cell you attempt to evaluate after the abort fails to evaluate the first time, it seems to always evaluate on a second try. However, I would agree that FrontEndExecute@FrontEndToken[EvaluatorAbort] appears to leave the kernel in a strange state.
–
m_goldbergJun 28 '13 at 16:07

Mathematica is a registered trademark of Wolfram Research, Inc. While the mark is used herein with the limited permission of Wolfram Research, Stack Exchange and this site disclaim all affiliation therewith.