Subject: Re: bug#78026: 31.0.50; browse-url-interactive-arg does not handle nil (this-command-keys)

From: Stefan Monnier <[email-masked]>
Date: Sun, 27 Apr 2025 09:54:26 -0400

>> Hello. So when fixing https://github.com/oantolin/embark/pull/750, I
>> realized that browse-url-interactive-arg does not handle
>> (this-command-keys) being the empty vector and that causes
>> browse-url-interactive-arg to emit an error when called programmatically
>> in embark.el. We should make it so that if (this-command-keys) returns
>> an empty vector, then mouse-set-point is not called.

You mean like in the patch below?

> I don't think I understand how this happens.  Can you show a simple
> recipe for reproducing this issue?

Or a description of the steps that lead to the error.

> Stefan, when can this-command-keys return an empty string or vector?
> The documentation never says anything about that?  The only situations
> I could imagine is some process filter or timer running when we just
> happened to zero out this_command_key_count, but is that possible?

    (run-with-timer 2 2 (lambda () (message "TCK = %S" (this-command-keys))))

suggests it's not just possible but is the most common case for code run
from a timer.  I expect the same holds for other async code.

        Stefan