summaryrefslogtreecommitdiff
path: root/src/doc.c
diff options
context:
space:
mode:
authorJim Blandy <jimb@redhat.com>1992-10-31 05:18:48 +0000
committerJim Blandy <jimb@redhat.com>1992-10-31 05:18:48 +0000
commit998de6a0376fb04faab3eb4ee929d81405ee41f0 (patch)
treee97c23106c93be6bb4cf262e23b7bde057de8534 /src/doc.c
parent0b01e5f806d8cc27e1a9eb5888d89d4a90b95273 (diff)
downloademacs-998de6a0376fb04faab3eb4ee929d81405ee41f0.tar.gz
* 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.
Diffstat (limited to 'src/doc.c')
-rw-r--r--src/doc.c25
1 files changed, 17 insertions, 8 deletions
diff --git a/src/doc.c b/src/doc.c
index fbe4f834a32..36f04a4a1e2 100644
--- a/src/doc.c
+++ b/src/doc.c
@@ -33,6 +33,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#include "lisp.h"
#include "buffer.h"
+#include "keyboard.h"
Lisp_Object Vdoc_file_name;
@@ -172,7 +173,13 @@ subcommands.)");
}
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 @@ thus, \\=\\=\\=\\= puts \\=\\= into the output, and \\=\\=\\=\\[ puts \\=\\[ int
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 @@ thus, \\=\\=\\=\\= puts \\=\\= into the output, and \\=\\=\\=\\[ puts \\=\\[ int
else if (strp[0] == '\\' && (strp[1] == '{' || strp[1] == '<'))
{
struct buffer *oldbuf;
- Lisp_Object name;
changed = 1;
strp += 2; /* skip \{ or \< */
@@ -444,7 +454,7 @@ thus, \\=\\=\\=\\= puts \\=\\= into the output, and \\=\\=\\=\\[ puts \\=\\[ int
{
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 @@ thus, \\=\\=\\=\\= puts \\=\\= into the output, and \\=\\=\\=\\[ puts \\=\\[ int
tem = make_string (buf, bufp - buf);
else
tem = str;
- UNGCPRO;
free (buf);
- return tem;
+ RETURN_UNGCPRO (tem);
}
syms_of_doc ()