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

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

[Fwd: getting the "real" command in the `pre-command-hook'?!]


From: Kevin Rodgers
Subject: [Fwd: getting the "real" command in the `pre-command-hook'?!]
Date: Fri, 30 Jan 2004 14:19:46 -0700
User-agent: Mozilla/5.0 (X11; U; SunOS i86pc; en-US; rv:0.9.4.1) Gecko/20020406 Netscape6/6.2.2

I think this is a bug.  In GNU Emacs 21.3.1 (i386-pc-solaris2.7, X toolkit),
I did this in the *scratch* buffer:

(add-hook 'pre-command-hook
          (lambda () (message "pre-command-hook: %s, %s"
                              last-command this-command)))

And then typed:

M-x list-buffers RET
C-x b

Which generated this in the *Messages* buffer:

pre-command-hook: eval-print-last-sexp, execute-extended-command
pre-command-hook: execute-extended-command, self-insert-command
pre-command-hook: self-insert-command, self-insert-command [11 times]
pre-command-hook: self-insert-command, minibuffer-complete-and-exit
pre-command-hook: list-buffers, switch-to-buffer

Note that there is no "minibuffer-complete-and-exit, list-buffers" entry.

Fexecute_extended_command sets Vthis_command (but not Vlast_command)
before calling the Lisp function (list-buffers in this example) via
Fcommand_execute, but neither one of them runs the pre-command-hook
(or post-command-hook) Lisp functions.

--
Kevin Rodgers
--- Begin Message --- Subject: getting the "real" command in the `pre-command-hook'?! Date: 29 Jan 2004 09:53:14 +0100 User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3
Hi,

Regardless which interactive command XXX i call via M-x XXX RET i always get
`minibuffer-complete-and-exit' as content of `this-command' in the
`pre-command-hook' direct before running XXX.

Sure, this is not against the documentation of `this-command' but now I'm
wondering how can i get the name "XXX" in the `pre-command-hook' direct before
XXX runs? Seems that `this-command' is not what i need ;-)

With other words: I need the symbol-name of the current running command in the
`pre-command-hook' and i need the REAL command not the
minibuffer-exiting-command!

Thanks a lot in advance for any help,
Klaus

-- 
Klaus Berndl                    mailto: klaus.berndl@sdm.de
sd&m AG                         http://www.sdm.de
software design & management    
Carl-Wery-Str. 42, 81739 Muenchen, Germany
Tel +49 89 63812-392, Fax -220

--- End Message ---

reply via email to

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