summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuanma Barranquero <lekktu@gmail.com>2002-07-11 14:18:02 +0000
committerJuanma Barranquero <lekktu@gmail.com>2002-07-11 14:18:02 +0000
commit35da5de83a23c84136042b2defa0c4dc674d0b83 (patch)
tree4a38165bfe0a4adf6dba54e13be08d92d3a2df7e
parentf3d5f10675ec7d01c94639e671352a96f9286cff (diff)
downloademacs-35da5de83a23c84136042b2defa0c4dc674d0b83.tar.gz
Use macro SPECPDL_INDEX.
-rw-r--r--src/alloc.c2
-rw-r--r--src/buffer.c8
-rw-r--r--src/bytecode.c8
-rw-r--r--src/callint.c6
-rw-r--r--src/callproc.c10
-rw-r--r--src/coding.c2
-rw-r--r--src/composite.c2
-rw-r--r--src/dired.c4
-rw-r--r--src/dispnew.c2
-rw-r--r--src/editfns.c8
-rw-r--r--src/emacs.c2
-rw-r--r--src/eval.c26
-rw-r--r--src/fileio.c14
-rw-r--r--src/fns.c4
-rw-r--r--src/insdel.c2
-rw-r--r--src/keyboard.c24
-rw-r--r--src/keymap.c2
-rw-r--r--src/lread.c10
-rw-r--r--src/macfns.c6
-rw-r--r--src/macmenu.c2
-rw-r--r--src/minibuf.c8
-rw-r--r--src/print.c8
-rw-r--r--src/process.c10
-rw-r--r--src/sound.c2
-rw-r--r--src/textprop.c4
-rw-r--r--src/w32fns.c2
-rw-r--r--src/w32menu.c2
-rw-r--r--src/window.c6
-rw-r--r--src/xfaces.c2
-rw-r--r--src/xmenu.c2
-rw-r--r--src/xselect.c4
-rw-r--r--src/xterm.c2
32 files changed, 98 insertions, 98 deletions
diff --git a/src/alloc.c b/src/alloc.c
index e89981c4545..50de0a217c6 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -4020,7 +4020,7 @@ struct backtrace
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));
diff --git a/src/buffer.c b/src/buffer.c
index e371b3133ae..a5bc8532cfb 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -1297,7 +1297,7 @@ with SIGHUP. */)
/* 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 @@ the current buffer's major mode. */)
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 @@ buffer. */)
{
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 @@ DEFUN ("delete-overlay", Fdelete_overlay, Sdelete_overlay, 1, 1, 0,
{
Lisp_Object buffer;
struct buffer *b;
- int count = specpdl_ptr - specpdl;
+ int count = SPECPDL_INDEX ();
CHECK_OVERLAY (overlay);
diff --git a/src/bytecode.c b/src/bytecode.c
index 442729e477a..7f58b4d17ab 100644
--- a/src/bytecode.c
+++ b/src/bytecode.c
@@ -420,7 +420,7 @@ If the third argument is incorrect, Emacs may crash. */)
(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 @@ If the third argument is incorrect, Emacs may crash. */)
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 @@ If the third argument is incorrect, Emacs may crash. */)
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 @@ If the third argument is incorrect, Emacs may crash. */)
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
diff --git a/src/callint.c b/src/callint.c
index 3eca790c6df..4bb5cd57ccf 100644
--- a/src/callint.c
+++ b/src/callint.c
@@ -198,7 +198,7 @@ supply if the command inquires which events were used to invoke it. */)
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 @@ supply if the command inquires which events were used to invoke it. */)
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 @@ supply if the command inquires which events were used to invoke it. */)
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);
diff --git a/src/callproc.c b/src/callproc.c
index f671c044419..c95055c67aa 100644
--- a/src/callproc.c
+++ b/src/callproc.c
@@ -172,7 +172,7 @@ call_process_cleanup (fdpid)
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 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */)
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 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */)
}
{
- 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 @@ usage: (call-process-region START END PROGRAM &optional DELETE BUFFER DISPLAY &r
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 @@ usage: (call-process-region START END PROGRAM &optional DELETE BUFFER DISPLAY &r
}
{
- 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);
diff --git a/src/coding.c b/src/coding.c
index 0c4f20f1253..af23b636764 100644
--- a/src/coding.c
+++ b/src/coding.c
@@ -5804,7 +5804,7 @@ run_pre_post_conversion_on_str (str, coding, encodep)
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;
diff --git a/src/composite.c b/src/composite.c
index 985f628f794..8a8406587e2 100644
--- a/src/composite.c
+++ b/src/composite.c
@@ -612,7 +612,7 @@ compose_chars_in_text (start, end, string)
if (STRINGP (string))
{
- count = specpdl_ptr - specpdl;
+ count = SPECPDL_INDEX ();
GCPRO1 (string);
stop = end;
ptr = XSTRING (string)->data + string_char_to_byte (string, start);
diff --git a/src/dired.c b/src/dired.c
index 4b6b94d8122..0a119afb5eb 100644
--- a/src/dired.c
+++ b/src/dired.c
@@ -144,7 +144,7 @@ directory_files_internal (directory, full, match, nosort, attrs)
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 @@ file_name_completion (file, dirname, all_flag, ver_flag)
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;
diff --git a/src/dispnew.c b/src/dispnew.c
index 35c1b87a886..59cc06b19ea 100644
--- a/src/dispnew.c
+++ b/src/dispnew.c
@@ -5928,7 +5928,7 @@ change_frame_size_1 (f, newheight, newwidth, pretend, delay, safe)
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))
diff --git a/src/editfns.c b/src/editfns.c
index a2e2aaf269e..72da635a9b4 100644
--- a/src/editfns.c
+++ b/src/editfns.c
@@ -851,7 +851,7 @@ usage: (save-excursion &rest BODY) */)
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 @@ usage: (save-current-buffer &rest BODY) */)
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 @@ Both characters must have the same length of multi-byte form. */)
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 @@ usage: (save-restriction &rest BODY) */)
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);
diff --git a/src/emacs.c b/src/emacs.c
index 7065b69e2f7..f52af3e6fa6 100644
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -425,7 +425,7 @@ init_cmdargs (argc, argv, skip_args)
{
register int i;
Lisp_Object name, dir, tem;
- int count = specpdl_ptr - specpdl;
+ int count = SPECPDL_INDEX ();
Lisp_Object raw_name;
initial_argv = argv;
diff --git a/src/eval.c b/src/eval.c
index 569b57f5aea..8dd2d734e10 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -231,7 +231,7 @@ call_debugger (arg)
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 @@ usage: (let* VARLIST BODY...) */)
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 @@ usage: (let VARLIST BODY...) */)
{
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 @@ internal_catch (tag, func, arg)
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 @@ usage: (unwind-protect BODYFORM UNWINDFORMS...) */)
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 @@ usage: (condition-case VAR BODYFORM HANDLERS...) */)
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 @@ internal_condition_case (bfun, handlers, hfun)
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 @@ internal_condition_case_1 (bfun, arg, handlers, hfun)
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 @@ internal_condition_case_2 (bfun, nargs, args, handlers, hfun)
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 @@ find_handler_clause (handlers, conditions, sig, data, debugger_value_ptr)
|| !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 @@ void
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 @@ funcall_lambda (fun, nargs, arg_vector)
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 @@ DEFUN ("fetch-bytecode", Ffetch_bytecode, Sfetch_bytecode,
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)
diff --git a/src/fileio.c b/src/fileio.c
index dd3872ecbf0..68425e5daf0 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -2371,7 +2371,7 @@ A prefix arg makes KEEP-TIME non-nil. */)
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 @@ actually used. */)
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 @@ This does code conversion according to the value of
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 @@ This does code conversion according to the value of
}
record_unwind_protect (build_annotations_unwind, Fcurrent_buffer ());
- count1 = specpdl_ptr - specpdl;
+ count1 = SPECPDL_INDEX ();
given_buffer = current_buffer;
@@ -5594,7 +5594,7 @@ A non-nil CURRENT-ONLY argument means save only current buffer. */)
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 @@ DEFUN ("read-file-name-internal", Fread_file_name_internal, Sread_file_name_inte
{
/* 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 @@ provides a file dialog box. */)
RETURN_UNGCPRO (Ffuncall (7, args));
}
- count = specpdl_ptr - specpdl;
+ count = SPECPDL_INDEX ();
#ifdef VMS
specbind (intern ("completion-ignore-case"), Qt);
#endif
diff --git a/src/fns.c b/src/fns.c
index 83e7353eb98..01d368ba3d3 100644
--- a/src/fns.c
+++ b/src/fns.c
@@ -2935,7 +2935,7 @@ is nil and `use-dialog-box' is non-nil. */)
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 @@ The normal messages at start and end of loading FILENAME are suppressed. */)
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
diff --git a/src/insdel.c b/src/insdel.c
index 5bec29ea926..1028bc40c4a 100644
--- a/src/insdel.c
+++ b/src/insdel.c
@@ -2205,7 +2205,7 @@ DEFUN ("combine-after-change-execute", Fcombine_after_change_execute,
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;
diff --git a/src/keyboard.c b/src/keyboard.c
index 2c75e1cd87b..acd26a957c0 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -934,7 +934,7 @@ add_command_key (key)
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 @@ Alternately, `(throw 'exit t)' makes this function signal an error.
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 @@ command_loop_1 ()
{
/* 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 @@ void
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 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu)
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 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu)
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 @@ usage: (track-mouse BODY ...) */)
(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 @@ Lisp_Object
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 @@ read_key_sequence (keybuf, bufsize, prompt, dont_downcase_last,
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 @@ will read just one key sequence. */)
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 @@ DEFUN ("read-key-sequence-vector", Fread_key_sequence_vector,
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 @@ On such systems, Emacs starts a subshell instead of suspending. */)
(stuffstring)
Lisp_Object stuffstring;
{
- int count = specpdl_ptr - specpdl;
+ int count = SPECPDL_INDEX ();
int old_height, old_width;
int width, height;
struct gcpro gcpro1;
diff --git a/src/keymap.c b/src/keymap.c
index 24252e0b117..d811d1727f4 100644
--- a/src/keymap.c
+++ b/src/keymap.c
@@ -3121,7 +3121,7 @@ This is text showing the elements of vector matched against indices. */)
(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 ());
diff --git a/src/lread.c b/src/lread.c
index e40d5680c86..aaab4fd8f64 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -660,7 +660,7 @@ Return t if file exists. */)
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 @@ readevalloop (readcharfun, stream, sourcename, evalfun, printflag, unibyte, read
{
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 @@ readevalloop (readcharfun, stream, sourcename, evalfun, printflag, unibyte, read
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 @@ This function preserves the position of point. */)
(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 @@ This function does not move point. */)
(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 ();
diff --git a/src/macfns.c b/src/macfns.c
index 4366854ff1e..9a9baed37a5 100644
--- a/src/macfns.c
+++ b/src/macfns.c
@@ -9304,7 +9304,7 @@ x_create_tip_frame (dpyinfo, parms)
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 @@ DY added (default is 10). */)
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 @@ selection dialog's entry field, if MUSTMATCH is non-nil. */)
{
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];
diff --git a/src/macmenu.c b/src/macmenu.c
index 5976dad767d..15190a7813b 100644
--- a/src/macmenu.c
+++ b/src/macmenu.c
@@ -1369,7 +1369,7 @@ set_frame_menubar (f, first_time, deep_p)
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
diff --git a/src/minibuf.c b/src/minibuf.c
index 3886d31bc22..00380392efe 100644
--- a/src/minibuf.c
+++ b/src/minibuf.c
@@ -409,7 +409,7 @@ read_minibuf (map, initial, prompt, backup_n, expflag,
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 @@ get_minibuffer (depth)
}
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 @@ read_minibuf_unwind (data)
/* 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 @@ Completion ignores case if the ambient value of
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;
diff --git a/src/print.c b/src/print.c
index 98a4c745a88..90d55615bc7 100644
--- a/src/print.c
+++ b/src/print.c
@@ -192,7 +192,7 @@ void print_interval ();
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 @@ void
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 @@ internal_with_output_to_temp_buffer (bufname, function, args)
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 @@ usage: (with-output-to-temp-buffer BUFFNAME BODY ...) */)
{
struct gcpro gcpro1;
Lisp_Object name;
- int count = specpdl_ptr - specpdl;
+ int count = SPECPDL_INDEX ();
Lisp_Object buf, val;
GCPRO1(args);
diff --git a/src/process.c b/src/process.c
index c5cbf3b68eb..7c3b1779496 100644
--- a/src/process.c
+++ b/src/process.c
@@ -1292,7 +1292,7 @@ usage: (start-process NAME BUFFER PROGRAM &rest PROGRAM-ARGS) */)
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 @@ usage: (make-network-process &rest ARGS) */)
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 @@ usage: (make-network-process &rest ARGS) */)
}
/* 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 @@ read_process_output (proc, channel)
/* 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 @@ exec_sentinel (proc, reason)
{
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;
diff --git a/src/sound.c b/src/sound.c
index 4504e7e6ee1..90fe5f524c7 100644
--- a/src/sound.c
+++ b/src/sound.c
@@ -402,7 +402,7 @@ Internal use only, use `play-sound' instead. */)
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);
diff --git a/src/textprop.c b/src/textprop.c
index f6b7dab421e..3e742476a12 100644
--- a/src/textprop.c
+++ b/src/textprop.c
@@ -784,7 +784,7 @@ past position LIMIT; return LIMIT if nothing is found before LIMIT. */)
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 @@ back past position LIMIT; return LIMIT if nothing is found before LIMIT. */)
}
else
{
- int count = specpdl_ptr - specpdl;
+ int count = SPECPDL_INDEX ();
if (! NILP (object))
CHECK_BUFFER (object);
diff --git a/src/w32fns.c b/src/w32fns.c
index fc3d67fef07..88d30931d51 100644
--- a/src/w32fns.c
+++ b/src/w32fns.c
@@ -14301,7 +14301,7 @@ specified. Ensure that file exists if MUSTMATCH is non-nil. */)
{
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];
diff --git a/src/w32menu.c b/src/w32menu.c
index 4f07c534425..c27ad031103 100644
--- a/src/w32menu.c
+++ b/src/w32menu.c
@@ -1347,7 +1347,7 @@ set_frame_menubar (f, first_time, deep_p)
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
diff --git a/src/window.c b/src/window.c
index 7bfa8e3290a..0bacf5fd549 100644
--- a/src/window.c
+++ b/src/window.c
@@ -2664,7 +2664,7 @@ set_window_buffer (window, buffer, run_hooks_p)
{
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 @@ temp_output_buffer_show (buf)
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 @@ usage: (save-window-excursion BODY ...) */)
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));
diff --git a/src/xfaces.c b/src/xfaces.c
index 2f6a4497590..085a0929751 100644
--- a/src/xfaces.c
+++ b/src/xfaces.c
@@ -2844,7 +2844,7 @@ are fixed-pitch. */)
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
diff --git a/src/xmenu.c b/src/xmenu.c
index 1c5949ebb5d..35ddfe9258a 100644
--- a/src/xmenu.c
+++ b/src/xmenu.c
@@ -1654,7 +1654,7 @@ set_frame_menubar (f, first_time, deep_p)
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
diff --git a/src/xselect.c b/src/xselect.c
index 2da3eddfc91..1d5fe0b8ea2 100644
--- a/src/xselect.c
+++ b/src/xselect.c
@@ -414,7 +414,7 @@ x_get_local_selection (selection_symbol, target_type)
/* 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 @@ wait_for_property_change (location)
struct prop_location *location;
{
int secs, usecs;
- int count = specpdl_ptr - specpdl;
+ int count = SPECPDL_INDEX ();
Lisp_Object tem;
tem = Fcons (Qnil, Qnil);
diff --git a/src/xterm.c b/src/xterm.c
index 1a3b52473a2..0067643c89f 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -12123,7 +12123,7 @@ int
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);