美好的一天,
这个问题来自关于aborting evaluation of the full sequence of inputs的问题。
我认为可能通过为两个事件重新定义FrontEndEventActions
来实现所需的行为:"EvaluateCells"
(或按 Shift + Enter )并按 Alt + 。。它应该是这样的:
SetOptions[$FrontEndSession,
FrontEndEventActions -> {"EvaluateCells" :> Last$PreRead,
{{"Alt", "."} :> AbortAllNextInputs}}]
或
SetOptions[$FrontEndSession,
FrontEndEventActions -> {{{"ShiftKey", "ReturnKeyDown"} :> Last$PreRead}
{{"Alt", "."} :> AbortAllNextInputs}}]
AbortAllNextInputs
和Last$PreRead
定义如下:
AbortAllNextInputs := AbortProtect[
$new$PreRead = True;
last$PreRead = ToString[Definition[$PreRead], InputForm];
ClearAll[$PreRead];
$PreRead := # &] /; ! TrueQ[$new$PreRead]
Last$PreRead :=
$PreRead := AbortProtect[
$new$PreRead = False;
ClearAll[$PreRead];
If[last$PreRead === "Null", #,
ToExpression[last$PreRead]; $PreRead@#]
] &
但我不能让FrontEndEventActions
工作。任何人都可以帮助我吗?