summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuri Linkov <juri@linkov.net>2021-11-30 20:12:06 +0200
committerJuri Linkov <juri@linkov.net>2021-11-30 20:12:06 +0200
commit9aa8fd6e62c7621c0e722f874a02007debed91b0 (patch)
tree65a3c1b1694b20ea96f0fe4a3be2c035c3f2c61e
parent70c229b1fc4f2eb66b5a173cfc8473e4b7ce48f0 (diff)
downloademacs-9aa8fd6e62c7621c0e722f874a02007debed91b0.tar.gz
* src/callint.c (Fcall_interactively): Fix inhibit_mouse_event_check.
Don't search for the next mouse event with parameters when inhibit-mouse-event-check is non-nil (bug#50067).
-rw-r--r--src/callint.c27
1 files changed, 17 insertions, 10 deletions
diff --git a/src/callint.c b/src/callint.c
index 44dae361c1f..68f103759ae 100644
--- a/src/callint.c
+++ b/src/callint.c
@@ -364,11 +364,14 @@ invoke it (via an `interactive' spec that contains, for instance, an
/* The index of the next element of this_command_keys to examine for
the 'e' interactive code. Initialize it to point to the first
- event with parameters. */
- ptrdiff_t next_event;
- for (next_event = 0; next_event < key_count; next_event++)
- if (EVENT_HAS_PARAMETERS (AREF (keys, next_event)))
- break;
+ event with parameters. When `inhibit_mouse_event_check' is non-nil,
+ the command can accept an event without parameters,
+ so don't search for the event with parameters in this case. */
+ ptrdiff_t next_event = 0;
+ if (!inhibit_mouse_event_check)
+ for (; next_event < key_count; next_event++)
+ if (EVENT_HAS_PARAMETERS (AREF (keys, next_event)))
+ break;
/* Handle special starting chars `*' and `@'. Also `-'. */
/* Note that `+' is reserved for user extensions. */
@@ -606,7 +609,7 @@ invoke it (via an `interactive' spec that contains, for instance, an
break;
case 'e': /* The invoking event. */
- if (!inhibit_mouse_event_check && next_event >= key_count)
+ if (next_event >= key_count)
error ("%s must be bound to an event with parameters",
(SYMBOLP (function)
? SSDATA (SYMBOL_NAME (function))
@@ -614,11 +617,15 @@ invoke it (via an `interactive' spec that contains, for instance, an
args[i] = AREF (keys, next_event);
varies[i] = -1;
- /* Find the next parameterized event. */
- do
+ /* `inhibit_mouse_event_check' allows non-parameterized events. */
+ if (inhibit_mouse_event_check)
next_event++;
- while (next_event < key_count
- && ! EVENT_HAS_PARAMETERS (AREF (keys, next_event)));
+ else
+ /* Find the next parameterized event. */
+ do
+ next_event++;
+ while (next_event < key_count
+ && ! EVENT_HAS_PARAMETERS (AREF (keys, next_event)));
break;