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.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 10384 in the body.
You can then email your comments to 10384 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#10384; Package emacs. (Tue, 27 Dec 2011 22:30:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to oitofelix <at> gmail.com (Bruno Félix Rezende Ribeiro):
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Tue, 27 Dec 2011 22:30:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: oitofelix <at> gmail.com (Bruno Félix Rezende Ribeiro)
To: bug-gnu-emacs <at> gnu.org
Subject: 23.2; Emacs Lisp Reference Manual - incorrect or unclear documentation
	about invocation condition of hooks pre-command-hook and
	post-command-hook
Date: Tue, 27 Dec 2011 20:29:41 -0200
In GNU Emacs Lisp Reference Manual, edition 3.0, bundled with GNU Emacs
23.2, section 21.1 (entitled "Command Loop Overview") which documents
hooks `pre-command-hook' and `post-command-hook' describes them as
follow:

 -- Variable: pre-command-hook
     The editor command loop runs this normal hook before each command.
     At that time, `this-command' contains the command that is about to
     run, and `last-command' describes the previous command.  *Note
     Command Loop Info::.

 -- Variable: post-command-hook
     The editor command loop runs this normal hook after each command
     (including commands terminated prematurely by quitting or by
     errors), and also when the command loop is first entered.  At that
     time, `this-command' refers to the command that just ran, and
     `last-command' refers to the command before that.

But the same manual defines `command', in section 21.3 "Interactive
Call", as follow:

 -- Function: commandp object &optional for-call-interactively
     Returns `t' if OBJECT is suitable for calling interactively; that
     is, if OBJECT is a command.  Otherwise, returns `nil'.

     Interactively-callable objects include strings and vectors (which
     are treated as keyboard macros), lambda expressions that contain a
     top-level `interactive' form (*note Using Interactive::),
     byte-code function objects made from such lambda expressions,
     autoload objects that are declared as interactive (non-`nil' fourth
     argument to `autoload'), and some primitive functions.

     A symbol satisfies `commandp' if it has a non-`nil'
     `interactive-form' property, or if its function definition
     satisfies `commandp'.  Keys and keymaps are not commands.  Rather,
     they are used to look up commands (*note Keymaps::).

     If FOR-CALL-INTERACTIVELY is non-`nil', then `commandp' returns
     `t' only for objects that `call-interactively' could call--thus,
     not for keyboard macros.

     See `documentation' in *note Accessing Documentation::, for a
     realistic example of using `commandp'.

Assume there are two interactively callable functions, `foo' and `bar'
such that the former calls the last, and only the last, and the last
don't calls anything else.  When you call interactively `foo'
pre-command-hook and post-command-hook, despite my expectation, runs
only once.  When I read the documentation I was pretty sure that it will
run twice, one time to each command being called.  The manual don't make
clear that the above mentioned hooks only runs to interactive calls, but
they says, in general manner, that it will run to every command.
Unless this behavior is justified by the expression "The editor command
loop runs", I guess there is a contradiction.  But, in both cases,
the manual seems unclear to me.  The same occur to documentation of
these variables.  When I press `C-h v pre-command-hook <RET>' I get

Documentation:
Normal hook run before 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.

Already, when I press `C-h v post-command-hook <RET>' I get

Documentation:
Normal hook run 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.

What makes you think these hooks runs even to commands called from
interactively called commands, what isn't true.



In GNU Emacs 23.2.1 (i486-pc-linux-gnu, GTK+ Version 2.20.0)
 of 2010-12-11 on raven, modified by Debian
Windowing system distributor `The X.Org Foundation', version 11.0.10707000
configured using `configure  '--build' 'i486-linux-gnu' '--build' 'i486-linux-gnu' '--prefix=/usr' '--sharedstatedir=/var/lib' '--libexecdir=/usr/lib' '--localstatedir=/var/lib' '--infodir=/usr/share/info' '--mandir=/usr/share/man' '--with-pop=yes' '--enable-locallisppath=/etc/emacs23:/etc/emacs:/usr/local/share/emacs/23.2/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/23.2/site-lisp:/usr/share/emacs/site-lisp:/usr/share/emacs/23.2/leim' '--with-x=yes' '--with-x-toolkit=gtk' '--with-toolkit-scroll-bars' 'build_alias=i486-linux-gnu' 'CFLAGS=-DDEBIAN -g -O2' 'LDFLAGS=-g' 'CPPFLAGS=''

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: pt_BR.UTF-8
  value of $XMODIFIERS: nil
  locale-coding-system: utf-8-unix
  default enable-multibyte-characters: t

Major mode: Info

Minor modes in effect:
  server-mode: t
  display-time-mode: t
  display-battery-mode: t
  desktop-save-mode: t
  tooltip-mode: t
  mouse-wheel-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t

Recent input:
d <tab> SPC l o o <tab> <return> <tab> <return> C-v 
C-n C-n C-n C-n C-n C-n C-n C-e C-a M-< C-n C-n C-n 
C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n 
C-n C-n C-n C-n C-n C-p C-p M-{ M-{ M-{ M-} <down> 
<down> <down> <down> <down> <down> <down> <down> <down> 
<down> <down> <down> <down> <down> <down> <down> <down> 
<down> <down> <down> <down> <down> <up> <up> <up> <up> 
<down> <up> <down> <down> <down> <down> <down> <down> 
<down> <down> <down> <down> <down> <down> <down> <down> 
<down> <down> <down> <down> <down> <down> M-< <down> 
<down> <down> <down> <down> <down> <down> <down> <down> 
<down> <down> <down> <down> <down> <down> <down> <down> 
<down> <down> <down> <down> <down> <down> <down> <down> 
<down> <down> <down> <down> <down> <down> <down> <down> 
<down> <down> <down> <down> <down> <down> <down> <down> 
<down> <down> <down> <down> <down> <down> <down> <down> 
<down> <down> <down> <down> <down> <down> <down> <down> 
<down> <down> <down> <down> <down> <down> <up> <up> 
<up> <up> <up> <up> <down> <down> <down> <down> <down> 
<down> <down> <up> <up> <up> <up> <up> <up> <up> <up> 
<up> <up> <up> <up> <up> <up> <up> <up> <up> <up> <up> 
<up> <up> <up> <up> u <return> C-h C-g M-> C-h v p 
r e - c o m m a n d - h o o k <return> C-x 1 M-< M-> 
M-{ M-{ M-{ M-{ M-{ M-{ M-{ M-} M-{ t C-s p r e - c 
o m m a n d - h o o k C-s C-s C-s C-s C-s C-s C-s <return> 
M-< M-< M-> M-> M-{ M-{ M-{ M-{ M-{ M-} C-x b <return> 
C-x b <return> C-x b * <backspace> C-g M-x m a k <tab> 
- <backspace> <backspace> <backspace> <backspace> <backspace> 
r e p o <tab> r t <tab> <return>

Recent messages:
Mark saved where search started
Mark set [4 times]
Quit
Making completion list...
Checking spelling of WHETER...
ispell-overlay-window: Attempt to split minibuffer window
Checking spelling of WHETER...
ispell-overlay-window: Attempt to split minibuffer window
Checking spelling of INVOCATION...
INVOCATION is correct

Load-path shadows:
/usr/share/emacs23/site-lisp/emacs-jabber/jabber-ft-server hides /usr/share/emacs/site-lisp/emacs-jabber/jabber-ft-server
/usr/share/emacs23/site-lisp/emacs-jabber/jabber hides /usr/share/emacs/site-lisp/emacs-jabber/jabber
/usr/share/emacs23/site-lisp/emacs-jabber/jabber-sasl hides /usr/share/emacs/site-lisp/emacs-jabber/jabber-sasl
/usr/share/emacs23/site-lisp/emacs-jabber/jabber-version hides /usr/share/emacs/site-lisp/emacs-jabber/jabber-version
/usr/share/emacs23/site-lisp/emacs-jabber/jabber-history hides /usr/share/emacs/site-lisp/emacs-jabber/jabber-history
/usr/share/emacs23/site-lisp/emacs-jabber/jabber-activity hides /usr/share/emacs/site-lisp/emacs-jabber/jabber-activity
/usr/share/emacs23/site-lisp/emacs-jabber/jabber-export hides /usr/share/emacs/site-lisp/emacs-jabber/jabber-export
/usr/share/emacs23/site-lisp/emacs-jabber/jabber-ahc-presence hides /usr/share/emacs/site-lisp/emacs-jabber/jabber-ahc-presence
/usr/share/emacs23/site-lisp/emacs-jabber/jabber-screen hides /usr/share/emacs/site-lisp/emacs-jabber/jabber-screen
/usr/share/emacs23/site-lisp/emacs-jabber/jabber-iq hides /usr/share/emacs/site-lisp/emacs-jabber/jabber-iq
/usr/share/emacs23/site-lisp/emacs-jabber/jabber-ft-common hides /usr/share/emacs/site-lisp/emacs-jabber/jabber-ft-common
/usr/share/emacs23/site-lisp/emacs-jabber/jabber-avatar hides /usr/share/emacs/site-lisp/emacs-jabber/jabber-avatar
/usr/share/emacs23/site-lisp/emacs-jabber/jabber-ahc hides /usr/share/emacs/site-lisp/emacs-jabber/jabber-ahc
/usr/share/emacs23/site-lisp/emacs-jabber/jabber-si-common hides /usr/share/emacs/site-lisp/emacs-jabber/jabber-si-common
/usr/share/emacs23/site-lisp/emacs-jabber/jabber-conn hides /usr/share/emacs/site-lisp/emacs-jabber/jabber-conn
/usr/share/emacs23/site-lisp/emacs-jabber/jabber-muc hides /usr/share/emacs/site-lisp/emacs-jabber/jabber-muc
/usr/share/emacs23/site-lisp/emacs-jabber/jabber-truncate hides /usr/share/emacs/site-lisp/emacs-jabber/jabber-truncate
/usr/share/emacs23/site-lisp/emacs-jabber/jabber-alert hides /usr/share/emacs/site-lisp/emacs-jabber/jabber-alert
/usr/share/emacs23/site-lisp/emacs-jabber/srv hides /usr/share/emacs/site-lisp/emacs-jabber/srv
/usr/share/emacs23/site-lisp/emacs-jabber/jabber-widget hides /usr/share/emacs/site-lisp/emacs-jabber/jabber-widget
/usr/share/emacs23/site-lisp/emacs-jabber/jabber-chatbuffer hides /usr/share/emacs/site-lisp/emacs-jabber/jabber-chatbuffer
/usr/share/emacs23/site-lisp/emacs-jabber/jabber-wmii hides /usr/share/emacs/site-lisp/emacs-jabber/jabber-wmii
/usr/share/emacs23/site-lisp/emacs-jabber/fsm hides /usr/share/emacs/site-lisp/emacs-jabber/fsm
/usr/share/emacs23/site-lisp/emacs-jabber/jabber-socks5 hides /usr/share/emacs/site-lisp/emacs-jabber/jabber-socks5
/usr/share/emacs23/site-lisp/emacs-jabber/jabber-roster hides /usr/share/emacs/site-lisp/emacs-jabber/jabber-roster
/usr/share/emacs23/site-lisp/emacs-jabber/jabber-vcard hides /usr/share/emacs/site-lisp/emacs-jabber/jabber-vcard
/usr/share/emacs23/site-lisp/emacs-jabber/jabber-newdisco hides /usr/share/emacs/site-lisp/emacs-jabber/jabber-newdisco
/usr/share/emacs23/site-lisp/emacs-jabber/jabber-chatstates hides /usr/share/emacs/site-lisp/emacs-jabber/jabber-chatstates
/usr/share/emacs23/site-lisp/emacs-jabber/jabber-private hides /usr/share/emacs/site-lisp/emacs-jabber/jabber-private
/usr/share/emacs23/site-lisp/emacs-jabber/jabber-ourversion hides /usr/share/emacs/site-lisp/emacs-jabber/jabber-ourversion
/usr/share/emacs23/site-lisp/emacs-jabber/jabber-awesome hides /usr/share/emacs/site-lisp/emacs-jabber/jabber-awesome
/usr/share/emacs23/site-lisp/emacs-jabber/jabber-menu hides /usr/share/emacs/site-lisp/emacs-jabber/jabber-menu
/usr/share/emacs23/site-lisp/emacs-jabber/jabber-chat hides /usr/share/emacs/site-lisp/emacs-jabber/jabber-chat
/usr/share/emacs23/site-lisp/emacs-jabber/jabber-sawfish hides /usr/share/emacs/site-lisp/emacs-jabber/jabber-sawfish
/usr/share/emacs23/site-lisp/emacs-jabber/jabber-time hides /usr/share/emacs/site-lisp/emacs-jabber/jabber-time
/usr/share/emacs23/site-lisp/emacs-jabber/jabber-xml hides /usr/share/emacs/site-lisp/emacs-jabber/jabber-xml
/usr/share/emacs23/site-lisp/emacs-jabber/jabber-watch hides /usr/share/emacs/site-lisp/emacs-jabber/jabber-watch
/usr/share/emacs23/site-lisp/emacs-jabber/jabber-disco hides /usr/share/emacs/site-lisp/emacs-jabber/jabber-disco
/usr/share/emacs23/site-lisp/emacs-jabber/jabber-osd hides /usr/share/emacs/site-lisp/emacs-jabber/jabber-osd
/usr/share/emacs23/site-lisp/emacs-jabber/jabber-keymap hides /usr/share/emacs/site-lisp/emacs-jabber/jabber-keymap
/usr/share/emacs23/site-lisp/emacs-jabber/jabber-keepalive hides /usr/share/emacs/site-lisp/emacs-jabber/jabber-keepalive
/usr/share/emacs23/site-lisp/emacs-jabber/jabber-browse hides /usr/share/emacs/site-lisp/emacs-jabber/jabber-browse
/usr/share/emacs23/site-lisp/emacs-jabber/jabber-register hides /usr/share/emacs/site-lisp/emacs-jabber/jabber-register
/usr/share/emacs23/site-lisp/emacs-jabber/jabber-gmail hides /usr/share/emacs/site-lisp/emacs-jabber/jabber-gmail
/usr/share/emacs23/site-lisp/emacs-jabber/jabber-xmessage hides /usr/share/emacs/site-lisp/emacs-jabber/jabber-xmessage
/usr/share/emacs23/site-lisp/emacs-jabber/jabber-feature-neg hides /usr/share/emacs/site-lisp/emacs-jabber/jabber-feature-neg
/usr/share/emacs23/site-lisp/emacs-jabber/jabber-search hides /usr/share/emacs/site-lisp/emacs-jabber/jabber-search
/usr/share/emacs23/site-lisp/emacs-jabber/jabber-vcard-avatars hides /usr/share/emacs/site-lisp/emacs-jabber/jabber-vcard-avatars
/usr/share/emacs23/site-lisp/emacs-jabber/jabber-si-server hides /usr/share/emacs/site-lisp/emacs-jabber/jabber-si-server
/usr/share/emacs23/site-lisp/emacs-jabber/jabber-festival hides /usr/share/emacs/site-lisp/emacs-jabber/jabber-festival
/usr/share/emacs23/site-lisp/emacs-jabber/jabber-ft-client hides /usr/share/emacs/site-lisp/emacs-jabber/jabber-ft-client
/usr/share/emacs23/site-lisp/emacs-jabber/jabber-autoaway hides /usr/share/emacs/site-lisp/emacs-jabber/jabber-autoaway
/usr/share/emacs23/site-lisp/emacs-jabber/jabber-compose hides /usr/share/emacs/site-lisp/emacs-jabber/jabber-compose
/usr/share/emacs23/site-lisp/emacs-jabber/jabber-modeline hides /usr/share/emacs/site-lisp/emacs-jabber/jabber-modeline
/usr/share/emacs23/site-lisp/emacs-jabber/jabber-ratpoison hides /usr/share/emacs/site-lisp/emacs-jabber/jabber-ratpoison
/usr/share/emacs23/site-lisp/emacs-jabber/jabber-logon hides /usr/share/emacs/site-lisp/emacs-jabber/jabber-logon
/usr/share/emacs23/site-lisp/emacs-jabber/jabber-events hides /usr/share/emacs/site-lisp/emacs-jabber/jabber-events
/usr/share/emacs23/site-lisp/emacs-jabber/jabber-si-client hides /usr/share/emacs/site-lisp/emacs-jabber/jabber-si-client
/usr/share/emacs23/site-lisp/emacs-jabber/jabber-core hides /usr/share/emacs/site-lisp/emacs-jabber/jabber-core
/usr/share/emacs23/site-lisp/emacs-jabber/jabber-presence hides /usr/share/emacs/site-lisp/emacs-jabber/jabber-presence
/usr/share/emacs23/site-lisp/emacs-jabber/jabber-muc-nick-completion hides /usr/share/emacs/site-lisp/emacs-jabber/jabber-muc-nick-completion
/usr/share/emacs23/site-lisp/emacs-jabber/jabber-bookmarks hides /usr/share/emacs/site-lisp/emacs-jabber/jabber-bookmarks
/usr/share/emacs23/site-lisp/emacs-jabber/jabber-util hides /usr/share/emacs/site-lisp/emacs-jabber/jabber-util
/usr/share/emacs/site-lisp/debian-startup hides /usr/share/emacs/23.2/site-lisp/debian-startup
/usr/share/emacs23/site-lisp/cedet-common/ezimage hides /usr/share/emacs/23.2/lisp/ezimage
/usr/share/emacs23/site-lisp/speedbar/dframe hides /usr/share/emacs/23.2/lisp/dframe
/usr/share/emacs23/site-lisp/speedbar/speedbar hides /usr/share/emacs/23.2/lisp/speedbar
/usr/share/emacs23/site-lisp/flim/md4 hides /usr/share/emacs/23.2/lisp/md4
/usr/share/emacs23/site-lisp/flim/sha1 hides /usr/share/emacs/23.2/lisp/sha1
/usr/share/emacs23/site-lisp/flim/hex-util hides /usr/share/emacs/23.2/lisp/hex-util
/usr/share/emacs23/site-lisp/speedbar/sb-image hides /usr/share/emacs/23.2/lisp/sb-image
/usr/share/emacs23/site-lisp/dictionaries-common/ispell hides /usr/share/emacs/23.2/lisp/textmodes/ispell
/usr/share/emacs23/site-lisp/dictionaries-common/flyspell hides /usr/share/emacs/23.2/lisp/textmodes/flyspell
/usr/share/emacs23/site-lisp/flim/ntlm hides /usr/share/emacs/23.2/lisp/net/ntlm
/usr/share/emacs23/site-lisp/flim/hmac-def hides /usr/share/emacs/23.2/lisp/net/hmac-def
/usr/share/emacs23/site-lisp/flim/sasl-cram hides /usr/share/emacs/23.2/lisp/net/sasl-cram
/usr/share/emacs23/site-lisp/flim/sasl hides /usr/share/emacs/23.2/lisp/net/sasl
/usr/share/emacs23/site-lisp/flim/sasl-digest hides /usr/share/emacs/23.2/lisp/net/sasl-digest
/usr/share/emacs23/site-lisp/flim/hmac-md5 hides /usr/share/emacs/23.2/lisp/net/hmac-md5
/usr/share/emacs23/site-lisp/flim/sasl-ntlm hides /usr/share/emacs/23.2/lisp/net/sasl-ntlm
/usr/share/emacs23/site-lisp/eieio/chart hides /usr/share/emacs/23.2/lisp/emacs-lisp/chart
/usr/share/emacs23/site-lisp/eieio/eieio hides /usr/share/emacs/23.2/lisp/emacs-lisp/eieio
/usr/share/emacs23/site-lisp/emms/tq hides /usr/share/emacs/23.2/lisp/emacs-lisp/tq
/usr/share/emacs23/site-lisp/eieio/eieio-comp hides /usr/share/emacs/23.2/lisp/emacs-lisp/eieio-comp
/usr/share/emacs23/site-lisp/eieio/eieio-opt hides /usr/share/emacs/23.2/lisp/emacs-lisp/eieio-opt
/usr/share/emacs23/site-lisp/eieio/eieio-base hides /usr/share/emacs/23.2/lisp/emacs-lisp/eieio-base
/usr/share/emacs23/site-lisp/eieio/eieio-speedbar hides /usr/share/emacs/23.2/lisp/emacs-lisp/eieio-speedbar
/usr/share/emacs23/site-lisp/eieio/eieio-custom hides /usr/share/emacs/23.2/lisp/emacs-lisp/eieio-custom
/usr/share/emacs23/site-lisp/semantic/semantic hides /usr/share/emacs/23.2/lisp/cedet/semantic
/usr/share/emacs23/site-lisp/cedet-common/cedet hides /usr/share/emacs/23.2/lisp/cedet/cedet
/usr/share/emacs/23.2/site-lisp/ede/ede hides /usr/share/emacs/23.2/lisp/cedet/ede
/usr/share/emacs23/site-lisp/cedet-common/inversion hides /usr/share/emacs/23.2/lisp/cedet/inversion
/usr/share/emacs23/site-lisp/cedet-common/mode-local hides /usr/share/emacs/23.2/lisp/cedet/mode-local
/usr/share/emacs23/site-lisp/cedet-common/cedet-files hides /usr/share/emacs/23.2/lisp/cedet/cedet-files

Features:
(gnus-fun starttls mailalias smtpmail sendmail dictionary link
connection newcomment ispell shadow bookmark pp emacsbug multi-isearch
eieio-opt help-mode view flow-fill gnus-cite smiley ansi-color mail-extr
gnus-async gnus-bcklg byte-opt bytecomp byte-compile gnus-ml disp-table
parse-time utf-7 utf7 nnimap imap nndraft nnmh auth-source gnus-agent
gnus-srvr gnus-score score-mode nnvirtual gnus-msg gnus-art mm-uu
mml2015 epg-config mm-view smime dig nntp gnus-cache gnus-sum nnoo
gnus-group gnus-undo nnmail mail-source format-spec gnus-start gnus-spec
gnus-int gnus-range message ecomplete rfc822 mml mml-sec password-cache
mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045 qp
ietf-drums mailabbrev gmm-utils mailheader canlock sha1 sha1-el hex-util
hashcash gnus-win semantic-edit semantic-el semantic-bovine bovine-debug
semantic-debug jka-compr sb-info info w3-auto espeak-key-bindings
espeak-core espeak-customize espeak-elisp-facilities espeak joystick
emms-lastfm emms-url url url-proxy url-privacy url-expand url-methods
url-history url-cookie url-util url-parse timezone url-vars mailcap
emms-browser sort emms-playlist-sort emms-score emms-player-xine
emms-player-mpd tq emms-playing-time emms-lyrics emms-streams
emms-mode-line emms-cache emms-info-ogginfo emms-info-mp3info emms-info
later-do emms-playlist-mode emms-player-mplayer emms-player-simple
emms-source-playlist emms-source-file dired regexp-opt emms-setup emms
emms-compat edmacro kmacro windmove server gnus gnus-ems nnheader
gnus-util netrc time-date mail-utils mm-util mail-prsvr time battery
desktop cus-start cus-load cedet cedet-contrib-load speedbar-load
semantic-load semantic-ia-sb semantic-analyze semantic-ctxt
semantic-format semantic-cb semantic-sort semanticdb-find semanticdb-el
semanticdb-search semantic-find semanticdb semantic-util-modes
semantic-util semantic semantic-lex semantic-tag working fame
semantic-fw mode-local find-func derived eieio-load ede-speedbar ede
ede-load eieio-speedbar speedbar sb-image ezimage dframe easymenu assoc
eieio-custom wid-edit ede-source eieio-base eieio cl cl-19 cogre-load
cedet-load inversion ecb-autoloads debian-el debian-el-loaddefs w3m-wget
w3m-load emms-auto jabber-autoloads emacs-goodies-el
emacs-goodies-custom emacs-goodies-loaddefs easy-mmode cedet-autogen
advice advice-preload autoload help-fns tooltip ediff-hook vc-hooks
lisp-float-type mwheel x-win x-dnd font-setting tool-bar dnd fontset
image fringe lisp-mode register page menu-bar rfn-eshadow timer select
scroll-bar mldrag mouse jit-lock font-lock syntax facemenu font-core
frame cham georgian utf-8-lang misc-lang vietnamese tibetan thai
tai-viet lao korean japanese hebrew greek romanian slovak czech european
ethiopic indian cyrillic chinese case-table epa-hook jka-cmpr-hook help
simple abbrev loaddefs button minibuffer faces cus-face files
text-properties overlay md5 base64 format env code-pages mule custom
widget hashtable-print-readable backquote make-network-process dbusbind
system-font-setting font-render-setting gtk x-toolkit x multi-tty emacs)

-- 
Bruno Félix Rezende Ribeiro (oitofelix)

Ps: Please, let me know my english errors




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#10384; Package emacs. (Wed, 11 Jan 2012 20:41:02 GMT) Full text and rfc822 format available.

Message #8 received at 10384 <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: oitofelix <at> gmail.com (Bruno Félix Rezende Ribeiro)
Cc: 10384 <at> debbugs.gnu.org
Subject: Re: 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.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#10384; Package emacs. (Wed, 11 Jan 2012 22:42:02 GMT) Full text and rfc822 format available.

Message #11 received at 10384 <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: oitofelix <at> gmail.com (Bruno Félix Rezende Ribeiro)
Cc: 10384 <at> debbugs.gnu.org
Subject: Re: 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 17:40:55 -0500
Glenn Morris wrote:

>> Normal hook run before each command is executed.
>
> I could perhaps change this to say:
>
>    Normal hook run before any command is executed interactively.

This probably isn't an improvement though, because it might suggest that
call-interactively runs these hooks, when it doesn't.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#10384; Package emacs. (Thu, 12 Jan 2012 01:26:01 GMT) Full text and rfc822 format available.

Message #14 received at 10384 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
To: Glenn Morris <rgm <at> gnu.org>
Cc: 10384 <at> debbugs.gnu.org,
	Bruno Félix Rezende Ribeiro <oitofelix <at> gmail.com>
Subject: Re: 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 20:24:34 -0500
>>> Normal hook run before each command is executed.
>> 
>> I could perhaps change this to say:
>> 
>> Normal hook run before any command is executed interactively.

> This probably isn't an improvement though, because it might suggest that
> call-interactively runs these hooks, when it doesn't.

Agreed.  If we want to be more careful we'd have to say something like
"Hook run before the command loop executes a command".


        Stefan




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#10384; Package emacs. (Mon, 16 Jan 2012 09:19:02 GMT) Full text and rfc822 format available.

Message #17 received at 10384 <at> debbugs.gnu.org (full text, mbox):

From: oitofelix <at> gmail.com (Bruno Félix Rezende Ribeiro)
To: rgm <at> gnu.org, 10384 <at> debbugs.gnu.org
Subject: [Bruno Félix Rezende Ribeiro] Re: 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: Mon, 16 Jan 2012 07:21:35 -0200
[Message part 1 (message/rfc822, inline)]
From: oitofelix <at> gmail.com (Bruno Félix Rezende Ribeiro)
To: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
Subject: Re: 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: Sun, 15 Jan 2012 16:45:24 -0200
All these suggestions looks great.  Any of these would help avoid that
nonsense thought described in the bug report and I think it don't will
generate any further problem with the definition and inter-description
relation, taking in account yours considerations.

Thanks.
-- 
Bruno Félix Rezende Ribeiro (oitofelix)

Uns o chamam de super-vaca...
Outros de hyper-touro...
Eu o chamo simplesmente: meta-gnu!

!A ilha não se curva!
[Message part 2 (text/plain, inline)]

-- 
Bruno Félix Rezende Ribeiro (oitofelix)

Uns o chamam de super-vaca...
Outros de hyper-touro...
Eu o chamo simplesmente: meta-gnu!

!A ilha não se curva!

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#10384; Package emacs. (Fri, 27 Jan 2012 08:37:01 GMT) Full text and rfc822 format available.

Message #20 received at 10384 <at> debbugs.gnu.org (full text, mbox):

From: Chong Yidong <cyd <at> gnu.org>
To: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
Cc: Glenn Morris <rgm <at> gnu.org>,
	Bruno Félix Rezende Ribeiro
	<oitofelix <at> gmail.com>, 10384 <at> debbugs.gnu.org
Subject: Re: 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: Fri, 27 Jan 2012 16:36:02 +0800
Stefan Monnier <monnier <at> IRO.UMontreal.CA> writes:

>>>> Normal hook run before each command is executed.
>>> 
>>> I could perhaps change this to say:
>>> 
>>> Normal hook run before any command is executed interactively.
>
>> This probably isn't an improvement though, because it might suggest that
>> call-interactively runs these hooks, when it doesn't.
>
> Agreed.  If we want to be more careful we'd have to say something like
> "Hook run before the command loop executes a command".

I've clarified the Lisp manual along these lines.




bug closed, send any further explanations to 10384 <at> debbugs.gnu.org and oitofelix <at> gmail.com (Bruno Félix Rezende Ribeiro) Request was from Chong Yidong <cyd <at> gnu.org> to control <at> debbugs.gnu.org. (Fri, 27 Jan 2012 08:37:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 24 Feb 2012 12:24:06 GMT) Full text and rfc822 format available.

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

Previous Next


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