GNU bug report logs - #45177
27.1; Access to invoking top level command in minibuffer

Previous Next

Package: emacs;

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 #35 received at 45177 <at> debbugs.gnu.org (full text, mbox):

From: clemera <at> posteo.net
To: Juri Linkov <juri <at> linkov.net>
Cc: Lars Ingebrigtsen <larsi <at> gnus.org>, 45177 <at> debbugs.gnu.org
Subject: Re: bug#45177: 27.1; Access to invoking top level command in
 minibuffer
Date: Sun, 13 Dec 2020 12:45:28 +0100
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




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.