GNU bug report logs - #10384
23.2; Emacs Lisp Reference Manual - incorrect or unclear documentation about invocation condition of hooks pre-command-hook and post-command-hook

Previous Next

Package: emacs;

Reported by: oitofelix <at> gmail.com (Bruno Félix Rezende Ribeiro)

Date: Tue, 27 Dec 2011 22:30:02 UTC

Severity: minor

Found in version 23.2

Done: Chong Yidong <cyd <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Glenn Morris <rgm <at> gnu.org>
To: oitofelix <at> gmail.com (Bruno Félix Rezende Ribeiro)
Cc: 10384 <at> debbugs.gnu.org
Subject: bug#10384: 23.2; Emacs Lisp Reference Manual - incorrect or unclear documentation about invocation condition of hooks pre-command-hook and post-command-hook
Date: Wed, 11 Jan 2012 15:40:14 -0500
Bruno Félix Rezende Ribeiro wrote:

> Unless this behavior is justified by the expression "The editor command
> loop runs", I guess there is a contradiction.

Yes, it's implicit in the phrase "editor command loop".

If you think about it, the alternative interpretation doesn't make
sense. When called non-interactively, a command is just any old Lisp
function. So for it work the way you thought it might, Emacs would have
to check every single Lisp function call to see if that function was a
command, and if so run a hook before and after it. This would be pretty
impractical. Also what if a hook function called a function that
happened to be a command? :)

> When I press `C-h v pre-command-hook <RET>' I get
>
> Documentation:
> Normal hook run before each command is executed.

I could perhaps change this to say:

   Normal hook run before any command is executed interactively.

and similarly for post-command-hook.


I don't know what else to change. Perhaps add a note somewhere
(commandp?) that when a command is called non-interactively, it behaves
like any other Lisp function, and gets no special treatment.




This bug report was last modified 13 years and 178 days ago.

Previous Next


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