From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Glenn Morris Newsgroups: gmane.emacs.bugs 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 Message-ID: References: <87y5txhcmi.fsf@felix-laptop.gnung> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1326314444 20503 80.91.229.12 (11 Jan 2012 20:40:44 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 11 Jan 2012 20:40:44 +0000 (UTC) Cc: 10384@debbugs.gnu.org To: oitofelix@gmail.com (Bruno =?UTF-8?Q?F=C3=A9lix?= Rezende Ribeiro) Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Jan 11 21:40:40 2012 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Rl4yN-0003qh-PO for geb-bug-gnu-emacs@m.gmane.org; Wed, 11 Jan 2012 21:40:39 +0100 Original-Received: from localhost ([::1]:36799 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rl4yN-0005hM-8H for geb-bug-gnu-emacs@m.gmane.org; Wed, 11 Jan 2012 15:40:39 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:36460) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rl4yK-0005hF-JO for bug-gnu-emacs@gnu.org; Wed, 11 Jan 2012 15:40:37 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rl4yJ-0002IC-EW for bug-gnu-emacs@gnu.org; Wed, 11 Jan 2012 15:40:36 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:59498) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rl4yJ-0002I8-Cy for bug-gnu-emacs@gnu.org; Wed, 11 Jan 2012 15:40:35 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1Rl4yk-0002SL-6l for bug-gnu-emacs@gnu.org; Wed, 11 Jan 2012 15:41:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Glenn Morris Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 11 Jan 2012 20:41:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10384 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 10384-submit@debbugs.gnu.org id=B10384.13263144459416 (code B ref 10384); Wed, 11 Jan 2012 20:41:02 +0000 Original-Received: (at 10384) by debbugs.gnu.org; 11 Jan 2012 20:40:45 +0000 Original-Received: from localhost ([127.0.0.1]:54170 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Rl4yT-0002Ro-Fs for submit@debbugs.gnu.org; Wed, 11 Jan 2012 15:40:45 -0500 Original-Received: from fencepost.gnu.org ([140.186.70.10]:55245) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Rl4yR-0002Rh-0f for 10384@debbugs.gnu.org; Wed, 11 Jan 2012 15:40:44 -0500 Original-Received: from rgm by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1Rl4xy-0006IL-El; Wed, 11 Jan 2012 15:40:14 -0500 X-Spook: Plame bce USCOI eavesdropping covert video Pine Gap X-Ran: #g8b[$p6fg=i0r8xCL>5I'eF"w@!Hc3y?1WW] ("Bruno =?UTF-8?Q?F=C3=A9lix?= Rezende Ribeiro"'s message of "Tue, 27 Dec 2011 20:29:41 -0200") User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:55639 Archived-At: Bruno F=C3=A9lix 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 ' 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.