On[General::stop] and Off[General::stop] work without the FrontEnd, and the latter shouldn't be necessary for this functionality. Hence it is very doubtful that the developers would attach an option controlling their behavior to the $FrontEnd. If such an option exists, it should live in the Kernel.
According to the Documentation page for General::stop (emphasis is mine):
- This message is generated after the indicated message has been generated for the third time in a single evaluation.
On the Documentation page for Message we read (emphasis is mine):
- Between any two successive input lines, the Wolfram Language prints a message with a particular name at most three times. On the last occurrence, it prints the message
General::stop.
Off[General::stop] makes the Wolfram Language not stop repeating messages.
Hence it looks like the maximum number of printed messages is hard-coded, and isn't supposed to be altered by a user.
Nevertheless, we are able to change the default behavior by overloading Message. For example, here is a simple solution intended for implementing manual subkernel management from my old MathGroup post:
I have found the solution. It exploits elegant hack by Todd Gayley.
Here it is (of course, it must be evaluated in the slave kernel):
$globalMessageList = {};
Unprotect[Message];
Message[args___] :=
Block[{$inMsg = True, $MessageList = $globalMessageList},
Message[args];
$globalMessageList = $MessageList;
] /; ! TrueQ[$inMsg];
Protect[Message];
One can fully emulate standard behavior of Messages in the slave
kernel by checking the current value of $Line and comparing it with
previous value:
If[TrueQ[$Line > lastLine],
LinkWrite[$kern,
Unevaluated[ExpressionPacket[$globalMessageList = {};]]];
LinkRead[$kern]]; lastLine = $Line;
This recent answer contains a modern implementation for the built-in Parallel* functionality.
For the Main Loop, it can be implemented in a similar manner with the only addition that some built-in functions may depend on implementation details of Message, which updates some internal event counters including $MessageList (and affects event listeners as well). Hence it seems reasonable that we have to evaluate Quiet[Message[mn, args]] when we don't want a message to be printed, in order do not break this functionality:
Off[General::stop];
Unprotect[Message];
Message[mn_MessageName, args___] := Block[{$inMsg = True},
If[Not[AssociationQ[$EvaluationMessages]] || $EvaluationMessages["$Line"] =!= $Line,
$EvaluationMessages = <|"$Line" -> $Line|>];
If[! NumericQ[$EvaluationMessagesLimit], $EvaluationMessagesLimit = 3];
If[KeyExistsQ[$EvaluationMessages, HoldForm@mn],
++$EvaluationMessages[HoldForm@mn], $EvaluationMessages[HoldForm@mn] = 1];
If[$EvaluationMessages[HoldForm@mn] <= $EvaluationMessagesLimit,
Message[mn, args], Quiet[Message[mn, args]]]
] /; ! TrueQ[$inMsg]
Protect[Message];
Here is how it can be used:
$EvaluationMessagesLimit = 1;
Do[1/0, 20]
$EvaluationMessages

(The screenshot is from version 13.0.0; I don't know from where comes the ToExpression::sntx Message call.)