Subject: bug#21313: 25.0.50; Strange errors from dbus-handle-event

From: Tassilo Horn <[email-masked]>
Date: Fri, 16 Oct 2015 06:53:19 +0200

Eli Zaretskii <[email-masked]> writes:

>> But how could a GC (or maybe just some small slowdown induced by
>> printing) reset the quit flag?
>
> It can't, and that's not what I meant.
>
> I think I found the problem: the call to Fformat eventually calls
> print_object, which calls QUIT, which resets quit-flag.

I've seen it now.  Well, that's not what I would have expected.

> So you need to change the beginning of read_char like this:
>
>   ptrdiff_t count = SPECPDL_INDEX ();
>   specbind (Qinhibit_quit, Qt);
>   AUTO_STRING (format, "%S");
>   printf ("record_char: %s\n", SSDATA (CALLN (Fformat, format, c)));
>   unbind_to (count, Qnil);

Yes, that works.  So that's the C version of (let ((inhibit-quit t))
...).  So specbind creates a dynamic binding, and with unbind_to you pop
entries up to a given index again, right?

Bye,
Tassilo