emacs-devel
[Top][All Lists]
Advanced

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

Re: Proposal: Remap interactive commands via keymaps


From: Kim F. Storm
Subject: Re: Proposal: Remap interactive commands via keymaps
Date: 10 Jan 2002 00:29:10 +0100
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1

Richard Stallman <address@hidden> writes:

> You have a good argument that using the M-x command name in
> this-command would be useful--but it is impossible.  Until the RET
> command (minibuffer-complete-and-exit) runs, there is no way of
> knowing that the M-x command name is final.  pre-command-hooks
> has to run before minibuffer-complete-and-exit is called.
>

I see; thanks for clarifying this!

So actually, the pre *and* post command hooks are run for every
key/character entered in [M-x c o m m a n d RET] with this-command set
to execute-extended-command, a series of self-insert-command, and
minibuffer-complete-and-exit.

> So unless we were to run it again for the same command
> (which seems somewhat unclean), we cannot change this.
> 

I actually think it makes good sense to run both the pre and post
command hooks for the actual command (and I would think that code
which uses those hooks actually expects this to happen -- at least all
of my code does).

IMHO, this is also more in accordance with the documenation for the
pre-/post-command-hook variables, as it says `each command', not `each
command, except those run via M-x':

Documentation:
Normal hook run before (after) each command is executed.
If an unhandled error happens in running this hook,
the hook value is set to nil, since otherwise the error
might happen repeatedly and make Emacs nonfunctional.


Should I make the change?

-- 
Kim F. Storm <address@hidden> http://www.cua.dk




reply via email to

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