aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJim Blandy1992-10-31 05:18:48 +0000
committerJim Blandy1992-10-31 05:18:48 +0000
commit665d3046550812b7147415bf1b1d0e3f9c103e35 (patch)
treee5a6bcd30a2a19838205db0b00bd09688ef8e630 /src
parentbf34ebcf258c5b8a1844fd860d89368a4457a87f (diff)
downloademacs-665d3046550812b7147415bf1b1d0e3f9c103e35.tar.gz
emacs-665d3046550812b7147415bf1b1d0e3f9c103e35.zip
* 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')
-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. */
33 33
34#include "lisp.h" 34#include "lisp.h"
35#include "buffer.h" 35#include "buffer.h"
36#include "keyboard.h"
36 37
37Lisp_Object Vdoc_file_name; 38Lisp_Object Vdoc_file_name;
38 39
@@ -172,7 +173,13 @@ subcommands.)");
172 } 173 }
173 174
174 if (NILP (raw)) 175 if (NILP (raw))
175 doc = Fsubstitute_command_keys (doc); 176 {
177 struct gcpro gcpro1;
178
179 GCPRO1 (doc);
180 doc = Fsubstitute_command_keys (doc);
181 UNGCPRO;
182 }
176 return doc; 183 return doc;
177} 184}
178 185
@@ -353,17 +360,21 @@ thus, \\=\\=\\=\\= puts \\=\\= into the output, and \\=\\=\\=\\[ puts \\=\\[ int
353 int idx; 360 int idx;
354 int bsize; 361 int bsize;
355 unsigned char *new; 362 unsigned char *new;
356 register Lisp_Object tem; 363 Lisp_Object tem;
357 Lisp_Object keymap; 364 Lisp_Object keymap;
358 unsigned char *start; 365 unsigned char *start;
359 int length; 366 int length;
360 struct gcpro gcpro1; 367 Lisp_Object name;
368 struct gcpro gcpro1, gcpro2, gcpro3, gcpro4;
361 369
362 if (NILP (str)) 370 if (NILP (str))
363 return Qnil; 371 return Qnil;
364 372
365 CHECK_STRING (str, 0); 373 CHECK_STRING (str, 0);
366 GCPRO1 (str); 374 tem = Qnil;
375 keymap = Qnil;
376 name = Qnil;
377 GCPRO4 (str, tem, keymap, name);
367 378
368 keymap = current_buffer->keymap; 379 keymap = current_buffer->keymap;
369 380
@@ -419,7 +430,6 @@ thus, \\=\\=\\=\\= puts \\=\\= into the output, and \\=\\=\\=\\[ puts \\=\\[ int
419 else if (strp[0] == '\\' && (strp[1] == '{' || strp[1] == '<')) 430 else if (strp[0] == '\\' && (strp[1] == '{' || strp[1] == '<'))
420 { 431 {
421 struct buffer *oldbuf; 432 struct buffer *oldbuf;
422 Lisp_Object name;
423 433
424 changed = 1; 434 changed = 1;
425 strp += 2; /* skip \{ or \< */ 435 strp += 2; /* skip \{ or \< */
@@ -444,7 +454,7 @@ thus, \\=\\=\\=\\= puts \\=\\= into the output, and \\=\\=\\=\\[ puts \\=\\[ int
444 { 454 {
445 tem = Fsymbol_value (name); 455 tem = Fsymbol_value (name);
446 if (! NILP (tem)) 456 if (! NILP (tem))
447 tem = get_keymap_1 (tem, 0); 457 tem = get_keymap_1 (tem, 0, 1);
448 } 458 }
449 459
450 /* Now switch to a temp buffer. */ 460 /* Now switch to a temp buffer. */
@@ -487,9 +497,8 @@ thus, \\=\\=\\=\\= puts \\=\\= into the output, and \\=\\=\\=\\[ puts \\=\\[ int
487 tem = make_string (buf, bufp - buf); 497 tem = make_string (buf, bufp - buf);
488 else 498 else
489 tem = str; 499 tem = str;
490 UNGCPRO;
491 free (buf); 500 free (buf);
492 return tem; 501 RETURN_UNGCPRO (tem);
493} 502}
494 503
495syms_of_doc () 504syms_of_doc ()