GNU bug report logs -
#45177
27.1; Access to invoking top level command in minibuffer
Previous Next
Reported by: clemera <at> posteo.net
Date: Fri, 11 Dec 2020 14:21:02 UTC
Severity: normal
Tags: fixed
Found in version 27.1
Fixed in version 28.1
Done: Lars Ingebrigtsen <larsi <at> gnus.org>
Bug is archived. No further changes may be made.
Full log
Message #41 received at 45177 <at> debbugs.gnu.org (full text, mbox):
> I'm not quite sure where to bind the variable... Does the following
> work for you?
>
> diff --git a/src/callint.c b/src/callint.c
> index f80436f3d9..a01338dfe1 100644
> --- a/src/callint.c
> +++ b/src/callint.c
> @@ -283,6 +283,8 @@ DEFUN ("call-interactively", Fcall_interactively, Scall_interactively, 1, 3, 0,
> Lisp_Object save_real_this_command = Vreal_this_command;
> Lisp_Object save_last_command = KVAR (current_kboard, Vlast_command);
>
> + specbind (Qrecursive_this_command, Vreal_this_command);
> +
> if (NILP (keys))
> keys = this_command_keys, key_count = this_command_key_count;
> else
> diff --git a/src/keyboard.c b/src/keyboard.c
> index dbca5be91e..ce2b7f1ef4 100644
> --- a/src/keyboard.c
> +++ b/src/keyboard.c
> @@ -11830,6 +11830,11 @@ syms_of_keyboard (void)
> doc: /* This is like `this-command', except that commands should never modify it. */);
> Vreal_this_command = Qnil;
>
> + DEFSYM (Qrecursive_this_command, "recursive-this-command");
> + DEFVAR_LISP ("recursive-this-command", Vrecursive_this_command,
> + doc: /* This is like `real-this-command', but bound recursively in `call-interactively. */);
> + Vrecursive_this_command = Qnil;
> +
> DEFVAR_LISP ("this-command-keys-shift-translated",
> Vthis_command_keys_shift_translated,
> doc: /* Non-nil if the key sequence activating this command was shift-translated.
>
Thank you! I recompiled Emacs with this and tested with various nested
sequential and recursive calls and this correctly reports the top level
command the current minibuffer session was entered from, which is
exactly what we are looking for :)
This bug report was last modified 3 years and 330 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.