changeset 1511:ff88f962a982

* doc.c: #include keyboard.h. * doc.c (Fsubstitute_command_keys): Ask get_keymap_1 to perform autoloads. Autoloading might GC; we need to GCPRO our local variables now. (Fdocumentation, Fdocumentation_property): Autoloading in Fsubstitute_command_keys might GC; we need to GCPRO our local variables now.
author Jim Blandy <jimb@redhat.com>
date Sat, 31 Oct 1992 05:18:48 +0000
parents 2fd5263590ea
children bef6b6903528
files src/doc.c
diffstat 1 files changed, 17 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/src/doc.c	Sat Oct 31 05:18:16 1992 +0000
+++ b/src/doc.c	Sat Oct 31 05:18:48 1992 +0000
@@ -33,6 +33,7 @@
 
 #include "lisp.h"
 #include "buffer.h"
+#include "keyboard.h"
 
 Lisp_Object Vdoc_file_name;
 
@@ -172,7 +173,13 @@
     }
 
   if (NILP (raw))
-    doc = Fsubstitute_command_keys (doc);
+    {
+      struct gcpro gcpro1;
+
+      GCPRO1 (doc);
+      doc = Fsubstitute_command_keys (doc);
+      UNGCPRO;
+    }
   return doc;
 }
 
@@ -353,17 +360,21 @@
   int idx;
   int bsize;
   unsigned char *new;
-  register Lisp_Object tem;
+  Lisp_Object tem;
   Lisp_Object keymap;
   unsigned char *start;
   int length;
-  struct gcpro gcpro1;
+  Lisp_Object name;
+  struct gcpro gcpro1, gcpro2, gcpro3, gcpro4;
 
   if (NILP (str))
     return Qnil;
 
   CHECK_STRING (str, 0);
-  GCPRO1 (str);
+  tem = Qnil;
+  keymap = Qnil;
+  name = Qnil;
+  GCPRO4 (str, tem, keymap, name);
 
   keymap = current_buffer->keymap;
 
@@ -419,7 +430,6 @@
       else if (strp[0] == '\\' && (strp[1] == '{' || strp[1] == '<'))
 	{
 	  struct buffer *oldbuf;
-	  Lisp_Object name;
 
 	  changed = 1;
 	  strp += 2;		/* skip \{ or \< */
@@ -444,7 +454,7 @@
 	    {
 	      tem = Fsymbol_value (name);
 	      if (! NILP (tem))
-		tem = get_keymap_1 (tem, 0);
+		tem = get_keymap_1 (tem, 0, 1);
 	    }
 
 	  /* Now switch to a temp buffer.  */
@@ -487,9 +497,8 @@
     tem = make_string (buf, bufp - buf);
   else
     tem = str;
-  UNGCPRO;
   free (buf);
-  return tem;
+  RETURN_UNGCPRO (tem);
 }
 
 syms_of_doc ()