changeset 46293:1fb8f75062c6

Use macro SPECPDL_INDEX.
author Juanma Barranquero <lekktu@gmail.com>
date Thu, 11 Jul 2002 14:18:02 +0000
parents 712d0161e499
children 5bb364f84e70
files src/alloc.c src/buffer.c src/bytecode.c src/callint.c src/callproc.c src/coding.c src/composite.c src/dired.c src/dispnew.c src/editfns.c src/emacs.c src/eval.c src/fileio.c src/fns.c src/insdel.c src/keyboard.c src/keymap.c src/lread.c src/macfns.c src/macmenu.c src/minibuf.c src/print.c src/process.c src/sound.c src/textprop.c src/w32fns.c src/w32menu.c src/window.c src/xfaces.c src/xmenu.c src/xselect.c src/xterm.c
diffstat 32 files changed, 98 insertions(+), 98 deletions(-) [+]
line wrap: on
line diff
--- a/src/alloc.c	Wed Jul 10 11:08:01 2002 +0000
+++ b/src/alloc.c	Thu Jul 11 14:18:02 2002 +0000
@@ -4020,7 +4020,7 @@
 int
 inhibit_garbage_collection ()
 {
-  int count = specpdl_ptr - specpdl;
+  int count = SPECPDL_INDEX ();
   int nbits = min (VALBITS, BITS_PER_INT);
 
   specbind (Qgc_cons_threshold, make_number (((EMACS_INT) 1 << (nbits - 1)) - 1));
--- a/src/buffer.c	Wed Jul 10 11:08:01 2002 +0000
+++ b/src/buffer.c	Thu Jul 11 14:18:02 2002 +0000
@@ -1297,7 +1297,7 @@
 
   /* Run hooks with the buffer to be killed the current buffer.  */
   {
-    int count = specpdl_ptr - specpdl;
+    int count = SPECPDL_INDEX ();
     Lisp_Object list;
 
     record_unwind_protect (save_excursion_restore, save_excursion_save ());
@@ -1548,7 +1548,7 @@
   if (NILP (function) || EQ (function, Qfundamental_mode))
     return Qnil;
 
-  count = specpdl_ptr - specpdl;
+  count = SPECPDL_INDEX ();
 
   /* To select a nonfundamental mode,
      select the buffer temporarily and then call the mode function. */
@@ -3586,7 +3586,7 @@
 {
   struct buffer *b, *ob;
   Lisp_Object obuffer;
-  int count = specpdl_ptr - specpdl;
+  int count = SPECPDL_INDEX ();
 
   CHECK_OVERLAY (overlay);
   if (NILP (buffer))
@@ -3687,7 +3687,7 @@
 {
   Lisp_Object buffer;
   struct buffer *b;
-  int count = specpdl_ptr - specpdl;
+  int count = SPECPDL_INDEX ();
 
   CHECK_OVERLAY (overlay);
 
--- a/src/bytecode.c	Wed Jul 10 11:08:01 2002 +0000
+++ b/src/bytecode.c	Thu Jul 11 14:18:02 2002 +0000
@@ -420,7 +420,7 @@
      (bytestr, vector, maxdepth)
      Lisp_Object bytestr, vector, maxdepth;
 {
-  int count = specpdl_ptr - specpdl;
+  int count = SPECPDL_INDEX ();
 #ifdef BYTE_CODE_METER
   int this_op = 0;
   int prev_op;
@@ -728,7 +728,7 @@
 	  op -= Bunbind;
 	dounbind:
 	  BEFORE_POTENTIAL_GC ();
-	  unbind_to (specpdl_ptr - specpdl - op, Qnil);
+	  unbind_to (SPECPDL_INDEX () - op, Qnil);
 	  AFTER_POTENTIAL_GC ();
 	  break;
 
@@ -909,7 +909,7 @@
 	    temp_output_buffer_show (TOP);
 	    TOP = v1;
 	    /* pop binding of standard-output */
-	    unbind_to (specpdl_ptr - specpdl - 1, Qnil);
+	    unbind_to (SPECPDL_INDEX () - 1, Qnil);
 	    AFTER_POTENTIAL_GC ();
 	    break;
 	  }
@@ -1725,7 +1725,7 @@
   byte_stack_list = byte_stack_list->next;
 
   /* Binds and unbinds are supposed to be compiled balanced.  */
-  if (specpdl_ptr - specpdl != count)
+  if (SPECPDL_INDEX () != count)
 #ifdef BYTE_CODE_SAFE
     error ("binding stack not balanced (serious byte compiler bug)");
 #else
--- a/src/callint.c	Wed Jul 10 11:08:01 2002 +0000
+++ b/src/callint.c	Thu Jul 11 14:18:02 2002 +0000
@@ -198,7 +198,7 @@
   Lisp_Object specs;
   Lisp_Object teml;
   Lisp_Object enable;
-  int speccount = specpdl_ptr - specpdl;
+  int speccount = SPECPDL_INDEX ();
 
   /* The index of the next element of this_command_keys to examine for
      the 'e' interactive code.  */
@@ -541,7 +541,7 @@
 
 	case 'k':		/* Key sequence. */
 	  {
-	    int speccount1 = specpdl_ptr - specpdl;
+	    int speccount1 = SPECPDL_INDEX ();
 	    specbind (Qcursor_in_echo_area, Qt);
 	    args[i] = Fread_key_sequence (build_string (callint_message),
 					  Qnil, Qnil, Qnil, Qnil);
@@ -569,7 +569,7 @@
 
 	case 'K':		/* Key sequence to be defined. */
 	  {
-	    int speccount1 = specpdl_ptr - specpdl;
+	    int speccount1 = SPECPDL_INDEX ();
 	    specbind (Qcursor_in_echo_area, Qt);
 	    args[i] = Fread_key_sequence (build_string (callint_message),
 					  Qnil, Qt, Qnil, Qnil);
--- a/src/callproc.c	Wed Jul 10 11:08:01 2002 +0000
+++ b/src/callproc.c	Thu Jul 11 14:18:02 2002 +0000
@@ -172,7 +172,7 @@
 
   if (EMACS_KILLPG (pid, SIGINT) == 0)
     {
-      int count = specpdl_ptr - specpdl;
+      int count = SPECPDL_INDEX ();
       record_unwind_protect (call_process_kill, fdpid);
       message1 ("Waiting for process to die...(type C-g again to kill it instantly)");
       immediate_quit = 1;
@@ -220,7 +220,7 @@
   char buf[16384];
   char *bufptr = buf;
   int bufsize = 16384;
-  int count = specpdl_ptr - specpdl;
+  int count = SPECPDL_INDEX ();
 
   register unsigned char **new_argv
     = (unsigned char **) alloca ((max (2, nargs - 2)) * sizeof (char *));
@@ -936,7 +936,7 @@
       }
 
     {
-      int post_read_count = specpdl_ptr - specpdl;
+      int post_read_count = SPECPDL_INDEX ();
 
       record_unwind_protect (save_excursion_restore, save_excursion_save ());
       inserted = PT - pt_orig;
@@ -1017,7 +1017,7 @@
   struct gcpro gcpro1;
   Lisp_Object filename_string;
   register Lisp_Object start, end;
-  int count = specpdl_ptr - specpdl;
+  int count = SPECPDL_INDEX ();
   /* Qt denotes we have not yet called Ffind_operation_coding_system.  */
   Lisp_Object coding_systems;
   Lisp_Object val, *args2;
@@ -1091,7 +1091,7 @@
     }
 
   {
-    int count1 = specpdl_ptr - specpdl;
+    int count1 = SPECPDL_INDEX ();
 
     specbind (intern ("coding-system-for-write"), val);
     Fwrite_region (start, end, filename_string, Qnil, Qlambda, Qnil, Qnil);
--- a/src/coding.c	Wed Jul 10 11:08:01 2002 +0000
+++ b/src/coding.c	Thu Jul 11 14:18:02 2002 +0000
@@ -5804,7 +5804,7 @@
      struct coding_system *coding;
      int encodep;
 {
-  int count = specpdl_ptr - specpdl;
+  int count = SPECPDL_INDEX ();
   struct gcpro gcpro1;
   int multibyte = STRING_MULTIBYTE (str);
   Lisp_Object buffer;
--- a/src/composite.c	Wed Jul 10 11:08:01 2002 +0000
+++ b/src/composite.c	Thu Jul 11 14:18:02 2002 +0000
@@ -612,7 +612,7 @@
 
   if (STRINGP (string))
     {
-      count = specpdl_ptr - specpdl;
+      count = SPECPDL_INDEX ();
       GCPRO1 (string);
       stop = end;
       ptr = XSTRING (string)->data + string_char_to_byte (string, start);
--- a/src/dired.c	Wed Jul 10 11:08:01 2002 +0000
+++ b/src/dired.c	Thu Jul 11 14:18:02 2002 +0000
@@ -144,7 +144,7 @@
   Lisp_Object list, dirfilename, encoded_directory;
   struct re_pattern_buffer *bufp = NULL;
   int needsep = 0;
-  int count = specpdl_ptr - specpdl;
+  int count = SPECPDL_INDEX ();
   struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5;
   DIRENTRY *dp;
   int retry_p;
@@ -473,7 +473,7 @@
   struct stat st;
   int directoryp;
   int passcount;
-  int count = specpdl_ptr - specpdl;
+  int count = SPECPDL_INDEX ();
   struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5;
 
   elt = Qnil;
--- a/src/dispnew.c	Wed Jul 10 11:08:01 2002 +0000
+++ b/src/dispnew.c	Thu Jul 11 14:18:02 2002 +0000
@@ -5928,7 +5928,7 @@
      int newheight, newwidth, pretend, delay, safe;
 {
   int new_frame_window_width;
-  int count = specpdl_ptr - specpdl;
+  int count = SPECPDL_INDEX ();
 
   /* If we can't deal with the change now, queue it for later.  */
   if (delay || (redisplaying_p && !safe))
--- a/src/editfns.c	Wed Jul 10 11:08:01 2002 +0000
+++ b/src/editfns.c	Thu Jul 11 14:18:02 2002 +0000
@@ -851,7 +851,7 @@
      Lisp_Object args;
 {
   register Lisp_Object val;
-  int count = specpdl_ptr - specpdl;
+  int count = SPECPDL_INDEX ();
 
   record_unwind_protect (save_excursion_restore, save_excursion_save ());
 
@@ -867,7 +867,7 @@
      Lisp_Object args;
 {
   Lisp_Object val;
-  int count = specpdl_ptr - specpdl;
+  int count = SPECPDL_INDEX ();
 
   record_unwind_protect (set_buffer_if_live, Fcurrent_buffer ());
 
@@ -2482,7 +2482,7 @@
   int changed = 0;
   unsigned char fromstr[MAX_MULTIBYTE_LENGTH], tostr[MAX_MULTIBYTE_LENGTH];
   unsigned char *p;
-  int count = specpdl_ptr - specpdl;
+  int count = SPECPDL_INDEX ();
 #define COMBINING_NO	 0
 #define COMBINING_BEFORE 1
 #define COMBINING_AFTER  2
@@ -2894,7 +2894,7 @@
      Lisp_Object body;
 {
   register Lisp_Object val;
-  int count = specpdl_ptr - specpdl;
+  int count = SPECPDL_INDEX ();
 
   record_unwind_protect (save_restriction_restore, save_restriction_save ());
   val = Fprogn (body);
--- a/src/emacs.c	Wed Jul 10 11:08:01 2002 +0000
+++ b/src/emacs.c	Thu Jul 11 14:18:02 2002 +0000
@@ -425,7 +425,7 @@
 {
   register int i;
   Lisp_Object name, dir, tem;
-  int count = specpdl_ptr - specpdl;
+  int count = SPECPDL_INDEX ();
   Lisp_Object raw_name;
 
   initial_argv = argv;
--- a/src/eval.c	Wed Jul 10 11:08:01 2002 +0000
+++ b/src/eval.c	Thu Jul 11 14:18:02 2002 +0000
@@ -231,7 +231,7 @@
      Lisp_Object arg;
 {
   int debug_while_redisplaying;
-  int count = specpdl_ptr - specpdl;
+  int count = SPECPDL_INDEX ();
   Lisp_Object val;
   
   if (lisp_eval_depth + 20 > max_lisp_eval_depth)
@@ -864,7 +864,7 @@
      Lisp_Object args;
 {
   Lisp_Object varlist, val, elt;
-  int count = specpdl_ptr - specpdl;
+  int count = SPECPDL_INDEX ();
   struct gcpro gcpro1, gcpro2, gcpro3;
 
   GCPRO3 (args, elt, varlist);
@@ -904,7 +904,7 @@
 {
   Lisp_Object *temps, tem;
   register Lisp_Object elt, varlist;
-  int count = specpdl_ptr - specpdl;
+  int count = SPECPDL_INDEX ();
   register int argnum;
   struct gcpro gcpro1, gcpro2;
 
@@ -1095,7 +1095,7 @@
   c.backlist = backtrace_list;
   c.handlerlist = handlerlist;
   c.lisp_eval_depth = lisp_eval_depth;
-  c.pdlcount = specpdl_ptr - specpdl;
+  c.pdlcount = SPECPDL_INDEX ();
   c.poll_suppress_count = poll_suppress_count;
   c.gcpro = gcprolist;
   c.byte_stack = byte_stack_list;
@@ -1196,7 +1196,7 @@
      Lisp_Object args;
 {
   Lisp_Object val;
-  int count = specpdl_ptr - specpdl;
+  int count = SPECPDL_INDEX ();
 
   record_unwind_protect (0, Fcdr (args));
   val = Feval (Fcar (args));
@@ -1262,7 +1262,7 @@
   c.backlist = backtrace_list;
   c.handlerlist = handlerlist;
   c.lisp_eval_depth = lisp_eval_depth;
-  c.pdlcount = specpdl_ptr - specpdl;
+  c.pdlcount = SPECPDL_INDEX ();
   c.poll_suppress_count = poll_suppress_count;
   c.gcpro = gcprolist;
   c.byte_stack = byte_stack_list;
@@ -1327,7 +1327,7 @@
   c.backlist = backtrace_list;
   c.handlerlist = handlerlist;
   c.lisp_eval_depth = lisp_eval_depth;
-  c.pdlcount = specpdl_ptr - specpdl;
+  c.pdlcount = SPECPDL_INDEX ();
   c.poll_suppress_count = poll_suppress_count;
   c.gcpro = gcprolist;
   c.byte_stack = byte_stack_list;
@@ -1367,7 +1367,7 @@
   c.backlist = backtrace_list;
   c.handlerlist = handlerlist;
   c.lisp_eval_depth = lisp_eval_depth;
-  c.pdlcount = specpdl_ptr - specpdl;
+  c.pdlcount = SPECPDL_INDEX ();
   c.poll_suppress_count = poll_suppress_count;
   c.gcpro = gcprolist;
   c.byte_stack = byte_stack_list;
@@ -1410,7 +1410,7 @@
   c.backlist = backtrace_list;
   c.handlerlist = handlerlist;
   c.lisp_eval_depth = lisp_eval_depth;
-  c.pdlcount = specpdl_ptr - specpdl;
+  c.pdlcount = SPECPDL_INDEX ();
   c.poll_suppress_count = poll_suppress_count;
   c.gcpro = gcprolist;
   c.byte_stack = byte_stack_list;
@@ -1646,7 +1646,7 @@
       || !NILP (Vdebug_on_signal)) /* This says call debugger even if
 				      there is a handler.  */
     {
-      int count = specpdl_ptr - specpdl;
+      int count = SPECPDL_INDEX ();
       int debugger_called = 0;
       Lisp_Object sig_symbol, combined_data;
       /* This is set to 1 if we are handling a memory-full error,
@@ -1914,7 +1914,7 @@
 do_autoload (fundef, funname)
      Lisp_Object fundef, funname;
 {
-  int count = specpdl_ptr - specpdl;
+  int count = SPECPDL_INDEX ();
   Lisp_Object fun, queue, first, second;
   struct gcpro gcpro1, gcpro2, gcpro3;
 
@@ -2860,7 +2860,7 @@
      register Lisp_Object *arg_vector;
 {
   Lisp_Object val, syms_left, next;
-  int count = specpdl_ptr - specpdl;
+  int count = SPECPDL_INDEX ();
   int i, optional, rest;
 
   if (CONSP (fun))
@@ -2953,7 +2953,7 @@
 void
 grow_specpdl ()
 {
-  register int count = specpdl_ptr - specpdl;
+  register int count = SPECPDL_INDEX ();
   if (specpdl_size >= max_specpdl_size)
     {
       if (max_specpdl_size < 400)
--- a/src/fileio.c	Wed Jul 10 11:08:01 2002 +0000
+++ b/src/fileio.c	Thu Jul 11 14:18:02 2002 +0000
@@ -2371,7 +2371,7 @@
   struct stat st, out_st;
   Lisp_Object handler;
   struct gcpro gcpro1, gcpro2, gcpro3, gcpro4;
-  int count = specpdl_ptr - specpdl;
+  int count = SPECPDL_INDEX ();
   int input_file_statable_p;
   Lisp_Object encoded_file, encoded_newname;
 
@@ -4395,7 +4395,7 @@
 	     this way, we can run Lisp program safely before decoding
 	     the inserted text.  */
 	  Lisp_Object unwind_data;
-	      int count = specpdl_ptr - specpdl;
+	      int count = SPECPDL_INDEX ();
 
 	  unwind_data = Fcons (current_buffer->enable_multibyte_characters,
 			       Fcons (current_buffer->undo_list,
@@ -4753,7 +4753,7 @@
   unsigned char *fn;
   struct stat st;
   int tem;
-  int count = specpdl_ptr - specpdl;
+  int count = SPECPDL_INDEX ();
   int count1;
 #ifdef VMS
   unsigned char *fname = 0;     /* If non-0, original filename (must rename) */
@@ -4825,7 +4825,7 @@
     }
 
   record_unwind_protect (build_annotations_unwind, Fcurrent_buffer ());
-  count1 = specpdl_ptr - specpdl;
+  count1 = SPECPDL_INDEX ();
 
   given_buffer = current_buffer;
 
@@ -5594,7 +5594,7 @@
   Lisp_Object oquit;
   FILE *stream;
   Lisp_Object lispstream;
-  int count = specpdl_ptr - specpdl;
+  int count = SPECPDL_INDEX ();
   int orig_minibuffer_auto_raise = minibuffer_auto_raise;
   int message_p = 0;
 
@@ -5941,7 +5941,7 @@
 	{
 	  /* Must do it the hard (and slow) way.  */
 	  GCPRO3 (all, comp, specdir);
-	  count = specpdl_ptr - specpdl;
+	  count = SPECPDL_INDEX ();
 	  record_unwind_protect (read_file_name_cleanup, current_buffer->directory);
 	  current_buffer->directory = realdir;
 	  for (comp = Qnil; CONSP (all); all = XCDR (all))
@@ -6074,7 +6074,7 @@
       RETURN_UNGCPRO (Ffuncall (7, args));
     }
 
-  count = specpdl_ptr - specpdl;
+  count = SPECPDL_INDEX ();
 #ifdef VMS
   specbind (intern ("completion-ignore-case"), Qt);
 #endif
--- a/src/fns.c	Wed Jul 10 11:08:01 2002 +0000
+++ b/src/fns.c	Thu Jul 11 14:18:02 2002 +0000
@@ -2935,7 +2935,7 @@
   Lisp_Object xprompt;
   Lisp_Object args[2];
   struct gcpro gcpro1, gcpro2;
-  int count = specpdl_ptr - specpdl;
+  int count = SPECPDL_INDEX ();
 
   specbind (Qcursor_in_echo_area, Qt);
 
@@ -3250,7 +3250,7 @@
   
   if (NILP (tem))
     {
-      int count = specpdl_ptr - specpdl;
+      int count = SPECPDL_INDEX ();
       int nesting = 0;
 
       /* This is to make sure that loadup.el gives a clear picture
--- a/src/insdel.c	Wed Jul 10 11:08:01 2002 +0000
+++ b/src/insdel.c	Thu Jul 11 14:18:02 2002 +0000
@@ -2205,7 +2205,7 @@
        doc: /* This function is for use internally in `combine-after-change-calls'.  */)
      ()
 {
-  int count = specpdl_ptr - specpdl;
+  int count = SPECPDL_INDEX ();
   int beg, end, change;
   int begpos, endpos;
   Lisp_Object tail;
--- a/src/keyboard.c	Wed Jul 10 11:08:01 2002 +0000
+++ b/src/keyboard.c	Thu Jul 11 14:18:02 2002 +0000
@@ -934,7 +934,7 @@
 Lisp_Object
 recursive_edit_1 ()
 {
-  int count = specpdl_ptr - specpdl;
+  int count = SPECPDL_INDEX ();
   Lisp_Object val;
 
   if (command_loop_level > 0)
@@ -1000,7 +1000,7 @@
 This function is called by the editor initialization to begin editing.  */)
      ()
 {
-  int count = specpdl_ptr - specpdl;
+  int count = SPECPDL_INDEX ();
   Lisp_Object buffer;
 
   command_loop_level++;
@@ -1407,7 +1407,7 @@
 	{
 	  /* Bind inhibit-quit to t so that C-g gets read in
 	     rather than quitting back to the minibuffer.  */
-	  int count = specpdl_ptr - specpdl;
+	  int count = SPECPDL_INDEX ();
 	  specbind (Qinhibit_quit, Qt);
 
 	  Fsit_for (Vminibuffer_message_timeout, Qnil, Qnil);
@@ -1838,7 +1838,7 @@
 safe_run_hooks (hook)
      Lisp_Object hook;
 {
-  int count = specpdl_ptr - specpdl;
+  int count = SPECPDL_INDEX ();
   specbind (Qinhibit_quit, hook);
 
   internal_condition_case (safe_run_hooks_1, Qt, safe_run_hooks_error);
@@ -2813,7 +2813,7 @@
       Lisp_Object keys; 
       int key_count;
       struct gcpro gcpro1;
-      int count = specpdl_ptr - specpdl;
+      int count = SPECPDL_INDEX ();
 
       /* Save the echo status.  */
       int saved_immediate_echo = current_kboard->immediate_echo;
@@ -2943,7 +2943,7 @@
   if (!NILP (Vhelp_form) && help_char_p (c))
     {
       Lisp_Object tem0;
-      count = specpdl_ptr - specpdl;
+      count = SPECPDL_INDEX ();
 
       record_unwind_protect (Fset_window_configuration,
 			     Fcurrent_window_configuration (Qnil));
@@ -3223,7 +3223,7 @@
      (args)
      Lisp_Object args;
 {
-  int count = specpdl_ptr - specpdl;
+  int count = SPECPDL_INDEX ();
   Lisp_Object val;
 
   record_unwind_protect (tracking_off, do_mouse_tracking);
@@ -6789,7 +6789,7 @@
 menu_item_eval_property (sexpr)
      Lisp_Object sexpr;
 {
-  int count = specpdl_ptr - specpdl;
+  int count = SPECPDL_INDEX ();
   Lisp_Object val;
   specbind (Qinhibit_redisplay, Qt);
   val = internal_condition_case_1 (Feval, sexpr, Qerror,
@@ -8005,7 +8005,7 @@
      int fix_current_buffer;
 {
   volatile Lisp_Object from_string;
-  volatile int count = specpdl_ptr - specpdl;
+  volatile int count = SPECPDL_INDEX ();
 
   /* How many keys there are in the current key sequence.  */
   volatile int t;
@@ -9187,7 +9187,7 @@
   Lisp_Object keybuf[30];
   register int i;
   struct gcpro gcpro1;
-  int count = specpdl_ptr - specpdl;
+  int count = SPECPDL_INDEX ();
 
   if (!NILP (prompt))
     CHECK_STRING (prompt);
@@ -9246,7 +9246,7 @@
   Lisp_Object keybuf[30];
   register int i;
   struct gcpro gcpro1;
-  int count = specpdl_ptr - specpdl;
+  int count = SPECPDL_INDEX ();
 
   if (!NILP (prompt))
     CHECK_STRING (prompt);
@@ -9797,7 +9797,7 @@
      (stuffstring)
      Lisp_Object stuffstring;
 {
-  int count = specpdl_ptr - specpdl;
+  int count = SPECPDL_INDEX ();
   int old_height, old_width;
   int width, height;
   struct gcpro gcpro1;
--- a/src/keymap.c	Wed Jul 10 11:08:01 2002 +0000
+++ b/src/keymap.c	Thu Jul 11 14:18:02 2002 +0000
@@ -3121,7 +3121,7 @@
      (vector, describer)
      Lisp_Object vector, describer;
 {
-  int count = specpdl_ptr - specpdl;
+  int count = SPECPDL_INDEX ();
   if (NILP (describer))
     describer = intern ("princ");
   specbind (Qstandard_output, Fcurrent_buffer ());
--- a/src/lread.c	Wed Jul 10 11:08:01 2002 +0000
+++ b/src/lread.c	Thu Jul 11 14:18:02 2002 +0000
@@ -660,7 +660,7 @@
   register FILE *stream;
   register int fd = -1;
   register Lisp_Object lispstream;
-  int count = specpdl_ptr - specpdl;
+  int count = SPECPDL_INDEX ();
   Lisp_Object temp;
   struct gcpro gcpro1;
   Lisp_Object found, efound;
@@ -1271,7 +1271,7 @@
 {
   register int c;
   register Lisp_Object val;
-  int count = specpdl_ptr - specpdl;
+  int count = SPECPDL_INDEX ();
   struct gcpro gcpro1;
   struct buffer *b = 0;
   int continue_reading_p;
@@ -1313,7 +1313,7 @@
 
       if (!NILP (Vpurify_flag) && c == '(')
 	{
-	  int count1 = specpdl_ptr - specpdl;
+	  int count1 = SPECPDL_INDEX ();
 	  record_unwind_protect (unreadpure, Qnil);
 	  val = read_list (-1, readcharfun);
 	  unbind_to (count1, Qnil);
@@ -1379,7 +1379,7 @@
      (buffer, printflag, filename, unibyte, do_allow_print)
      Lisp_Object buffer, printflag, filename, unibyte, do_allow_print;
 {
-  int count = specpdl_ptr - specpdl;
+  int count = SPECPDL_INDEX ();
   Lisp_Object tem, buf;
 
   if (NILP (buffer))
@@ -1421,7 +1421,7 @@
      (start, end, printflag, read_function)
      Lisp_Object start, end, printflag, read_function;
 {
-  int count = specpdl_ptr - specpdl;
+  int count = SPECPDL_INDEX ();
   Lisp_Object tem, cbuf;
 
   cbuf = Fcurrent_buffer ();
--- a/src/macfns.c	Wed Jul 10 11:08:01 2002 +0000
+++ b/src/macfns.c	Thu Jul 11 14:18:02 2002 +0000
@@ -9304,7 +9304,7 @@
   Lisp_Object name;
   long window_prompting = 0;
   int width, height;
-  int count = specpdl_ptr - specpdl;
+  int count = SPECPDL_INDEX ();
   struct gcpro gcpro1, gcpro2, gcpro3;
   struct kboard *kb;
 
@@ -9562,7 +9562,7 @@
   unsigned pmask;
   struct gcpro gcpro1, gcpro2, gcpro3, gcpro4;
   int old_windows_or_buffers_changed = windows_or_buffers_changed;
-  int count = specpdl_ptr - specpdl;
+  int count = SPECPDL_INDEX ();
   
   specbind (Qinhibit_redisplay, Qt);
 
@@ -9787,7 +9787,7 @@
 {
   struct frame *f = SELECTED_FRAME ();
   Lisp_Object file = Qnil;
-  int count = specpdl_ptr - specpdl;
+  int count = SPECPDL_INDEX ();
   struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5;
   char filename[MAX_PATH + 1];
   char init_dir[MAX_PATH + 1];
--- a/src/macmenu.c	Wed Jul 10 11:08:01 2002 +0000
+++ b/src/macmenu.c	Thu Jul 11 14:18:02 2002 +0000
@@ -1369,7 +1369,7 @@
 
       struct buffer *prev = current_buffer;
       Lisp_Object buffer;
-      int specpdl_count = specpdl_ptr - specpdl;
+      int specpdl_count = SPECPDL_INDEX ();
       int previous_menu_items_used = f->menu_bar_items_used;
       Lisp_Object *previous_items
 	= (Lisp_Object *) alloca (previous_menu_items_used
--- a/src/minibuf.c	Wed Jul 10 11:08:01 2002 +0000
+++ b/src/minibuf.c	Thu Jul 11 14:18:02 2002 +0000
@@ -409,7 +409,7 @@
      int inherit_input_method;
 {
   Lisp_Object val;
-  int count = specpdl_ptr - specpdl;
+  int count = SPECPDL_INDEX ();
   Lisp_Object mini_frame, ambient_dir, minibuffer, input_method;
   struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5;
   Lisp_Object enable_multibyte;
@@ -732,7 +732,7 @@
     }
   else
     {
-      int count = specpdl_ptr - specpdl;
+      int count = SPECPDL_INDEX ();
 
       reset_buffer (XBUFFER (buf));
       record_unwind_protect (Fset_buffer, Fcurrent_buffer ());
@@ -793,7 +793,7 @@
 
   /* Erase the minibuffer we were using at this level.  */
   {
-    int count = specpdl_ptr - specpdl;
+    int count = SPECPDL_INDEX ();
     /* Prevent error in erase-buffer.  */
     specbind (Qinhibit_read_only, Qt);
     specbind (Qinhibit_modification_hooks, Qt);
@@ -1528,7 +1528,7 @@
   Lisp_Object val, histvar, histpos, position;
   Lisp_Object init;
   int pos = 0;
-  int count = specpdl_ptr - specpdl;
+  int count = SPECPDL_INDEX ();
   struct gcpro gcpro1;
 
   init = initial_input;
--- a/src/print.c	Wed Jul 10 11:08:01 2002 +0000
+++ b/src/print.c	Thu Jul 11 14:18:02 2002 +0000
@@ -192,7 +192,7 @@
    struct buffer *old = current_buffer;					\
    int old_point = -1, start_point = -1;				\
    int old_point_byte = -1, start_point_byte = -1;			\
-   int specpdl_count = specpdl_ptr - specpdl;				\
+   int specpdl_count = SPECPDL_INDEX ();				\
    int free_print_buffer = 0;						\
    int multibyte = !NILP (current_buffer->enable_multibyte_characters);	\
    Lisp_Object original
@@ -580,7 +580,7 @@
 temp_output_buffer_setup (bufname)
     char *bufname;
 {
-  int count = specpdl_ptr - specpdl;
+  int count = SPECPDL_INDEX ();
   register struct buffer *old = current_buffer;
   register Lisp_Object buf;
 
@@ -613,7 +613,7 @@
      Lisp_Object (*function) P_ ((Lisp_Object));
      Lisp_Object args;
 {
-  int count = specpdl_ptr - specpdl;
+  int count = SPECPDL_INDEX ();
   Lisp_Object buf, val;
   struct gcpro gcpro1;
 
@@ -658,7 +658,7 @@
 {
   struct gcpro gcpro1;
   Lisp_Object name;
-  int count = specpdl_ptr - specpdl;
+  int count = SPECPDL_INDEX ();
   Lisp_Object buf, val;
 
   GCPRO1(args);
--- a/src/process.c	Wed Jul 10 11:08:01 2002 +0000
+++ b/src/process.c	Thu Jul 11 14:18:02 2002 +0000
@@ -1292,7 +1292,7 @@
   register unsigned char **new_argv;
 #endif
   register int i;
-  int count = specpdl_ptr - specpdl;
+  int count = SPECPDL_INDEX ();
 
   buffer = args[1];
   if (!NILP (buffer))
@@ -2552,7 +2552,7 @@
   int s = -1, outch, inch;
   struct gcpro gcpro1;
   int retry = 0;
-  int count = specpdl_ptr - specpdl;
+  int count = SPECPDL_INDEX ();
   int count1;
   Lisp_Object QCaddress;  /* one of QClocal or QCremote */
   Lisp_Object tem;
@@ -2843,7 +2843,7 @@
     }
 
   /* Do this in case we never enter the for-loop below.  */
-  count1 = specpdl_ptr - specpdl;
+  count1 = SPECPDL_INDEX ();
   s = -1;
 
   for (lres = res; lres; lres = lres->ai_next)
@@ -4348,7 +4348,7 @@
       /* We inhibit quit here instead of just catching it so that 
 	 hitting ^G when a filter happens to be running won't screw
 	 it up.  */
-      int count = specpdl_ptr - specpdl;
+      int count = SPECPDL_INDEX ();
       Lisp_Object odeactivate;
       Lisp_Object obuffer, okeymap;
       Lisp_Object text;
@@ -5734,7 +5734,7 @@
 {
   Lisp_Object sentinel, obuffer, odeactivate, okeymap;
   register struct Lisp_Process *p = XPROCESS (proc);
-  int count = specpdl_ptr - specpdl;
+  int count = SPECPDL_INDEX ();
   int outer_running_asynch_code = running_asynch_code;
   int waiting = waiting_for_user_input_p;
 
--- a/src/sound.c	Wed Jul 10 11:08:01 2002 +0000
+++ b/src/sound.c	Thu Jul 11 14:18:02 2002 +0000
@@ -402,7 +402,7 @@
   struct sound_device sd;
   struct sound s;
   Lisp_Object args[2];
-  int count = specpdl_ptr - specpdl;
+  int count = SPECPDL_INDEX ();
 
   file = Qnil;
   GCPRO2 (sound, file);
--- a/src/textprop.c	Wed Jul 10 11:08:01 2002 +0000
+++ b/src/textprop.c	Thu Jul 11 14:18:02 2002 +0000
@@ -784,7 +784,7 @@
   else
     {
       Lisp_Object initial_value, value;
-      int count = specpdl_ptr - specpdl;
+      int count = SPECPDL_INDEX ();
 
       if (! NILP (object))
 	CHECK_BUFFER (object);
@@ -849,7 +849,7 @@
     }
   else
     {
-      int count = specpdl_ptr - specpdl;
+      int count = SPECPDL_INDEX ();
 
       if (! NILP (object))
 	CHECK_BUFFER (object);
--- a/src/w32fns.c	Wed Jul 10 11:08:01 2002 +0000
+++ b/src/w32fns.c	Thu Jul 11 14:18:02 2002 +0000
@@ -14301,7 +14301,7 @@
 {
   struct frame *f = SELECTED_FRAME ();
   Lisp_Object file = Qnil;
-  int count = specpdl_ptr - specpdl;
+  int count = SPECPDL_INDEX ();
   struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5;
   char filename[MAX_PATH + 1];
   char init_dir[MAX_PATH + 1];
--- a/src/w32menu.c	Wed Jul 10 11:08:01 2002 +0000
+++ b/src/w32menu.c	Thu Jul 11 14:18:02 2002 +0000
@@ -1347,7 +1347,7 @@
 
       struct buffer *prev = current_buffer;
       Lisp_Object buffer;
-      int specpdl_count = specpdl_ptr - specpdl;
+      int specpdl_count = SPECPDL_INDEX ();
       int previous_menu_items_used = f->menu_bar_items_used;
       Lisp_Object *previous_items
 	= (Lisp_Object *) alloca (previous_menu_items_used
--- a/src/window.c	Wed Jul 10 11:08:01 2002 +0000
+++ b/src/window.c	Thu Jul 11 14:18:02 2002 +0000
@@ -2664,7 +2664,7 @@
 {
   struct window *w = XWINDOW (window);
   struct buffer *b = XBUFFER (buffer);
-  int count = specpdl_ptr - specpdl;
+  int count = SPECPDL_INDEX ();
 
   w->buffer = buffer;
 
@@ -3174,7 +3174,7 @@
 	      tem = Fsymbol_value (Qtemp_buffer_show_hook);
 	      if (!NILP (tem))
 		{
-		  int count = specpdl_ptr - specpdl;
+		  int count = SPECPDL_INDEX ();
 		  Lisp_Object prev_window;
 		  prev_window = selected_window;
 
@@ -5462,7 +5462,7 @@
      Lisp_Object args;
 {
   register Lisp_Object val;
-  register int count = specpdl_ptr - specpdl;
+  register int count = SPECPDL_INDEX ();
 
   record_unwind_protect (Fset_window_configuration,
 			 Fcurrent_window_configuration (Qnil));
--- a/src/xfaces.c	Wed Jul 10 11:08:01 2002 +0000
+++ b/src/xfaces.c	Thu Jul 11 14:18:02 2002 +0000
@@ -2844,7 +2844,7 @@
   struct font_name *fonts;
   Lisp_Object result;
   struct gcpro gcpro1;
-  int count = specpdl_ptr - specpdl;
+  int count = SPECPDL_INDEX ();
   int limit;
 
   /* Let's consider all fonts.  Increase the limit for matching
--- a/src/xmenu.c	Wed Jul 10 11:08:01 2002 +0000
+++ b/src/xmenu.c	Thu Jul 11 14:18:02 2002 +0000
@@ -1654,7 +1654,7 @@
 
       struct buffer *prev = current_buffer;
       Lisp_Object buffer;
-      int specpdl_count = specpdl_ptr - specpdl;
+      int specpdl_count = SPECPDL_INDEX ();
       int previous_menu_items_used = f->menu_bar_items_used;
       Lisp_Object *previous_items
 	= (Lisp_Object *) alloca (previous_menu_items_used
--- a/src/xselect.c	Wed Jul 10 11:08:01 2002 +0000
+++ b/src/xselect.c	Thu Jul 11 14:18:02 2002 +0000
@@ -414,7 +414,7 @@
       /* Don't allow a quit within the converter.
 	 When the user types C-g, he would be surprised
 	 if by luck it came during a converter.  */
-      count = specpdl_ptr - specpdl;
+      count = SPECPDL_INDEX ();
       specbind (Qinhibit_quit, Qt);
 
       CHECK_SYMBOL (target_type);
@@ -1074,7 +1074,7 @@
      struct prop_location *location;
 {
   int secs, usecs;
-  int count = specpdl_ptr - specpdl;
+  int count = SPECPDL_INDEX ();
   Lisp_Object tem;
 
   tem = Fcons (Qnil, Qnil);
--- a/src/xterm.c	Wed Jul 10 11:08:01 2002 +0000
+++ b/src/xterm.c	Thu Jul 11 14:18:02 2002 +0000
@@ -12123,7 +12123,7 @@
 x_catch_errors (dpy)
      Display *dpy;
 {
-  int count = specpdl_ptr - specpdl;
+  int count = SPECPDL_INDEX ();
 
   /* Make sure any errors from previous requests have been dealt with.  */
   XSync (dpy, False);