changeset 65391:4a6f5ef57ed1

(Fsubstitute_command_keys): Lookup key binding for commands that are remapped from some other command.
author Kim F. Storm <storm@cua.dk>
date Fri, 09 Sep 2005 11:55:09 +0000
parents fc4a7ffffc3d
children 476c6d40ab50
files src/doc.c
diffstat 1 files changed, 13 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/doc.c	Fri Sep 09 11:54:59 2005 +0000
+++ b/src/doc.c	Fri Sep 09 11:55:09 2005 +0000
@@ -57,6 +57,8 @@
 
 extern Lisp_Object Voverriding_local_map;
 
+extern Lisp_Object Qremap;
+
 /* For VMS versions with limited file name syntax,
    convert the name to something VMS will allow.  */
 static void
@@ -812,6 +814,7 @@
       else if (strp[0] == '\\' && strp[1] == '[')
 	{
 	  int start_idx;
+	  int follow_remap = 1;
 
 	  changed = 1;
 	  strp += 2;		/* skip \[ */
@@ -830,11 +833,21 @@
 	  idx = strp - SDATA (string);
 	  name = Fintern (make_string (start, length_byte), Qnil);
 
+	do_remap:
 	  /* Ignore remappings unless there are no ordinary bindings. */
  	  tem = Fwhere_is_internal (name, keymap, Qt, Qnil, Qt);
  	  if (NILP (tem))
 	    tem = Fwhere_is_internal (name, keymap, Qt, Qnil, Qnil);
 
+	  if (VECTORP (tem) && XVECTOR (tem)->size > 1
+	      && EQ (AREF (tem, 0), Qremap) && SYMBOLP (AREF (tem, 1))
+	      && follow_remap)
+	    {
+	      name = AREF (tem, 1);
+	      follow_remap = 0;
+	      goto do_remap;
+	    }
+
 	  /* Note the Fwhere_is_internal can GC, so we have to take
 	     relocation of string contents into account.  */
 	  strp = SDATA (string) + idx;