GNU bug report logs - #45392
28.0.50; read-from-minibuffer sets `this-command` variable to `exit-minibuffer`

Previous Next

Package: emacs;

Reported by: dalanicolai <dalanicolai <at> gmail.com>

Date: Wed, 23 Dec 2020 13:12:01 UTC

Severity: normal

Found in version 28.0.50

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 45392 in the body.
You can then email your comments to 45392 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#45392; Package emacs. (Wed, 23 Dec 2020 13:12:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to dalanicolai <dalanicolai <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 23 Dec 2020 13:12:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: dalanicolai <dalanicolai <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 28.0.50; read-from-minibuffer sets `this-command` variable to
 `exit-minibuffer`
Date: Wed, 23 Dec 2020 14:11:36 +0100
[Message part 1 (text/plain, inline)]
 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".


In GNU Emacs 28.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.23,
cairo version 1.16.0)
of 2020-12-21 built on daniel-Ubuntu
Repository revision: faf3613cba8571eaef2709bd7bb6f11a956b9262
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12009000
System Description: Ubuntu 20.10

Configured using:
'configure --with-imagemagick --with-cairo --with-modules'

Configured features:
XPM JPEG TIFF GIF PNG RSVG CAIRO IMAGEMAGICK SOUND GPM DBUS GSETTINGS
GLIB NOTIFY INOTIFY ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE HARFBUZZ
M17N_FLT LIBOTF ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 XDBE XIM MODULES
THREADS LIBSYSTEMD PDUMPER LCMS2

Important settings:
  value of $LC_MONETARY: nl_NL.UTF-8
  value of $LC_NUMERIC: nl_NL.UTF-8
  value of $LC_TIME: nl_NL.UTF-8
  value of $LANG: en_US.UTF-8
  value of $XMODIFIERS: @im=ibus
  locale-coding-system: utf-8-unix

Major mode: Message

Minor modes in effect:
  mml-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  auto-fill-function: message-do-auto-fill
  transient-mark-mode: t
  abbrev-mode: t

Load-path shadows:
None found.

Features:
(cus-edit cus-start cus-load wid-edit mailalias mailclient pp shadow
sort mail-extr emacsbug message rmc puny dired dired-loaddefs rfc822 mml
mml-sec epa derived epg epg-config gnus-util rmail rmail-loaddefs
text-property-search time-date mm-decode mm-bodies mm-encode mail-parse
rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045
ietf-drums mm-util mail-prsvr mail-utils help-fns radix-tree cl-print
debug backtrace help-mode find-func .emacs finder-inf info package
easymenu browse-url url url-proxy url-privacy url-expand url-methods
url-history url-cookie url-domsuf url-util mailcap url-handlers
url-parse auth-source cl-seq eieio eieio-core cl-macs eieio-loaddefs
password-cache json subr-x map url-vars seq byte-opt gv bytecomp
byte-compile cconv cl-loaddefs cl-lib iso-transl tooltip eldoc electric
uniquify ediff-hook vc-hooks lisp-float-type mwheel term/x-win x-win
term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe
tabulated-list replace newcomment text-mode elisp-mode lisp-mode
prog-mode register page tab-bar menu-bar rfn-eshadow isearch timer
select scroll-bar mouse jit-lock font-lock syntax facemenu font-core
term/tty-colors frame minibuffer cl-generic cham georgian utf-8-lang
misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms
cp51932 hebrew greek romanian slovak czech european ethiopic indian
cyrillic chinese composite charscript charprop case-table epa-hook
jka-cmpr-hook help simple abbrev obarray cl-preloaded nadvice button
loaddefs faces cus-face macroexp files window text-properties overlay
sha1 md5 base64 format env code-pages mule custom widget
hashtable-print-readable backquote threads dbusbind inotify lcms2
dynamic-setting system-font-setting font-render-setting cairo
move-toolbar gtk x-toolkit x multi-tty make-network-process emacs)

Memory information:
((conses 16 237418 22864)
(symbols 48 15091 0)
(strings 32 75289 3389)
(string-bytes 1 1916083)
(vectors 16 22714)
(vector-slots 8 306359 25686)
(floats 8 41 58)
(intervals 56 1029 11)
(buffers 984 16))
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#45392; Package emacs. (Thu, 07 Jan 2021 23:36:01 GMT) Full text and rfc822 format available.

Message #8 received at 45392 <at> debbugs.gnu.org (full text, mbox):

From: Daniel Martín <mardani29 <at> yahoo.es>
To: dalanicolai <dalanicolai <at> gmail.com>
Cc: 45392 <at> debbugs.gnu.org
Subject: Re: bug#45392: 28.0.50; read-from-minibuffer sets `this-command`
 variable to `exit-minibuffer`
Date: Fri, 08 Jan 2021 00:35:13 +0100
dalanicolai <dalanicolai <at> 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.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#45392; Package emacs. (Sat, 23 Jan 2021 22:51:01 GMT) Full text and rfc822 format available.

Message #11 received at 45392 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Daniel Martín <mardani29 <at> yahoo.es>
Cc: dalanicolai <dalanicolai <at> gmail.com>, 45392 <at> debbugs.gnu.org
Subject: Re: bug#45392: 28.0.50; read-from-minibuffer sets `this-command`
 variable to `exit-minibuffer`
Date: Sat, 23 Jan 2021 23:49:54 +0100
Daniel Martín <mardani29 <at> yahoo.es> writes:

> 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.

I think so, too, so there doesn't seem to be anything further to do in
this bug report, and I'm closing it.  If there's more to be done here,
please respond to the debbugs address and we'll reopen.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




bug closed, send any further explanations to 45392 <at> debbugs.gnu.org and dalanicolai <dalanicolai <at> gmail.com> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sat, 23 Jan 2021 22:51:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#45392; Package emacs. (Mon, 25 Jan 2021 17:09:02 GMT) Full text and rfc822 format available.

Message #16 received at 45392 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> linkov.net>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: dalanicolai <dalanicolai <at> gmail.com>, 45392 <at> debbugs.gnu.org,
 Daniel Martín <mardani29 <at> yahoo.es>
Subject: Re: bug#45392: 28.0.50; read-from-minibuffer sets `this-command`
 variable to `exit-minibuffer`
Date: Mon, 25 Jan 2021 19:05:55 +0200
>> 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.
>
> I think so, too, so there doesn't seem to be anything further to do in
> this bug report, and I'm closing it.  If there's more to be done here,
> please respond to the debbugs address and we'll reopen.

Is it what the recently added varible 'current-minibuffer-command'
intended to do?  Then OP could use it like

  (defun test ()
    (interactive)
    (print current-minibuffer-command)
    (read-from-minibuffer "test")
    (print current-minibuffer-command))




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#45392; Package emacs. (Fri, 29 Jan 2021 00:12:02 GMT) Full text and rfc822 format available.

Message #19 received at 45392 <at> debbugs.gnu.org (full text, mbox):

From: dalanicolai <dalanicolai <at> gmail.com>
To: Juri Linkov <juri <at> linkov.net>
Cc: Lars Ingebrigtsen <larsi <at> gnus.org>, 45392 <at> debbugs.gnu.org,
 Daniel Martín <mardani29 <at> yahoo.es>
Subject: Re: bug#45392: 28.0.50; read-from-minibuffer sets `this-command`
 variable to `exit-minibuffer`
Date: Fri, 29 Jan 2021 01:11:33 +0100
[Message part 1 (text/plain, inline)]
Yes, that's it. Great, thanks!

On Mon, 25 Jan 2021 at 18:08, Juri Linkov <juri <at> linkov.net> wrote:

> >> 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.
> >
> > I think so, too, so there doesn't seem to be anything further to do in
> > this bug report, and I'm closing it.  If there's more to be done here,
> > please respond to the debbugs address and we'll reopen.
>
> Is it what the recently added varible 'current-minibuffer-command'
> intended to do?  Then OP could use it like
>
>   (defun test ()
>     (interactive)
>     (print current-minibuffer-command)
>     (read-from-minibuffer "test")
>     (print current-minibuffer-command))
>
[Message part 2 (text/html, inline)]

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 26 Feb 2021 12:24:16 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 58 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.