(Fprin1_to_string): Instead of gcpro, set abort_on_gc.

Bind Qinhibit_modification_hooks to t so there will be no GC.
Rename local `tem' to `save_deactivate_mark'.
This commit is contained in:
Richard M. Stallman 2003-05-09 14:03:51 +00:00
parent 611a8f8c1f
commit ca2de34225
2 changed files with 30 additions and 7 deletions

View file

@ -1,3 +1,21 @@
2003-05-09 Richard M. Stallman <rms@gnu.org>
* print.c (Fprin1_to_string): Instead of gcpro, set abort_on_gc.
Bind Qinhibit_modification_hooks to t so there will be no GC.
Rename local `tem' to `save_deactivate_mark'.
* eval.c (specpdl_ptr): Declare volatile.
(unbind_to): Copy the whole binding and decrement specpdl_ptr
before doing the work of unbinding it.
* lisp.h (struct specbinding): Declare elements volatile.
(specpdl_ptr): Declare volatile.
* Makefile.in (alloca.o): Specify -DDO_BLOCK_INPUT in compiling.
* alloca.c: Test DO_BLOCK_INPUT rather than `emacs'
for use of BLOCK_INPUT and inclusion of lisp.h and blockinput.h.
2003-05-08 Dave Love <fx@gnu.org>
* coding.c (Vlast_coding_system_used): Doc fix.

View file

@ -759,14 +759,18 @@ A printed representation of an object is text which describes that object. */)
{
PRINTDECLARE;
Lisp_Object printcharfun;
struct gcpro gcpro1, gcpro2;
Lisp_Object tem;
/* struct gcpro gcpro1, gcpro2; */
Lisp_Object save_deactivate_mark;
int count = specpdl_ptr - specpdl;
specbind (Qinhibit_modification_hooks, Qt);
/* Save and restore this--we are altering a buffer
but we don't want to deactivate the mark just for that.
No need for specbind, since errors deactivate the mark. */
tem = Vdeactivate_mark;
GCPRO2 (object, tem);
save_deactivate_mark = Vdeactivate_mark;
/* GCPRO2 (object, save_deactivate_mark); */
abort_on_gc++;
printcharfun = Vprin1_to_string_buffer;
PRINTPREPARE;
@ -781,10 +785,11 @@ A printed representation of an object is text which describes that object. */)
Ferase_buffer ();
set_buffer_internal (old);
Vdeactivate_mark = tem;
UNGCPRO;
Vdeactivate_mark = save_deactivate_mark;
/* UNGCPRO; */
return object;
abort_on_gc--;
return unbind_to (count, object);
}
DEFUN ("princ", Fprinc, Sprinc, 1, 2, 0,