unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* [Fwd: getting the "real" command in the `pre-command-hook'?!]
@ 2004-01-30 21:19 Kevin Rodgers
  0 siblings, 0 replies; only message in thread
From: Kevin Rodgers @ 2004-01-30 21:19 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 1009 bytes --]

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

[-- Attachment #2: getting the real" command in the `pre-command-hook'?!" --]
[-- Type: message/rfc822, Size: 1609 bytes --]

From: Klaus Berndl <klaus.berndl@sdm.de>
Subject: getting the "real" command in the `pre-command-hook'?!
Date: 29 Jan 2004 09:53:14 +0100
Message-ID: <usmhzyw3p.fsf@sdm.de>


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

[-- Attachment #3: Type: text/plain, Size: 148 bytes --]

_______________________________________________
Bug-gnu-emacs mailing list
Bug-gnu-emacs@gnu.org
http://mail.gnu.org/mailman/listinfo/bug-gnu-emacs

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2004-01-30 21:19 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-01-30 21:19 [Fwd: getting the "real" command in the `pre-command-hook'?!] Kevin Rodgers

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).