varbind:
/* Specbind can signal and thus GC. */
BEFORE_POTENTIAL_GC ();
+ dynwind_begin ();
specbind (vectorp[op], POP);
AFTER_POTENTIAL_GC ();
NEXT;
op -= Bunbind;
dounbind:
BEFORE_POTENTIAL_GC ();
- unbind_to (SPECPDL_INDEX () - op, Qnil);
+ for (int i = 0; i < op; i++)
+ dynwind_end ();
AFTER_POTENTIAL_GC ();
NEXT;
CASE (Bunbind_all): /* Obsolete. Never used. */
- /* To unbind back to the beginning of this frame. Not used yet,
- but will be needed for tail-recursion elimination. */
- BEFORE_POTENTIAL_GC ();
- unbind_to (count, Qnil);
- AFTER_POTENTIAL_GC ();
+ emacs_abort ();
NEXT;
CASE (Bgoto):
NEXT;
CASE (Bsave_excursion):
+ dynwind_begin ();
record_unwind_protect (save_excursion_restore,
save_excursion_save ());
NEXT;
CASE (Bsave_current_buffer): /* Obsolete since ??. */
CASE (Bsave_current_buffer_1):
+ dynwind_begin ();
record_unwind_current_buffer ();
NEXT;
CASE (Bsave_window_excursion): /* Obsolete since 24.1. */
{
- ptrdiff_t count1 = SPECPDL_INDEX ();
+ dynwind_begin ();
record_unwind_protect (restore_window_configuration,
Fcurrent_window_configuration (Qnil));
BEFORE_POTENTIAL_GC ();
TOP = Fprogn (TOP);
- unbind_to (count1, TOP);
+ dynwind_end ();
AFTER_POTENTIAL_GC ();
NEXT;
}
CASE (Bsave_restriction):
+ dynwind_begin ();
record_unwind_protect (save_restriction_restore,
save_restriction_save ());
NEXT;
CASE (Bunwind_protect): /* FIXME: avoid closure for lexbind. */
{
Lisp_Object handler = POP;
+ dynwind_begin ();
/* Support for a function here is new in 24.4. */
record_unwind_protect (NILP (Ffunctionp (handler))
? unwind_body : bcall0,
CASE (Btemp_output_buffer_setup): /* Obsolete since 24.1. */
BEFORE_POTENTIAL_GC ();
CHECK_STRING (TOP);
+ dynwind_begin ();
temp_output_buffer_setup (SSDATA (TOP));
AFTER_POTENTIAL_GC ();
TOP = Vstandard_output;
temp_output_buffer_show (TOP);
TOP = v1;
/* pop binding of standard-output */
- unbind_to (SPECPDL_INDEX () - 1, Qnil);
+ dynwind_end ();
AFTER_POTENTIAL_GC ();
NEXT;
}
int callproc_fd[CALLPROC_FDS];
int status;
ptrdiff_t i;
- ptrdiff_t count = SPECPDL_INDEX ();
USE_SAFE_ALLOCA;
char **new_argv;
Lisp_Object coding_systems;
bool discard_output;
+ dynwind_begin ();
+
if (synch_process_pid)
error ("call-process invoked recursively");
if (pid < 0)
{
child_errno = errno;
- unbind_to (count, Qnil);
+ dynwind_end ();
synchronize_system_messages_locale ();
return
code_convert_string_norecord (build_string (strerror (child_errno)),
bool volatile display_p_volatile = display_p;
int volatile fd_error_volatile = fd_error;
int *volatile filefd_volatile = filefd;
- ptrdiff_t volatile count_volatile = count;
char **volatile new_argv_volatile = new_argv;
int volatile callproc_fd_volatile[CALLPROC_FDS];
for (i = 0; i < CALLPROC_FDS; i++)
display_p = display_p_volatile;
fd_error = fd_error_volatile;
filefd = filefd_volatile;
- count = count_volatile;
new_argv = new_argv_volatile;
for (i = 0; i < CALLPROC_FDS; i++)
#endif /* not MSDOS */
if (INTEGERP (buffer))
- return unbind_to (count, Qnil);
+ {
+ dynwind_end ();
+ return Qnil;
+ }
if (BUFFERP (buffer))
Fset_buffer (buffer);
else
{ /* We have to decode the input. */
Lisp_Object curbuf;
- ptrdiff_t count1 = SPECPDL_INDEX ();
+ dynwind_begin ();
XSETBUFFER (curbuf, current_buffer);
/* FIXME: Call signal_after_change! */
prepare_to_modify_buffer (PT, PT, NULL);
specbind (Qinhibit_modification_hooks, Qt);
decode_coding_c_string (&process_coding,
(unsigned char *) buf, nread, curbuf);
- unbind_to (count1, Qnil);
+ dynwind_end ();
if (display_on_the_fly
&& CODING_REQUIRE_DETECTION (&saved_coding)
&& ! CODING_REQUIRE_DETECTION (&process_coding))
synch_process_pid = 0;
SAFE_FREE ();
- unbind_to (count, Qnil);
+ dynwind_end ();
if (WIFSIGNALED (status))
{
count = SPECPDL_INDEX ();
record_unwind_protect_ptr (fclose_ptr_unwind, &fp);
- specbind (Qfile_name_handler_alist, Qnil);
- fd = openp (Vcharset_map_path, mapfile, suffixes, NULL, Qnil, false);
- fp = fd < 0 ? 0 : fdopen (fd, "r");
- if (!fp)
- {
- int open_errno = errno;
- emacs_close (fd);
- report_file_errno ("Loading charset map", mapfile, open_errno);
- }
- unbind_to (count + 1, Qnil);
+ {
+ ptrdiff_t count1 = SPECPDL_INDEX ();
+ specbind (Qfile_name_handler_alist, Qnil);
+ fd = openp (Vcharset_map_path, mapfile, suffixes, NULL, Qnil, false);
+ fp = fd < 0 ? 0 : fdopen (fd, "r");
+ if (!fp)
+ {
+ int open_errno = errno;
+ emacs_close (fd);
+ report_file_errno ("Loading charset map", mapfile, open_errno);
+ }
+ unbind_to (count1, Qnil);
+ }
/* Use record, as `charset_map_entries' is large (larger than
MAX_ALLOCA). */
int offset;
EMACS_INT position;
Lisp_Object file, tem, pos;
- ptrdiff_t count;
USE_SAFE_ALLOCA;
if (INTEGERP (filepos))
file, build_string ("\"\n"));
}
}
- count = SPECPDL_INDEX ();
+ dynwind_begin ();
record_unwind_protect_int (close_file_unwind, fd);
/* Seek only to beginning of disk block. */
}
p += nread;
}
- unbind_to (count, Qnil);
+ dynwind_end ();
SAFE_FREE ();
/* Sanity checking. */
report_file_errno ("Opening doc string file", build_string (name),
open_errno);
}
- count = SPECPDL_INDEX ();
+ dynwind_begin ();
record_unwind_protect_int (close_file_unwind, fd);
Vdoc_file_name = filename;
filled = 0;
filled -= end - buf;
memmove (buf, end, filled);
}
- return unbind_to (count, Qnil);
+ dynwind_end ();
+ return Qnil;
}
\f
DEFUN ("substitute-command-keys", Fsubstitute_command_keys,
ptrdiff_t how_much;
off_t beg_offset, end_offset;
int unprocessed;
- ptrdiff_t count = SPECPDL_INDEX ();
struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5;
Lisp_Object handler, val, insval, orig_filename, old_undo;
Lisp_Object p;
&& BEG == Z);
Lisp_Object old_Vdeactivate_mark = Vdeactivate_mark;
bool we_locked_file = 0;
- ptrdiff_t fd_index;
+
+ dynwind_begin ();
if (current_buffer->base_buffer && ! NILP (visit))
error ("Cannot do file visiting in an indirect buffer");
goto notfound;
}
- fd_index = SPECPDL_INDEX ();
record_unwind_protect_ptr (close_file_ptr_unwind, &fd);
/* Replacement should preserve point as it preserves markers. */
Lisp_Object workbuf;
struct buffer *buf;
- ptrdiff_t count1 = SPECPDL_INDEX ();
+ dynwind_begin ();
record_unwind_current_buffer ();
workbuf = Fget_buffer_create (build_string (" *code-converting-work*"));
coding_system = call2 (Vset_auto_coding_function,
filename, make_number (nread));
- unbind_to (count1, Qnil);
+ dynwind_end ();
/* Rewind the file for the actual read done later. */
if (lseek (fd, 0, SEEK_SET) < 0)
unsigned char *decoded;
ptrdiff_t temp;
ptrdiff_t this = 0;
- ptrdiff_t this_count = SPECPDL_INDEX ();
bool multibyte
= ! NILP (BVAR (current_buffer, enable_multibyte_characters));
Lisp_Object conversion_buffer;
struct gcpro gcpro1;
+ dynwind_begin ();
conversion_buffer = code_conversion_save (1, multibyte);
/* First read the whole file, performing code conversion into
}
inserted = 0;
- unbind_to (this_count, Qnil);
+ dynwind_end ();
goto handled;
}
/* Set point before the inserted characters. */
SET_PT_BOTH (temp, same_at_start);
- unbind_to (this_count, Qnil);
+ dynwind_end ();
goto handled;
}
care of marker adjustment. By this way, we can run Lisp
program safely before decoding the inserted text. */
Lisp_Object unwind_data;
- ptrdiff_t count1 = SPECPDL_INDEX ();
+ dynwind_begin ();
unwind_data = Fcons (BVAR (current_buffer, enable_multibyte_characters),
Fcons (BVAR (current_buffer, undo_list),
if (CONSP (coding_system))
coding_system = XCAR (coding_system);
}
- unbind_to (count1, Qnil);
+ dynwind_end ();
inserted = Z_BYTE - BEG_BYTE;
}
if (inserted > 0)
{
/* Don't run point motion or modification hooks when decoding. */
- ptrdiff_t count1 = SPECPDL_INDEX ();
ptrdiff_t old_inserted = inserted;
+ dynwind_begin ();
specbind (Qinhibit_point_motion_hooks, Qt);
specbind (Qinhibit_modification_hooks, Qt);
Otherwise start with an empty undo_list. */
bset_undo_list (current_buffer, EQ (old_undo, Qt) ? Qt : Qnil);
- unbind_to (count1, Qnil);
+ dynwind_end ();
}
if (!NILP (visit)
if (NILP (val))
val = list2 (orig_filename, make_number (inserted));
- RETURN_UNGCPRO (unbind_to (count, val));
+ dynwind_end ();
+ return val;
}
\f
static Lisp_Object build_annotations (Lisp_Object, Lisp_Object);
const char *fn;
struct stat st;
struct timespec modtime;
- ptrdiff_t count = SPECPDL_INDEX ();
- ptrdiff_t count1 IF_LINT (= 0);
Lisp_Object handler;
Lisp_Object visit_file;
Lisp_Object annotations;
return val;
}
+ dynwind_begin ();
record_unwind_protect (save_restriction_restore, save_restriction_save ());
/* Special kludge to simplify auto-saving. */
report_file_errno ("Opening output file", filename, open_errno);
}
- count1 = SPECPDL_INDEX ();
+ dynwind_begin ();
record_unwind_protect_int_1 (close_file_unwind, desc, false);
}
if (emacs_close (desc) < 0)
ok = 0, save_errno = errno;
- unbind_to (count1, Qnil);
+ dynwind_end ();
}
/* Some file systems have a bug where st_mtime is not updated
= XCDR (Vwrite_region_annotation_buffers);
}
- unbind_to (count, Qnil);
+ dynwind_end ();
if (file_locked)
unlock_file (lockname);
{
/* Bind inhibit-quit to t so that C-g gets read in
rather than quitting back to the minibuffer. */
- ptrdiff_t count = SPECPDL_INDEX ();
+ dynwind_begin ();
specbind (Qinhibit_quit, Qt);
sit_for (Vminibuffer_message_timeout, 0, 2);
message1 (0);
safe_run_hooks (Qecho_area_clear_hook);
- unbind_to (count, Qnil);
+ dynwind_end ();
/* If a C-g came in before, treat it as input now. */
if (!NILP (Vquit_flag))
/* Here for a command that isn't executed directly. */
#ifdef HAVE_WINDOW_SYSTEM
- ptrdiff_t scount = SPECPDL_INDEX ();
+ dynwind_begin ();
if (display_hourglass_p
&& NILP (Vexecuting_kbd_macro))
hourglass cursor anyway.
But don't cancel the hourglass within a macro
just because a command in the macro finishes. */
- if (NILP (Vexecuting_kbd_macro))
- unbind_to (scount, Qnil);
+ dynwind_end ();
#endif
}
kset_last_prefix_arg (current_kboard, Vcurrent_prefix_arg);
ptrdiff_t key_count;
bool key_count_reset;
struct gcpro gcpro1;
- ptrdiff_t count = SPECPDL_INDEX ();
/* Save the echo status. */
bool saved_immediate_echo = current_kboard->immediate_echo;
Lisp_Object saved_echo_string = KVAR (current_kboard, echo_string);
ptrdiff_t saved_echo_after_prompt = current_kboard->echo_after_prompt;
+ dynwind_begin ();
+
#if 0
if (before_command_restore_flag)
{
/* Call the input method. */
tem = call1 (Vinput_method_function, c);
- unbind_to (count, tem);
+ dynwind_end ();
/* Restore the saved echoing state
and this_command_keys state. */
/* Process the help character specially if enabled. */
if (!NILP (Vhelp_form) && help_char_p (c))
{
- ptrdiff_t count = SPECPDL_INDEX ();
+ dynwind_begin ();
help_form_saved_window_configs
= Fcons (Fcurrent_window_configuration (Qnil),
}
while (BUFFERP (c));
/* Remove the help from the frame. */
- unbind_to (count, Qnil);
+ dynwind_end ();
redisplay ();
if (EQ (c, make_number (040)))
bool dont_downcase_last, bool can_return_switch_frame,
bool fix_current_buffer, bool prevent_redisplay)
{
- ptrdiff_t count = SPECPDL_INDEX ();
-
/* How many keys there are in the current key sequence. */
int t;
struct gcpro gcpro1;
+ dynwind_begin ();
+
GCPRO1 (fake_prefixed_keys);
raw_keybuf_count = 0;
Just return -1. */
if (EQ (key, Qt))
{
- unbind_to (count, Qnil);
+ dynwind_end ();
UNGCPRO;
return -1;
}
: Qnil;
unread_switch_frame = delayed_switch_frame;
- unbind_to (count, Qnil);
+ dynwind_end ();
/* Don't downcase the last character if the caller says don't.
Don't downcase it if the result is undefined, either. */
{
FILE *stream = NULL;
int fd;
- int fd_index;
ptrdiff_t count = SPECPDL_INDEX ();
struct gcpro gcpro1, gcpro2, gcpro3;
Lisp_Object found, efound, hist_file_name;
#endif
}
- if (fd < 0)
- {
- /* Pacify older GCC with --enable-gcc-warnings. */
- IF_LINT (fd_index = 0);
- }
- else
+ if (fd >= 0)
{
- fd_index = SPECPDL_INDEX ();
record_unwind_protect_ptr (close_file_ptr_unwind, &fd);
record_unwind_protect_ptr (fclose_ptr_unwind, &stream);
}
Lisp_Object x, y, window;
int menuflags = 0;
ptrdiff_t specpdl_count = SPECPDL_INDEX ();
+ ptrdiff_t specpdl_count2;
struct gcpro gcpro1;
if (NILP (position))
}
#endif
+ specpdl_count2 = SPECPDL_INDEX ();
+
#ifdef HAVE_NS /* FIXME: ns-specific, why? --Stef */
record_unwind_protect_void (discard_menu_items);
#endif
selection = FRAME_TERMINAL (f)->menu_show_hook (f, xpos, ypos, menuflags,
title, &error_name);
-#ifdef HAVE_NS
- unbind_to (specpdl_count, Qnil);
-#else
+#ifndef HAVE_NS
discard_menu_items ();
#endif
+ unbind_to (specpdl_count2, Qnil);
+
#ifdef HAVE_NTGUI /* FIXME: Is it really w32-specific? --Stef */
if (FRAME_W32_P (f))
FRAME_DISPLAY_INFO (f)->grabbed = 0;
? list_table : function_table));
ptrdiff_t idx = 0, obsize = 0;
int matchcount = 0;
- ptrdiff_t bindcount = -1;
Lisp_Object bucket, zero, end, tem;
struct gcpro gcpro1, gcpro2, gcpro3, gcpro4;
/* Ignore this element if it fails to match all the regexps. */
{
+ dynwind_begin ();
+ specbind (Qcase_fold_search,
+ completion_ignore_case ? Qt : Qnil);
for (regexps = Vcompletion_regexp_list; CONSP (regexps);
regexps = XCDR (regexps))
{
- if (bindcount < 0) {
- bindcount = SPECPDL_INDEX ();
- specbind (Qcase_fold_search,
- completion_ignore_case ? Qt : Qnil);
- }
tem = Fstring_match (XCAR (regexps), eltstring, zero);
if (NILP (tem))
break;
}
+ dynwind_end ();
if (CONSP (regexps))
continue;
}
tem = Fcommandp (elt, Qnil);
else
{
- if (bindcount >= 0)
- {
- unbind_to (bindcount, Qnil);
- bindcount = -1;
- }
GCPRO4 (tail, string, eltstring, bestmatch);
tem = (type == hash_table
? call2 (predicate, elt,
}
}
- if (bindcount >= 0) {
- unbind_to (bindcount, Qnil);
- bindcount = -1;
- }
-
if (NILP (bestmatch))
return Qnil; /* No completions found. */
/* If we are ignoring case, and there is no exact match,
: VECTORP (collection) ? 2
: NILP (collection) || (CONSP (collection) && !FUNCTIONP (collection));
ptrdiff_t idx = 0, obsize = 0;
- ptrdiff_t bindcount = -1;
Lisp_Object bucket, tem, zero;
struct gcpro gcpro1, gcpro2, gcpro3, gcpro4;
/* Ignore this element if it fails to match all the regexps. */
{
+ dynwind_begin ();
+ specbind (Qcase_fold_search,
+ completion_ignore_case ? Qt : Qnil);
for (regexps = Vcompletion_regexp_list; CONSP (regexps);
regexps = XCDR (regexps))
{
- if (bindcount < 0) {
- bindcount = SPECPDL_INDEX ();
- specbind (Qcase_fold_search,
- completion_ignore_case ? Qt : Qnil);
- }
tem = Fstring_match (XCAR (regexps), eltstring, zero);
if (NILP (tem))
break;
}
+ dynwind_end ();
if (CONSP (regexps))
continue;
}
tem = Fcommandp (elt, Qnil);
else
{
- if (bindcount >= 0) {
- unbind_to (bindcount, Qnil);
- bindcount = -1;
- }
GCPRO4 (tail, eltstring, allmatches, string);
tem = type == 3
? call2 (predicate, elt,
}
}
- if (bindcount >= 0) {
- unbind_to (bindcount, Qnil);
- bindcount = -1;
- }
-
return Fnreverse (allmatches);
}
\f
int minibuffer_only = 0;
long window_prompting = 0;
int width, height;
- ptrdiff_t count = specpdl_ptr - specpdl;
struct gcpro gcpro1, gcpro2, gcpro3, gcpro4;
Lisp_Object display;
struct ns_display_info *dpyinfo = NULL;
FRAME_DISPLAY_INFO (f) = dpyinfo;
+ dynwind_begin ();
+
/* With FRAME_DISPLAY_INFO set up, this unwind-protect is safe. */
record_unwind_protect (unwind_create_frame, frame);
and similar functions. */
Vwindow_list = Qnil;
- return unbind_to (count, frame);
+ dynwind_end ();
+ return frame;
}
void
{
int root_x, root_y;
struct gcpro gcpro1, gcpro2, gcpro3, gcpro4;
- ptrdiff_t count = SPECPDL_INDEX ();
struct frame *f;
char *str;
NSSize size;
+ dynwind_begin ();
specbind (Qinhibit_redisplay, Qt);
GCPRO4 (string, parms, frame, timeout);
unblock_input ();
UNGCPRO;
- return unbind_to (count, Qnil);
+ dynwind_end ();
+ return Qnil;
}
int *submenu_n_panes;
struct buffer *prev = current_buffer;
Lisp_Object buffer;
- ptrdiff_t specpdl_count = SPECPDL_INDEX ();
int previous_menu_items_used = f->menu_bar_items_used;
Lisp_Object *previous_items
= alloca (previous_menu_items_used * sizeof *previous_items);
+ dynwind_begin ();
+
/* lisp preliminaries */
buffer = XWINDOW (FRAME_SELECTED_WINDOW (f))->contents;
specbind (Qinhibit_quit, Qt);
fprintf (stderr, "ERROR: did not find lisp menu for submenu '%s'.\n",
[[submenu title] UTF8String]);
discard_menu_items ();
- unbind_to (specpdl_count, Qnil);
+ dynwind_end ();
[pool release];
unblock_input ();
return;
free_menubar_widget_value_tree (first_wv);
discard_menu_items ();
- unbind_to (specpdl_count, Qnil);
+ dynwind_end ();
[pool release];
unblock_input ();
return;
f->menu_bar_items_used = menu_items_used;
/* Calls restore_menu_items, etc., as they were outside */
- unbind_to (specpdl_count, Qnil);
+ dynwind_end ();
/* Parse stage 2a: now GC cannot happen during the lifetime of the
widget_value, so it's safe to store data from a Lisp_String */
EmacsMenu *pmenu;
NSPoint p;
Lisp_Object tem;
- ptrdiff_t specpdl_count = SPECPDL_INDEX ();
widget_value *wv, *first_wv = 0;
bool keymaps = (menuflags & MENU_KEYMAPS);
block_input ();
+ dynwind_begin ();
+
p.x = x; p.y = y;
/* now parse stage 2 as in ns_update_menubar */
[NSString stringWithUTF8String: SSDATA (title)]];
[pmenu fillWithWidgetValue: first_wv->contents];
free_menubar_widget_value_tree (first_wv);
- unbind_to (specpdl_count, Qnil);
+ dynwind_end ();
popup_activated_flag = 1;
tem = [pmenu runMenuAt: p forFrame: f keymaps: keymaps];
isQuestion: isQ];
{
- ptrdiff_t specpdl_count = SPECPDL_INDEX ();
struct Popdown_data *unwind_data = xmalloc (sizeof (*unwind_data));
unwind_data->pool = pool;
unwind_data->dialog = dialog;
+ dynwind_begin ();
record_unwind_protect_ptr (pop_down_menu, unwind_data);
popup_activated_flag = 1;
tem = [dialog runDialogAt: p];
- unbind_to (specpdl_count, Qnil); /* calls pop_down_menu */
+ dynwind_end ();
}
unblock_input ();
{
Lisp_Object local_value;
Lisp_Object handler_fn, value, check;
- ptrdiff_t count;
local_value = assq_no_quit (selection_name, Vselection_alist);
if (NILP (local_value)) return Qnil;
- count = specpdl_ptr - specpdl;
+ dynwind_begin ();
specbind (Qinhibit_quit, Qt);
CHECK_SYMBOL (target_type);
handler_fn = Fcdr (Fassq (target_type, Vselection_converter_alist));
XCAR (XCDR (local_value)));
else
value = Qnil;
- unbind_to (count, Qnil);
+ dynwind_end ();
check = value;
if (CONSP (value) && SYMBOLP (XCAR (value)))
struct buffer *old = current_buffer; \
ptrdiff_t old_point = -1, start_point = -1; \
ptrdiff_t old_point_byte = -1, start_point_byte = -1; \
- ptrdiff_t specpdl_count = SPECPDL_INDEX (); \
+ dynwind_begin (); \
bool free_print_buffer = 0; \
bool multibyte \
= !NILP (BVAR (current_buffer, enable_multibyte_characters)); \
xfree (print_buffer); \
print_buffer = 0; \
} \
- unbind_to (specpdl_count, Qnil); \
+ dynwind_end (); \
if (MARKERP (original)) \
set_marker_both (original, Qnil, PT, PT_BYTE); \
if (old_point >= 0) \
void
temp_output_buffer_setup (const char *bufname)
{
- ptrdiff_t count = SPECPDL_INDEX ();
register struct buffer *old = current_buffer;
register Lisp_Object buf;
+ dynwind_begin ();
record_unwind_current_buffer ();
Fset_buffer (Fget_buffer_create (build_string (bufname)));
Frun_hooks (1, &Qtemp_buffer_setup_hook);
- unbind_to (count, Qnil);
+ dynwind_end ();
specbind (Qstandard_output, buf);
}
bool prev_abort_on_gc;
/* struct gcpro gcpro1, gcpro2; */
Lisp_Object save_deactivate_mark;
- ptrdiff_t count = SPECPDL_INDEX ();
struct buffer *previous;
+ dynwind_begin ();
specbind (Qinhibit_modification_hooks, Qt);
{
Vdeactivate_mark = save_deactivate_mark;
/* UNGCPRO; */
- return unbind_to (count, object);
+ dynwind_end ();
+ return object;
}
DEFUN ("princ", Fprinc, Sprinc, 1, 2, 0,
int xerrno = 0;
int s = -1, outch, inch;
struct gcpro gcpro1;
- ptrdiff_t count = SPECPDL_INDEX ();
- ptrdiff_t count1;
Lisp_Object colon_address; /* Either QClocal or QCremote. */
Lisp_Object tem;
Lisp_Object name, buffer, host, service, address;
if (nargs == 0)
return Qnil;
+ dynwind_begin ();
+
/* Save arguments for process-contact and clone-process. */
contact = Flist (nargs, args);
GCPRO1 (contact);
open_socket:
/* Do this in case we never enter the for-loop below. */
- count1 = SPECPDL_INDEX ();
+ dynwind_begin ();
s = -1;
for (lres = res; lres; lres = lres->ai_next)
immediate_quit = 0;
- unbind_to (count1, Qnil);
+ dynwind_end ();
+ dynwind_begin ();
emacs_close (s);
s = -1;
the normal blocking calls to open-network-stream handles this error
better. */
if (is_non_blocking_client)
+ {
+ dynwind_end ();
+ dynwind_end ();
return Qnil;
+ }
report_file_errno ((is_server
? "make server process failed"
p->infd = inch;
p->outfd = outch;
- unbind_to (count1, Qnil);
+ dynwind_end ();
/* Unwind bind_polling_period and request_sigio. */
- unbind_to (count, Qnil);
+ dynwind_end ();
if (is_server && socktype != SOCK_DGRAM)
pset_status (p, Qlisten);
if (fd >= 0)
{
ptrdiff_t readsize, nread_incr;
+ dynwind_begin ();
record_unwind_protect_int (close_file_unwind, fd);
nread = cmdline_size = 0;
cmd_str = make_unibyte_string (q, nread);
decoded_cmd = code_convert_string_norecord (cmd_str,
Vlocale_coding_system, 0);
- unbind_to (count, Qnil);
+ dynwind_end ();
attrs = Fcons (Fcons (Qargs, decoded_cmd), attrs);
}