Subject: Re: bug#45177: 27.1; Access to invoking top level command in minibuffer

From: [email-masked]
Date: Sat, 12 Dec 2020 14:39:47 +0100

> (defun icicle-top-level-prep ()
>    "Do top-level stuff.  Used in `pre-command-hook'."
>    (unless (> (minibuffer-depth) 0)
>      ;; ... <other stuff>
>      (unless (memq this-command
>                    '(minibuffer-complete-and-exit
>                      icicle-minibuffer-complete-and-exit
>                      exit-minibuffer
>                      icicle-exit-minibuffer))
>        (setq icicle-last-top-level-command  this-command))
>      ;; ... <other stuff>
>      ))
> 
> (defvar icicle-last-top-level-command nil
>    "Last top-level command used.")

Note that ideally I'm looking for something which allows me to
get the "innermost command that invoked a recursive
edit" as Lars described it.