summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChong Yidong <cyd@gnu.org>2012-04-23 11:11:28 +0800
committerChong Yidong <cyd@gnu.org>2012-04-23 11:11:28 +0800
commit9ec7751f83254ee3bc13030b7933d1b454c33cd5 (patch)
tree59c317ef2fadc671bf2c9aa87232f148a46f7f5c
parentd55486c7f89d12ab799c7bf631b86fb0ccf52e52 (diff)
downloademacs-9ec7751f83254ee3bc13030b7933d1b454c33cd5.tar.gz
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).
-rw-r--r--doc/lispref/ChangeLog5
-rw-r--r--doc/lispref/keymaps.texi19
-rw-r--r--src/ChangeLog4
-rw-r--r--src/keymap.c16
4 files changed, 34 insertions, 10 deletions
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 <cyd@gnu.org>
+
+ * keymaps.texi (Scanning Keymaps): Fix description of NO-REMAP arg
+ to where-is-internal (Bug#10872).
+
2012-04-21 Glenn Morris <rgm@gnu.org>
* 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 <cyd@gnu.org>
+
+ * keymap.c (where_is_internal): Doc fix (Bug#10872).
+
2012-04-20 Glenn Morris <rgm@gnu.org>
* 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. */