From: Chong Yidong Date: Mon, 23 Apr 2012 03:11:28 +0000 (+0800) Subject: Doc fixes for where-is-internal. X-Git-Tag: emacs-24.0.96~21 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=9ec7751f83254ee3bc13030b7933d1b454c33cd5;p=emacs.git Doc fixes for where-is-internal. * doc/lispref/keymaps.texi (Scanning Keymaps): Fix description of NO-REMAP arg to where-is-internal. * src/keymap.c (where_is_internal): Doc fix (Bug#10872). --- diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog index fa2b3386d19..1dbc35d46de 100644 --- a/doc/lispref/ChangeLog +++ b/doc/lispref/ChangeLog @@ -1,3 +1,8 @@ +2012-04-23 Chong Yidong + + * keymaps.texi (Scanning Keymaps): Fix description of NO-REMAP arg + to where-is-internal (Bug#10872). + 2012-04-21 Glenn Morris * macros.texi (Indenting Macros): Fix typo. diff --git a/doc/lispref/keymaps.texi b/doc/lispref/keymaps.texi index f1d4690d470..f67174b6a52 100644 --- a/doc/lispref/keymaps.texi +++ b/doc/lispref/keymaps.texi @@ -1904,12 +1904,19 @@ If @var{noindirect} is non-@code{nil}, @code{where-is-internal} doesn't follow indirect keymap bindings. This makes it possible to search for an indirect definition itself. -When command remapping is in effect (@pxref{Remapping Commands}), -@code{where-is-internal} figures out when a command will be run due to -remapping and reports keys accordingly. It also returns @code{nil} if -@var{command} won't really be run because it has been remapped to some -other command. However, if @var{no-remap} is non-@code{nil}. -@code{where-is-internal} ignores remappings. +If another command @var{other-command} is remapped to @var{command} +(@pxref{Remapping Commands}), this function searches for the bindings +of @var{other-command} and treats them as though they are also +bindings for @var{command}. But if the @var{no-remap} argument is +non-@code{nil}, this function instead includes the vector @code{[remap +@var{other-command}]} in the list of possible key sequences, without +searching for the bindings of @var{other-command}. + +On the other hand, if @var{command} is remapped to another command, +this function still returns the original bindings of @var{command}, +even though those keys would actually invoke the other command. To +determine the remapping status of @var{command}, use the function +@code{command-remapping} (@pxref{Remapping Commands}). @smallexample @group diff --git a/src/ChangeLog b/src/ChangeLog index 2d5520c9dbb..faa2a104337 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2012-04-23 Chong Yidong + + * keymap.c (where_is_internal): Doc fix (Bug#10872). + 2012-04-20 Glenn Morris * fileio.c (Fcopy_file, Fset_file_selinux_context): diff --git a/src/keymap.c b/src/keymap.c index ecaeb32896e..3528a61d6ea 100644 --- a/src/keymap.c +++ b/src/keymap.c @@ -2553,7 +2553,8 @@ where_is_internal (Lisp_Object definition, Lisp_Object keymaps, DEFUN ("where-is-internal", Fwhere_is_internal, Swhere_is_internal, 1, 5, 0, doc: /* Return list of keys that invoke DEFINITION. If KEYMAP is a keymap, search only KEYMAP and the global keymap. -If KEYMAP is nil, search all the currently active keymaps. +If KEYMAP is nil, search all the currently active keymaps, except + for `overriding-local-map' (which is ignored). If KEYMAP is a list of keymaps, search only those keymaps. If optional 3rd arg FIRSTONLY is non-nil, return the first key sequence found, @@ -2568,9 +2569,16 @@ If optional 4th arg NOINDIRECT is non-nil, don't follow indirections to other keymaps or slots. This makes it possible to search for an indirect definition itself. -If optional 5th arg NO-REMAP is non-nil, don't search for key sequences -that invoke a command which is remapped to DEFINITION, but include the -remapped command in the returned list. */) +If another command OTHER-COMMAND is remapped to DEFINITION, search for +the bindings of OTHER-COMMAND and include them in the returned list. +But if optional 5th arg NO-REMAP is non-nil, just include the vector +[remap OTHER-COMMAND] in the returned list, without searching for +those other bindings. + +If DEFINITION is remapped to another command, this function still +returns its bindings, even though those key sequences actually invoke +the other command. Use `command-remapping' to find the remapping +status of DEFINITION. */) (Lisp_Object definition, Lisp_Object keymap, Lisp_Object firstonly, Lisp_Object noindirect, Lisp_Object no_remap) { /* The keymaps in which to search. */