bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: clemera
Subject: bug#45177: 27.1; Access to invoking top level command in minibuffer
Date: Sun, 13 Dec 2020 12:45:28 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0

I forgot to include the setup hook in my code example, here is the full version:

```elisp

(defvar saved-command nil)

(defun save-command ()
  (message "Before: %s" saved-command)
  (setq-local saved-command real-this-command)
  (message "After: %s" saved-command))

(defun example-command ()
  (interactive)
  (read-string "Example1 : ")
  (read-string "Example2 : "))

(add-hook 'minibuffer-setup-hook #'save-command)
```

Calling example-command above gives :

    Before: nil
    After: example-command

    Before: nil
    After: exit-minibuffer





reply via email to

[Prev in Thread] Current Thread [Next in Thread]