summaryrefslogtreecommitdiff
path: root/src/print.c
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>2003-05-09 14:03:51 +0000
committerRichard M. Stallman <rms@gnu.org>2003-05-09 14:03:51 +0000
commitca2de34225f857715a8b030261f3102005d7b036 (patch)
tree7ba2c1d21130183ecddf099212ea340724b4cb0c /src/print.c
parent611a8f8c1fd311aa28e94b870e7ec2c2ab059353 (diff)
downloademacs-ca2de34225f857715a8b030261f3102005d7b036.tar.gz
(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'.
Diffstat (limited to 'src/print.c')
-rw-r--r--src/print.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/print.c b/src/print.c
index 38e82488b3c..dc72539f7f5 100644
--- a/src/print.c
+++ b/src/print.c
@@ -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,