/* If positive, garbage collection is inhibited. Otherwise, zero. */
-static intptr_t garbage_collection_inhibited;
+intptr_t garbage_collection_inhibited;
/* The GC threshold in bytes, the last time it was calculated
from gc-cons-threshold and gc-cons-percentage. */
return false;
}
+extern intptr_t garbage_collection_inhibited;
+
/* Set the current message to STRING. */
static void
eassert (STRINGP (string));
- if (FUNCTIONP (Vset_message_function))
+ if (FUNCTIONP (Vset_message_function)
+ /* FIXME: (bug#63253) We should really make the regexp engine re-entrant,
+ but in the mean time, let's ignore `set-message-function` when
+ called from `probably_quit`. */
+ && !garbage_collection_inhibited)
{
specpdl_ref count = SPECPDL_INDEX ();
specbind (Qinhibit_quit, Qt);
if (current_p)
{
- if (FUNCTIONP (Vclear_message_function))
+ if (FUNCTIONP (Vclear_message_function)
+ /* FIXME: (bug#63253) Same as for `set-message-function` above. */
+ && !garbage_collection_inhibited)
{
specpdl_ref count = SPECPDL_INDEX ();
specbind (Qinhibit_quit, Qt);