all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Unknown <unknown@unknown.invalid>
To: dalanicolai <dalanicolai@gmail.com>
Cc: 45392@debbugs.gnu.org
Subject: bug#45392: 28.0.50; read-from-minibuffer sets `this-command` variable to `exit-minibuffer`
Date: Fri, 08 Jan 2021 00:35:13 +0100	[thread overview]
Message-ID: <m11rew2udq.fsf@yahoo.es> (raw)
In-Reply-To: <CACJP=3kyb7aQvco5peejVBvbFZpnko-5gkNrg0m+vO1Jx8+=vQ@mail.gmail.com> (dalanicolai@gmail.com's message of "Wed, 23 Dec 2020 14:11:36 +0100")

dalanicolai <dalanicolai@gmail.com> writes:

>  Load the following code block:
>
>     (defun test ()
>       (interactive)
>       (print this-command)
>       (read-from-minibuffer "test")
>       (print this-command))
>
> Now run M-x test.
>
> The first print prints correctly "test" while the second print prints
> "exit-minibuffer"
> The docstring of the `this-command` variable says: "The command now
> being executed." I would think the command "exit-minibuffer" should have
> been completed here, so the current command being executed for the
> second print, i.e. the value of the `this-command` variable,  should again
> be "test".
>

Thanks for your bug report.  I think it is expected that 'this-command'
is 'exit-minibuffer' in this case, because 'this-command' is usually set
only once *at the beginning* of the execution of a command.  It keeps
its value until a *new* command is executed by Emacs.  This is not
explicitly said in the docstring, but it is mentioned in the Elisp Info
manual.

I don't know if the docstring could be expressed more clearly; I prefer
to leave those command loop details to the Info manuals.





  reply	other threads:[~2021-01-07 23:35 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-23 13:11 bug#45392: 28.0.50; read-from-minibuffer sets `this-command` variable to `exit-minibuffer` dalanicolai
2021-01-07 23:35 ` Unknown [this message]
2021-01-23 22:49   ` Lars Ingebrigtsen
2021-01-25 17:05     ` Juri Linkov
2021-01-29  0:11       ` dalanicolai

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m11rew2udq.fsf@yahoo.es \
    --to=unknown@unknown.invalid \
    --cc=45392@debbugs.gnu.org \
    --cc=dalanicolai@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.