This patch was generated using Coccinelle.
/* Run hooks with the buffer to be killed the current buffer. */
{
- ptrdiff_t count = SPECPDL_INDEX ();
+ dynwind_begin ();
Lisp_Object arglist[1];
record_unwind_protect (save_excursion_restore, save_excursion_save ());
don't kill the buffer. */
arglist[0] = Qkill_buffer_query_functions;
tem = Frun_hook_with_args_until_failure (1, arglist);
- if (NILP (tem))
- return unbind_to (count, Qnil);
+ if (NILP (tem)){
+
+ dynwind_end ();
+ return Qnil;
+ }
/* Query if the buffer is still modified. */
if (INTERACTIVE && !NILP (BVAR (b, filename))
tem = do_yes_or_no_p (format2 ("Buffer %s modified; kill anyway? ",
BVAR (b, name), make_number (0)));
UNGCPRO;
- if (NILP (tem))
- return unbind_to (count, Qnil);
+ if (NILP (tem)){
+
+ dynwind_end ();
+ return Qnil;
+ }
}
/* If the hooks have killed the buffer, exit now. */
- if (!BUFFER_LIVE_P (b))
- return unbind_to (count, Qt);
+ if (!BUFFER_LIVE_P (b)){
+
+ dynwind_end ();
+ return Qt;
+ }
/* Then run the hooks. */
Frun_hooks (1, &Qkill_buffer_hook);
- unbind_to (count, Qnil);
+ dynwind_end ();
}
/* If the hooks have killed the buffer, exit now. */
if (NILP (function) || EQ (function, Qfundamental_mode))
return Qnil;
- count = SPECPDL_INDEX ();
+ dynwind_begin ();
/* To select a nonfundamental mode,
select the buffer temporarily and then call the mode function. */
Fset_buffer (buffer);
call0 (function);
- return unbind_to (count, Qnil);
+ dynwind_end ();
+ return Qnil;
}
DEFUN ("current-buffer", Fcurrent_buffer, Scurrent_buffer, 0, 0, 0,
{
struct buffer *b, *ob = 0;
Lisp_Object obuffer;
- ptrdiff_t count = SPECPDL_INDEX ();
+ dynwind_begin ();
ptrdiff_t n_beg, n_end, o_beg IF_LINT (= 0), o_end IF_LINT (= 0);
CHECK_OVERLAY (overlay);
/* Delete the overlay if it is empty after clipping and has the
evaporate property. */
- if (n_beg == n_end && !NILP (Foverlay_get (overlay, Qevaporate)))
- return unbind_to (count, Fdelete_overlay (overlay));
+ if (n_beg == n_end && !NILP (Foverlay_get (overlay, Qevaporate))){
+
+ Lisp_Object tem0 = Fdelete_overlay (overlay);
+ dynwind_end ();
+ return tem0;
+ }
/* Put the overlay into the new buffer's overlay lists, first on the
wrong list. */
/* This puts it in the right list, and in the right order. */
recenter_overlay_lists (b, b->overlay_center);
- return unbind_to (count, overlay);
+ dynwind_end ();
+ return overlay;
}
DEFUN ("delete-overlay", Fdelete_overlay, Sdelete_overlay, 1, 1, 0,
{
Lisp_Object buffer;
struct buffer *b;
- ptrdiff_t count = SPECPDL_INDEX ();
+ dynwind_begin ();
CHECK_OVERLAY (overlay);
buffer = Fmarker_buffer (OVERLAY_START (overlay));
- if (NILP (buffer))
+ if (NILP (buffer)) {
+ dynwind_end ();
return Qnil;
+ }
b = XBUFFER (buffer);
specbind (Qinhibit_quit, Qt);
|| !NILP (Foverlay_get (overlay, Qafter_string))))
b->prevent_redisplay_optimizations_p = 1;
- return unbind_to (count, Qnil);
+ dynwind_end ();
+ return Qnil;
}
DEFUN ("delete-all-overlays", Fdelete_all_overlays, Sdelete_all_overlays, 0, 1, 0,
Lisp_Object teml;
Lisp_Object up_event;
Lisp_Object enable;
- ptrdiff_t speccount = SPECPDL_INDEX ();
+ dynwind_begin ();
/* The index of the next element of this_command_keys to examine for
the 'e' interactive code. */
kset_last_command (current_kboard, save_last_command);
{
- Lisp_Object args[3];
+ Lisp_Object tem0, args[3];
args[0] = Qfuncall_interactively;
args[1] = function;
args[2] = specs;
- return unbind_to (speccount, Fapply (3, args));
+ tem0 = Fapply (3, args);
+ dynwind_end ();
+ return tem0;
}
}
case 'k': /* Key sequence. */
{
- ptrdiff_t speccount1 = SPECPDL_INDEX ();
+ dynwind_begin ();
specbind (Qcursor_in_echo_area, Qt);
/* Prompt in `minibuffer-prompt' face. */
Fput_text_property (make_number (0),
Qface, Qminibuffer_prompt, callint_message);
args[i] = Fread_key_sequence (callint_message,
Qnil, Qnil, Qnil, Qnil);
- unbind_to (speccount1, Qnil);
+ dynwind_end ();
teml = args[i];
visargs[i] = Fkey_description (teml, Qnil);
case 'K': /* Key sequence to be defined. */
{
- ptrdiff_t speccount1 = SPECPDL_INDEX ();
+ dynwind_begin ();
specbind (Qcursor_in_echo_area, Qt);
/* Prompt in `minibuffer-prompt' face. */
Fput_text_property (make_number (0),
Qnil, Qt, Qnil, Qnil);
teml = args[i];
visargs[i] = Fkey_description (teml, Qnil);
- unbind_to (speccount1, Qnil);
+ dynwind_end ();
/* If the key sequence ends with a down-event,
discard the following up-event. */
if (tem) tem++;
else tem = "";
}
- unbind_to (speccount, Qnil);
+ dynwind_end ();
QUIT;
{
Lisp_Object val = Ffuncall (nargs, args);
UNGCPRO;
- return unbind_to (speccount, val);
+ dynwind_end ();
+ return val;
}
}
report_file_error ("Setting current directory",
BVAR (current_buffer, directory));
- RETURN_UNGCPRO (dir);
+ return dir;
}
/* If P is reapable, record it as a deleted process and kill it.
Lisp_Object infile, encoded_infile;
int filefd;
struct gcpro gcpro1;
- ptrdiff_t count = SPECPDL_INDEX ();
+ dynwind_begin ();
if (nargs >= 2 && ! NILP (args[1]))
{
report_file_error ("Opening process input file", infile);
record_unwind_protect_ptr (close_file_ptr_unwind, &filefd);
UNGCPRO;
- return unbind_to (count, call_process (nargs, args, &filefd, NULL));
+ Lisp_Object tem0 = call_process (nargs, args, &filefd, NULL);
+ dynwind_end ();
+ return tem0;
}
/* Like Fcall_process (NARGS, ARGS), except use FILEFD as the input file.
val = complement_process_encoding_system (val);
{
- ptrdiff_t count1 = SPECPDL_INDEX ();
+ dynwind_begin ();
specbind (intern ("coding-system-for-write"), val);
/* POSIX lets mk[s]temp use "."; don't invoke jka-compr if we
specbind (intern ("file-name-handler-alist"), Qnil);
write_region (start, end, filename_string, Qnil, Qlambda, Qnil, Qnil, fd);
- unbind_to (count1, Qnil);
+ dynwind_end ();
}
if (lseek (fd, 0, SEEK_SET) < 0)
{
struct gcpro gcpro1;
Lisp_Object infile, val;
- ptrdiff_t count = SPECPDL_INDEX ();
+ dynwind_begin ();
Lisp_Object start = args[0];
Lisp_Object end = args[1];
bool empty_input;
args[1] = infile;
val = call_process (nargs, args, &fd, &infile);
- RETURN_UNGCPRO (unbind_to (count, val));
+ dynwind_end ();
+ return val;
}
\f
#ifndef WINDOWSNT
suffixes = list2 (build_string (".map"), build_string (".TXT"));
- count = SPECPDL_INDEX ();
+ dynwind_begin ();
record_unwind_protect_ptr (fclose_ptr_unwind, &fp);
{
- ptrdiff_t count1 = SPECPDL_INDEX ();
+ dynwind_begin ();
specbind (Qfile_name_handler_alist, Qnil);
fd = openp (Vcharset_map_path, mapfile, suffixes, NULL, Qnil, false);
fp = fd < 0 ? 0 : fdopen (fd, "r");
emacs_close (fd);
report_file_errno ("Loading charset map", mapfile, open_errno);
}
- unbind_to (count1, Qnil);
+ dynwind_end ();
}
/* Use record, as `charset_map_entries' is large (larger than
fp = NULL;
load_charset_map (charset, head, n_entries, control_flag);
- unbind_to (count, Qnil);
+ dynwind_end ();
}
static void
decode_coding_gap (struct coding_system *coding,
ptrdiff_t chars, ptrdiff_t bytes)
{
- ptrdiff_t count = SPECPDL_INDEX ();
+ dynwind_begin ();
Lisp_Object attrs;
coding->src_object = Fcurrent_buffer ();
coding->produced = bytes;
coding->produced_char = chars;
insert_from_gap (chars, bytes, 1);
+ dynwind_end ();
return;
}
}
coding->produced += Z_BYTE - prev_Z_BYTE;
}
- unbind_to (count, Qnil);
+ dynwind_end ();
}
ptrdiff_t to, ptrdiff_t to_byte,
Lisp_Object dst_object)
{
- ptrdiff_t count = SPECPDL_INDEX ();
+ dynwind_begin ();
unsigned char *destination IF_LINT (= NULL);
ptrdiff_t dst_bytes IF_LINT (= 0);
ptrdiff_t chars = to - from;
}
Vdeactivate_mark = old_deactivate_mark;
- unbind_to (count, coding->dst_object);
+ dynwind_end ();
}
ptrdiff_t to, ptrdiff_t to_byte,
Lisp_Object dst_object)
{
- ptrdiff_t count = SPECPDL_INDEX ();
+ dynwind_begin ();
ptrdiff_t chars = to - from;
ptrdiff_t bytes = to_byte - from_byte;
Lisp_Object attrs;
Fkill_buffer (coding->src_object);
Vdeactivate_mark = old_deactivate_mark;
- unbind_to (count, Qnil);
+ dynwind_end ();
}
(Lisp_Object prompt, Lisp_Object default_coding_system)
{
Lisp_Object val;
- ptrdiff_t count = SPECPDL_INDEX ();
+ dynwind_begin ();
if (SYMBOLP (default_coding_system))
default_coding_system = SYMBOL_NAME (default_coding_system);
val = Fcompleting_read (prompt, Vcoding_system_alist, Qnil,
Qt, Qnil, Qcoding_system_history,
default_coding_system, Qnil);
- unbind_to (count, Qnil);
+ dynwind_end ();
return (SCHARS (val) == 0 ? Qnil : Fintern (val, Qnil));
}
}
if (min_pos < max_pos)
{
- ptrdiff_t count = SPECPDL_INDEX ();
+ dynwind_begin ();
specbind (Qinhibit_read_only, Qt);
specbind (Qinhibit_modification_hooks, Qt);
Fremove_list_of_text_properties (make_number (min_pos),
make_number (max_pos),
list1 (Qauto_composed), Qnil);
- unbind_to (count, Qnil);
+ dynwind_end ();
}
}
ptrdiff_t limit, struct window *win, struct face *face,
Lisp_Object string)
{
- ptrdiff_t count = SPECPDL_INDEX ();
+ dynwind_begin ();
struct frame *f = XFRAME (win->frame);
Lisp_Object pos = make_number (charpos);
ptrdiff_t to;
re = AREF (rule, 0);
if (NILP (re))
len = 1;
- else if (! STRINGP (re))
- return unbind_to (count, Qnil);
+ else if (! STRINGP (re)){
+
+ dynwind_end ();
+ return Qnil;
+ }
else if ((len = fast_looking_at (re, charpos, bytepos, limit, -1, string))
> 0)
{
else
len = string_byte_to_char (string, bytepos + len) - charpos;
}
- if (len <= 0)
- return unbind_to (count, Qnil);
+ if (len <= 0){
+
+ dynwind_end ();
+ return Qnil;
+ }
to = limit = charpos + len;
#ifdef HAVE_WINDOW_SYSTEM
if (FRAME_WINDOW_P (f))
if (! FONT_OBJECT_P (font_object)
|| (! NILP (re)
&& to < limit
- && (fast_looking_at (re, charpos, bytepos, to, -1, string) <= 0)))
- return unbind_to (count, Qnil);
+ && (fast_looking_at (re, charpos, bytepos, to, -1, string) <= 0))){
+
+ dynwind_end ();
+ return Qnil;
+ }
}
else
#endif /* not HAVE_WINDOW_SYSTEM */
lgstring = safe_call (6, Vauto_composition_function, AREF (rule, 2),
pos, make_number (to), font_object, string);
}
- return unbind_to (count, lgstring);
+ dynwind_end ();
+ return lgstring;
}
/* 1 iff the character C is composable. Characters of general
ssize_t converted_len;
Lisp_Object converted;
unsigned flags;
- ptrdiff_t count = SPECPDL_INDEX ();
+ dynwind_begin ();
chdir_to_default_directory ();
SDATA (converted), converted_len))
error ("cygwin_conv_path: %s", strerror (errno));
- return unbind_to (count, converted);
+ dynwind_end ();
+ return converted;
}
static Lisp_Object
ssize_t converted_len;
Lisp_Object converted;
unsigned flags;
- ptrdiff_t count = SPECPDL_INDEX ();
+ dynwind_begin ();
chdir_to_default_directory ();
if (cygwin_conv_path (flags, in, SDATA (converted), converted_len))
error ("cygwin_conv_path: %s", strerror (errno));
- return unbind_to (count, DECODE_FILE (converted));
+ Lisp_Object tem0 = DECODE_FILE (converted);
+ dynwind_end ();
+ return tem0;
}
DEFUN ("cygwin-convert-file-name-to-windows",
dbus_message_iter_next (&subiter);
}
XD_DEBUG_MESSAGE ("%c %s", dtype, XD_OBJECT_TO_STRING (result));
- RETURN_UNGCPRO (Fnreverse (result));
+ return Fnreverse (result);
}
default:
dbus_message_unref (dmessage);
/* Return the result. */
- RETURN_UNGCPRO (result);
+ return result;
}
/* Read one queued incoming message of the D-Bus BUS.
z_stream stream;
int inflate_status;
struct decompress_unwind_data unwind_data;
- ptrdiff_t count = SPECPDL_INDEX ();
+ dynwind_begin ();
validate_region (&start, &end);
#ifdef WINDOWSNT
if (!zlib_initialized)
zlib_initialized = init_zlib_functions ();
- if (!zlib_initialized)
+ if (!zlib_initialized) {
+ dynwind_end ();
return Qnil;
+ }
#endif
/* This is a unibyte buffer, so character positions and bytes are
/* The magic number 32 apparently means "autodetect both the gzip and
zlib formats" according to zlib.h. */
- if (fn_inflateInit2 (&stream, MAX_WBITS + 32) != Z_OK)
+ if (fn_inflateInit2 (&stream, MAX_WBITS + 32) != Z_OK) {
+ dynwind_end ();
return Qnil;
+ }
unwind_data.start = iend;
unwind_data.stream = &stream;
}
while (inflate_status == Z_OK);
- if (inflate_status != Z_STREAM_END)
- return unbind_to (count, Qnil);
+ if (inflate_status != Z_STREAM_END){
+
+ dynwind_end ();
+ return Qnil;
+ }
unwind_data.start = 0;
/* Delete the compressed data. */
del_range (istart, iend);
- return unbind_to (count, Qt);
+ dynwind_end ();
+ return Qt;
}
\f
Lisp_Object list, dirfilename, encoded_directory;
struct re_pattern_buffer *bufp = NULL;
bool needsep = 0;
- ptrdiff_t count = SPECPDL_INDEX ();
+ dynwind_begin ();
struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5;
struct dirent *dp;
UNGCPRO;
}
- unbind_to (count, Qnil);
+ dynwind_end ();
if (NILP (nosort))
list = Fsort (Fnreverse (list),
attrs ? Qfile_attributes_lessp : Qstring_lessp);
- RETURN_UNGCPRO (list);
+ return list;
}
well as "." and "..". Until shown otherwise, assume we can't exclude
anything. */
bool includeall = 1;
- ptrdiff_t count = SPECPDL_INDEX ();
+ dynwind_begin ();
struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5;
elt = Qnil;
UNGCPRO;
/* This closes the directory. */
- unbind_to (count, bestmatch);
+ dynwind_end ();
if (all_flag || NILP (bestmatch))
return bestmatch;
int new_text_width, new_text_height, new_root_width;
int old_root_width = WINDOW_PIXEL_WIDTH (XWINDOW (FRAME_ROOT_WINDOW (f)));
int new_cols, new_lines;
- ptrdiff_t count = SPECPDL_INDEX ();
+ dynwind_begin ();
/* If we can't deal with the change now, queue it for later. */
if (delay || (redisplaying_p && !safe))
f->new_height = new_height;
f->new_pixelwise = pixelwise;
delayed_size_change = 1;
+ dynwind_end ();
return;
}
FRAME_TEXT_TO_PIXEL_HEIGHT (f, new_text_height))
&& (FRAME_PIXEL_WIDTH (f) ==
FRAME_TEXT_TO_PIXEL_WIDTH (f, new_text_width)))
- return;
+ {
+ dynwind_end ();
+ return;
+ }
block_input ();
run_window_configuration_change_hook (f);
- unbind_to (count, Qnil);
+ dynwind_end ();
}
\f
/***********************************************************************
|| !NILP (Vexecuting_kbd_macro))
return Qnil;
- count = SPECPDL_INDEX ();
+ dynwind_begin ();
if (!NILP (force) && !redisplay_dont_pause)
specbind (Qredisplay_dont_pause, Qt);
redisplay_preserve_echo_area (2);
- unbind_to (count, Qnil);
+ dynwind_end ();
return Qt;
}
else
tem = string;
xfree (buf);
- RETURN_UNGCPRO (tem);
+ return tem;
}
\f
void
(Lisp_Object n)
{
ptrdiff_t orig, orig_byte, end;
- ptrdiff_t count = SPECPDL_INDEX ();
+ dynwind_begin ();
specbind (Qinhibit_point_motion_hooks, Qt);
if (NILP (n))
SET_PT_BOTH (orig, orig_byte);
- unbind_to (count, Qnil);
+ dynwind_end ();
/* Return END constrained to the current input field. */
return Fconstrain_to_field (make_number (end), make_number (orig),
(Lisp_Object args)
{
register Lisp_Object val;
- ptrdiff_t count = SPECPDL_INDEX ();
+ dynwind_begin ();
record_unwind_protect (save_excursion_restore, save_excursion_save ());
val = Fprogn (args);
- return unbind_to (count, val);
+ dynwind_end ();
+ return val;
}
DEFUN ("save-current-buffer", Fsave_current_buffer, Ssave_current_buffer, 0, UNEVALLED, 0,
usage: (save-current-buffer &rest BODY) */)
(Lisp_Object args)
{
- ptrdiff_t count = SPECPDL_INDEX ();
+ dynwind_begin ();
record_unwind_current_buffer ();
- return unbind_to (count, Fprogn (args));
+ Lisp_Object tem0 = Fprogn (args);
+ dynwind_end ();
+ return tem0;
}
\f
DEFUN ("buffer-size", Fbuffer_size, Sbuffer_size, 0, 1, 0,
ptrdiff_t changed = 0;
unsigned char fromstr[MAX_MULTIBYTE_LENGTH], tostr[MAX_MULTIBYTE_LENGTH];
unsigned char *p;
- ptrdiff_t count = SPECPDL_INDEX ();
+ dynwind_begin ();
#define COMBINING_NO 0
#define COMBINING_BEFORE 1
#define COMBINING_AFTER 2
update_compositions (changed, last_changed, CHECK_ALL);
}
- unbind_to (count, Qnil);
+ dynwind_end ();
return Qnil;
}
(Lisp_Object body)
{
register Lisp_Object val;
- ptrdiff_t count = SPECPDL_INDEX ();
+ dynwind_begin ();
record_unwind_protect (save_restriction_restore, save_restriction_save ());
val = Fprogn (body);
- return unbind_to (count, val);
+ dynwind_end ();
+ return val;
}
\f
DEFUN ("message", Fmessage, Smessage, 1, MANY, 0,
Fadd_text_properties (make_number (0),
make_number (SCHARS (string)),
properties, string);
- RETURN_UNGCPRO (string);
+ return string;
}
DEFUN ("format", Fformat, Sformat, 1, MANY, 0,
{
register int i;
Lisp_Object name, dir, handler;
- ptrdiff_t count = SPECPDL_INDEX ();
+ dynwind_begin ();
Lisp_Object raw_name;
initial_argv = argv;
= Fcons (build_unibyte_string (argv[i]), Vcommand_line_args);
}
- unbind_to (count, Qnil);
+ dynwind_end ();
}
DEFUN ("invocation-name", Finvocation_name, Sinvocation_name, 0, 0, 0,
{
Lisp_Object tem;
Lisp_Object symbol;
- ptrdiff_t count = SPECPDL_INDEX ();
+ dynwind_begin ();
check_pure_size ();
Vpurify_flag = tem;
- return unbind_to (count, Qnil);
+ dynwind_end ();
+ return Qnil;
}
#endif /* not CANNOT_DUMP */
call_debugger (Lisp_Object arg)
{
bool debug_while_redisplaying;
- ptrdiff_t count = SPECPDL_INDEX ();
+ dynwind_begin ();
Lisp_Object val;
EMACS_INT old_depth = max_lisp_eval_depth;
/* Do not allow max_specpdl_size less than actual depth (Bug#16603). */
if (debug_while_redisplaying)
Ftop_level ();
- return unbind_to (count, val);
+ dynwind_end ();
+ return val;
}
static void
(Lisp_Object args)
{
Lisp_Object varlist, var, val, elt, lexenv;
- ptrdiff_t count = SPECPDL_INDEX ();
+ dynwind_begin ();
struct gcpro gcpro1, gcpro2, gcpro3;
GCPRO3 (args, elt, varlist);
}
UNGCPRO;
val = Fprogn (XCDR (args));
- return unbind_to (count, val);
+ dynwind_end ();
+ return val;
}
DEFUN ("let", Flet, Slet, 1, UNEVALLED, 0,
{
Lisp_Object *temps, tem, lexenv;
register Lisp_Object elt, varlist;
- ptrdiff_t count = SPECPDL_INDEX ();
+ dynwind_begin ();
ptrdiff_t argnum;
struct gcpro gcpro1, gcpro2;
USE_SAFE_ALLOCA;
elt = Fprogn (XCDR (args));
SAFE_FREE ();
- return unbind_to (count, elt);
+ dynwind_end ();
+ return elt;
}
DEFUN ("while", Fwhile, Swhile, 1, UNEVALLED, 0,
(Lisp_Object args)
{
Lisp_Object val;
- ptrdiff_t count = SPECPDL_INDEX ();
+ dynwind_begin ();
record_unwind_protect (unwind_body, XCDR (args));
val = eval_sub (XCAR (args));
- return unbind_to (count, val);
+ dynwind_end ();
+ return val;
}
\f
DEFUN ("condition-case", Fcondition_case, Scondition_case, 2, UNEVALLED, 0,
it is defines a macro. */)
(Lisp_Object fundef, Lisp_Object funname, Lisp_Object macro_only)
{
- ptrdiff_t count = SPECPDL_INDEX ();
+ dynwind_begin ();
struct gcpro gcpro1, gcpro2, gcpro3;
- if (!CONSP (fundef) || !EQ (Qautoload, XCAR (fundef)))
+ if (!CONSP (fundef) || !EQ (Qautoload, XCAR (fundef))) {
+ dynwind_end ();
return fundef;
+ }
if (EQ (macro_only, Qmacro))
{
Lisp_Object kind = Fnth (make_number (4), fundef);
- if (! (EQ (kind, Qt) || EQ (kind, Qmacro)))
- return fundef;
+ if (! (EQ (kind, Qt) || EQ (kind, Qmacro))) {
+ dynwind_end ();
+ return fundef;
+ }
}
/* This is to make sure that loadup.el gives a clear picture
/* Once loading finishes, don't undo it. */
Vautoload_queue = Qt;
- unbind_to (count, Qnil);
+ dynwind_end ();
UNGCPRO;
alist mapping symbols to their value. */)
(Lisp_Object form, Lisp_Object lexical)
{
- ptrdiff_t count = SPECPDL_INDEX ();
+ dynwind_begin ();
specbind (Qinternal_interpreter_environment,
CONSP (lexical) || NILP (lexical) ? lexical : list1 (Qt));
- return unbind_to (count, eval_sub (form));
+ Lisp_Object tem0 = eval_sub (form);
+ dynwind_end ();
+ return tem0;
}
/* Grow the specpdl stack by one entry.
}
if (EQ (funcar, Qmacro))
{
- ptrdiff_t count = SPECPDL_INDEX ();
+ dynwind_begin ();
Lisp_Object exp;
/* Bind lexical-binding during expansion of the macro, so the
macro can know reliably if the code it outputs will be
specbind (Qlexical_binding,
NILP (Vinternal_interpreter_environment) ? Qnil : Qt);
exp = apply1 (Fcdr (fun), original_args);
- unbind_to (count, Qnil);
+ dynwind_end ();
val = eval_sub (exp);
}
else if (EQ (funcar, Qlambda)
GCPRO1 (fn);
if (NILP (arg))
- RETURN_UNGCPRO (Ffuncall (1, &fn));
+ return Ffuncall (1, &fn);
gcpro1.nvars = 2;
{
Lisp_Object args[2];
args[0] = fn;
args[1] = arg;
gcpro1.var = args;
- RETURN_UNGCPRO (Fapply (2, args));
+ return Fapply (2, args);
}
}
struct gcpro gcpro1;
GCPRO1 (fn);
- RETURN_UNGCPRO (Ffuncall (1, &fn));
+ return Ffuncall (1, &fn);
}
/* Call function fn with 1 argument arg1. */
args[1] = arg1;
GCPRO1 (args[0]);
gcpro1.nvars = 2;
- RETURN_UNGCPRO (Ffuncall (2, args));
+ return Ffuncall (2, args);
}
/* Call function fn with 2 arguments arg1, arg2. */
args[2] = arg2;
GCPRO1 (args[0]);
gcpro1.nvars = 3;
- RETURN_UNGCPRO (Ffuncall (3, args));
+ return Ffuncall (3, args);
}
/* Call function fn with 3 arguments arg1, arg2, arg3. */
args[3] = arg3;
GCPRO1 (args[0]);
gcpro1.nvars = 4;
- RETURN_UNGCPRO (Ffuncall (4, args));
+ return Ffuncall (4, args);
}
/* Call function fn with 4 arguments arg1, arg2, arg3, arg4. */
args[4] = arg4;
GCPRO1 (args[0]);
gcpro1.nvars = 5;
- RETURN_UNGCPRO (Ffuncall (5, args));
+ return Ffuncall (5, args);
}
/* Call function fn with 5 arguments arg1, arg2, arg3, arg4, arg5. */
args[5] = arg5;
GCPRO1 (args[0]);
gcpro1.nvars = 6;
- RETURN_UNGCPRO (Ffuncall (6, args));
+ return Ffuncall (6, args);
}
/* Call function fn with 6 arguments arg1, arg2, arg3, arg4, arg5, arg6. */
args[6] = arg6;
GCPRO1 (args[0]);
gcpro1.nvars = 7;
- RETURN_UNGCPRO (Ffuncall (7, args));
+ return Ffuncall (7, args);
}
/* Call function fn with 7 arguments arg1, arg2, arg3, arg4, arg5, arg6, arg7. */
args[7] = arg7;
GCPRO1 (args[0]);
gcpro1.nvars = 8;
- RETURN_UNGCPRO (Ffuncall (8, args));
+ return Ffuncall (8, args);
}
/* The caller should GCPRO all the elements of ARGS. */
register Lisp_Object *arg_vector)
{
Lisp_Object val, syms_left, next, lexenv;
- ptrdiff_t count = SPECPDL_INDEX ();
+ dynwind_begin ();
ptrdiff_t i;
bool optional, rest;
and constants vector yet, fetch them from the file. */
if (CONSP (AREF (fun, COMPILED_BYTECODE)))
Ffetch_bytecode (fun);
+ dynwind_end ();
return exec_byte_code (AREF (fun, COMPILED_BYTECODE),
AREF (fun, COMPILED_CONSTANTS),
AREF (fun, COMPILED_STACK_DEPTH),
Qnil, 0, 0);
}
- return unbind_to (count, val);
+ dynwind_end ();
+ return val;
}
DEFUN ("fetch-bytecode", Ffetch_bytecode, Sfetch_bytecode,
(Lisp_Object exp, Lisp_Object nframes, Lisp_Object base)
{
union specbinding *pdl = get_backtrace_frame (nframes, base);
- ptrdiff_t count = SPECPDL_INDEX ();
+ dynwind_begin ();
ptrdiff_t distance = specpdl_ptr - pdl;
eassert (distance >= 0);
/* Use eval_sub rather than Feval since the main motivation behind
backtrace-eval is to be able to get/set the value of lexical variables
from the debugger. */
- return unbind_to (count, eval_sub (exp));
+ Lisp_Object tem1 = eval_sub (exp);
+ dynwind_end ();
+ return tem1;
}
DEFUN ("backtrace--locals", Fbacktrace__locals, Sbacktrace__locals, 1, 2, NULL,
{
Lisp_Object handler;
struct gcpro gcpro1, gcpro2, gcpro3, gcpro4;
- ptrdiff_t count = SPECPDL_INDEX ();
+ dynwind_begin ();
Lisp_Object encoded_file, encoded_newname;
#if HAVE_LIBSELINUX
security_context_t con;
/* Likewise for output file name. */
if (NILP (handler))
handler = Ffind_file_name_handler (newname, Qcopy_file);
- if (!NILP (handler))
- RETURN_UNGCPRO (call7 (handler, Qcopy_file, file, newname,
- ok_if_already_exists, keep_time, preserve_uid_gid,
- preserve_permissions));
+ if (!NILP (handler)) {
+ dynwind_end ();
+ return call7 (handler, Qcopy_file, file, newname, ok_if_already_exists, keep_time, preserve_uid_gid, preserve_permissions);
+ }
encoded_file = ENCODE_FILE (file);
encoded_newname = ENCODE_FILE (newname);
#endif /* MSDOS */
#endif /* not WINDOWSNT */
- unbind_to (count, Qnil);
+ dynwind_end ();
UNGCPRO;
return Qnil;
if (NILP (handler))
handler = Ffind_file_name_handler (newname, Qrename_file);
if (!NILP (handler))
- RETURN_UNGCPRO (call4 (handler, Qrename_file,
- file, newname, ok_if_already_exists));
+ return call4 (handler, Qrename_file, file, newname, ok_if_already_exists);
encoded_file = ENCODE_FILE (file);
encoded_newname = ENCODE_FILE (newname);
NILP (ok_if_already_exists) ? Qnil : Qt,
Qt, Qt, Qt);
- count = SPECPDL_INDEX ();
+ dynwind_begin ();
specbind (Qdelete_by_moving_to_trash, Qnil);
if (!NILP (Ffile_directory_p (file)) && NILP (symlink_target))
call2 (Qdelete_directory, file, Qt);
else
Fdelete_file (file, Qnil);
- unbind_to (count, Qnil);
+ dynwind_end ();
}
else
report_file_errno ("Renaming", list2 (file, newname), rename_errno);
call the corresponding file handler. */
handler = Ffind_file_name_handler (file, Qadd_name_to_file);
if (!NILP (handler))
- RETURN_UNGCPRO (call4 (handler, Qadd_name_to_file, file,
- newname, ok_if_already_exists));
+ return call4 (handler, Qadd_name_to_file, file, newname, ok_if_already_exists);
/* If the new name has special constructs in it,
call the corresponding file handler. */
handler = Ffind_file_name_handler (newname, Qadd_name_to_file);
if (!NILP (handler))
- RETURN_UNGCPRO (call4 (handler, Qadd_name_to_file, file,
- newname, ok_if_already_exists));
+ return call4 (handler, Qadd_name_to_file, file, newname, ok_if_already_exists);
encoded_file = ENCODE_FILE (file);
encoded_newname = ENCODE_FILE (newname);
call the corresponding file handler. */
handler = Ffind_file_name_handler (filename, Qmake_symbolic_link);
if (!NILP (handler))
- RETURN_UNGCPRO (call4 (handler, Qmake_symbolic_link, filename,
- linkname, ok_if_already_exists));
+ return call4 (handler, Qmake_symbolic_link, filename, linkname, ok_if_already_exists);
/* If the new link name has special constructs in it,
call the corresponding file handler. */
handler = Ffind_file_name_handler (linkname, Qmake_symbolic_link);
if (!NILP (handler))
- RETURN_UNGCPRO (call4 (handler, Qmake_symbolic_link, filename,
- linkname, ok_if_already_exists));
+ return call4 (handler, Qmake_symbolic_link, filename, linkname, ok_if_already_exists);
encoded_filename = ENCODE_FILE (filename);
encoded_linkname = ENCODE_FILE (linkname);
int do_handled_files;
Lisp_Object oquit;
FILE *stream = NULL;
- ptrdiff_t count = SPECPDL_INDEX ();
+ dynwind_begin ();
bool orig_minibuffer_auto_raise = minibuffer_auto_raise;
bool old_message_p = 0;
struct auto_save_unwind auto_save_unwind;
Vquit_flag = oquit;
/* This restores the message-stack status. */
- unbind_to (count, Qnil);
+ dynwind_end ();
return Qnil;
}
if (NILP (tem))
{
- ptrdiff_t count = SPECPDL_INDEX ();
+ dynwind_begin ();
int nesting = 0;
/* This is to make sure that loadup.el gives a clear picture
UNGCPRO;
/* If load failed entirely, return nil. */
- if (NILP (tem))
- return unbind_to (count, Qnil);
+ if (NILP (tem)){
+
+ dynwind_end ();
+ return Qnil;
+ }
tem = Fmemq (feature, Vfeatures);
if (NILP (tem))
/* Once loading finishes, don't undo it. */
Vautoload_queue = Qt;
- unbind_to (count, feature);
+ dynwind_end ();
}
return feature;
}
else
{
- ptrdiff_t count = SPECPDL_INDEX ();
+ dynwind_begin ();
record_unwind_current_buffer ();
}
object = make_buffer_string (b, e, 0);
- unbind_to (count, Qnil);
+ dynwind_end ();
if (STRING_MULTIBYTE (object))
object = code_convert_string (object, coding_system, Qnil, 1, 0, 0);
GCPRO1 (retval);
if (!NILP (Vmouse_position_function))
retval = call1 (Vmouse_position_function, retval);
- RETURN_UNGCPRO (retval);
+ return retval;
}
DEFUN ("mouse-pixel-position", Fmouse_pixel_position,
static int
xg_dialog_run (struct frame *f, GtkWidget *w)
{
- ptrdiff_t count = SPECPDL_INDEX ();
+ dynwind_begin ();
struct xg_dialog_data dd;
xg_set_screen (w, f);
g_main_loop_run (dd.loop);
dd.w = 0;
- unbind_to (count, Qnil);
+ dynwind_end ();
return dd.response;
}
if (fp)
{
- ptrdiff_t count = SPECPDL_INDEX ();
+ dynwind_begin ();
record_unwind_protect_ptr (fclose_unwind, fp);
if (fstat (fileno (fp), &st) == 0
}
}
- unbind_to (count, Qnil);
+ dynwind_end ();
}
return buf;
old_charpos, old_bytepos);
}
- RETURN_UNGCPRO (make_number (it.vpos));
+ return make_number (it.vpos);
}
Lisp_Object start_marker, end_marker;
Lisp_Object preserve_marker;
struct gcpro gcpro1, gcpro2, gcpro3;
- ptrdiff_t count = SPECPDL_INDEX ();
+ dynwind_begin ();
struct rvoe_arg rvoe_arg;
start = make_number (start_int);
RESTORE_VALUE;
UNGCPRO;
- unbind_to (count, Qnil);
+ dynwind_end ();
}
/* Signal a change immediately after it happens.
void
signal_after_change (ptrdiff_t charpos, ptrdiff_t lendel, ptrdiff_t lenins)
{
- ptrdiff_t count = SPECPDL_INDEX ();
+ dynwind_begin ();
struct rvoe_arg rvoe_arg;
- if (inhibit_modification_hooks)
+ if (inhibit_modification_hooks) {
+ dynwind_end ();
return;
+ }
/* If we are deferring calls to the after-change functions
and there are no before-change functions,
= Fcons (elt, combine_after_change_list);
combine_after_change_buffer = Fcurrent_buffer ();
+ dynwind_end ();
return;
}
report_interval_modification (make_number (charpos),
make_number (charpos + lenins));
- unbind_to (count, Qnil);
+ dynwind_end ();
}
static void
doc: /* This function is for use internally in the function `combine-after-change-calls'. */)
(void)
{
- ptrdiff_t count = SPECPDL_INDEX ();
+ dynwind_begin ();
ptrdiff_t beg, end, change;
ptrdiff_t begpos, endpos;
Lisp_Object tail;
- if (NILP (combine_after_change_list))
+ if (NILP (combine_after_change_list)) {
+ dynwind_end ();
return Qnil;
+ }
/* It is rare for combine_after_change_buffer to be invalid, but
possible. It can happen when combine-after-change-calls is
|| !BUFFER_LIVE_P (XBUFFER (combine_after_change_buffer)))
{
combine_after_change_list = Qnil;
+ dynwind_end ();
return Qnil;
}
signal_after_change (begpos, endpos - begpos - change, endpos - begpos);
update_compositions (begpos, endpos, CHECK_ALL);
- return unbind_to (count, Qnil);
+ dynwind_end ();
+ return Qnil;
}
\f
void
Lisp_Object
recursive_edit_1 (void)
{
- ptrdiff_t count = SPECPDL_INDEX ();
+ dynwind_begin ();
Lisp_Object val;
if (command_loop_level > 0)
if (STRINGP (val))
xsignal1 (Qerror, val);
- return unbind_to (count, Qnil);
+ dynwind_end ();
+ return Qnil;
}
/* When an auto-save happens, record the "time", and don't do again soon. */
This function is called by the editor initialization to begin editing. */)
(void)
{
- ptrdiff_t count = SPECPDL_INDEX ();
+ dynwind_begin ();
Lisp_Object buffer;
/* If we enter while input is blocked, don't lock up here.
This may happen through the debugger during redisplay. */
- if (input_blocked_p ())
+ if (input_blocked_p ()) {
+ dynwind_end ();
return Qnil;
+ }
if (command_loop_level >= 0
&& current_buffer != XBUFFER (XWINDOW (selected_window)->contents))
temporarily_switch_to_single_kboard (SELECTED_FRAME ());
recursive_edit_1 ();
- return unbind_to (count, Qnil);
+ dynwind_end ();
+ return Qnil;
}
void
usage: (track-mouse BODY...) */)
(Lisp_Object args)
{
- ptrdiff_t count = SPECPDL_INDEX ();
+ dynwind_begin ();
Lisp_Object val;
record_unwind_protect (tracking_off, do_mouse_tracking);
do_mouse_tracking = Qt;
val = Fprogn (args);
- return unbind_to (count, val);
+ dynwind_end ();
+ return val;
}
/* If mouse has moved on some frame, return one of those frames.
/* FIXME: our `internal_condition_case' does not provide any way to pass data
to its body or to its handlers other than via globals such as
dynamically-bound variables ;-) */
- ptrdiff_t count = SPECPDL_INDEX ();
+ dynwind_begin ();
specbind (Qinhibit_quit, hook);
run_hook_with_args (1, &hook, safe_run_hook_funcall);
- unbind_to (count, Qnil);
+ dynwind_end ();
}
\f
{
if (NILP (AREF (chosen_timer, 0)))
{
- ptrdiff_t count = SPECPDL_INDEX ();
+ dynwind_begin ();
Lisp_Object old_deactivate_mark = Vdeactivate_mark;
/* Mark the timer as triggered to prevent problems if the lisp
call1 (Qtimer_event_handler, chosen_timer);
Vdeactivate_mark = old_deactivate_mark;
timers_run++;
- unbind_to (count, Qnil);
+ dynwind_end ();
/* Since we have handled the event,
we don't need to tell the caller to wake up and do it. */
Lisp_Object
menu_item_eval_property (Lisp_Object sexpr)
{
- ptrdiff_t count = SPECPDL_INDEX ();
+ dynwind_begin ();
Lisp_Object val;
specbind (Qinhibit_redisplay, Qt);
val = internal_condition_case_1 (eval_dyn, sexpr, Qerror,
menu_item_eval_property_1);
- return unbind_to (count, val);
+ dynwind_end ();
+ return val;
}
/* This function parses a menu item and leaves the result in the
Lisp_Object keybuf[30];
register int i;
struct gcpro gcpro1;
- ptrdiff_t count = SPECPDL_INDEX ();
+ dynwind_begin ();
if (!NILP (prompt))
CHECK_STRING (prompt);
QUIT;
}
UNGCPRO;
- return unbind_to (count,
- ((allow_string ? make_event_array : Fvector)
- (i, keybuf)));
+ Lisp_Object tem0 = ((allow_string ? make_event_array : Fvector) (i, keybuf));
+ dynwind_end ();
+ return tem0;
}
DEFUN ("read-key-sequence", Fread_key_sequence, Sread_key_sequence, 1, 5, 0,
On such systems, Emacs starts a subshell instead of suspending. */)
(Lisp_Object stuffstring)
{
- ptrdiff_t count = SPECPDL_INDEX ();
+ dynwind_begin ();
int old_height, old_width;
int width, height;
struct gcpro gcpro1;
sys_subshell ();
else
sys_suspend ();
- unbind_to (count, Qnil);
+ dynwind_end ();
/* Check if terminal/window size has changed.
Note that this is not useful when we are running directly
{
CHECK_IMPURE (prev);
XSETCDR (prev, parent);
- RETURN_UNGCPRO (parent);
+ return parent;
}
prev = list;
}
length = XFASTINT (Flength (key));
if (length == 0)
- RETURN_UNGCPRO (Qnil);
+ return Qnil;
if (SYMBOLP (def) && !EQ (Vdefine_key_rebound_commands, Qt))
Vdefine_key_rebound_commands = Fcons (def, Vdefine_key_rebound_commands);
message_with_string ("Key sequence contains invalid event %s", c, 1);
if (idx == length)
- RETURN_UNGCPRO (store_in_keymap (keymap, c, def));
+ return store_in_keymap (keymap, c, def);
cmd = access_keymap (keymap, c, 0, 1, 1);
length = XFASTINT (Flength (key));
if (length == 0)
- RETURN_UNGCPRO (keymap);
+ return keymap;
idx = 0;
while (1)
cmd = access_keymap (keymap, c, t_ok, 0, 1);
if (idx == length)
- RETURN_UNGCPRO (cmd);
+ return cmd;
keymap = get_keymap (cmd, 0, 1);
if (!CONSP (keymap))
- RETURN_UNGCPRO (make_number (idx));
+ return make_number (idx);
QUIT;
}
like in the respective argument of `key-binding'. */)
(Lisp_Object olp, Lisp_Object position)
{
- ptrdiff_t count = SPECPDL_INDEX ();
+ dynwind_begin ();
Lisp_Object keymaps = list1 (current_global_map);
keymaps = Fcons (otlp, keymaps);
}
- unbind_to (count, Qnil);
+ dynwind_end ();
return keymaps;
}
if (KEYMAPP (binding))
maps[j++] = Fcons (modes[i], binding);
else if (j == 0)
- RETURN_UNGCPRO (list1 (Fcons (modes[i], binding)));
+ return list1 (Fcons (modes[i], binding));
}
UNGCPRO;
/* We have a list of advertised bindings. */
while (CONSP (tem))
if (EQ (shadow_lookup (keymaps, XCAR (tem), Qnil, 0), definition))
- RETURN_UNGCPRO (XCAR (tem));
+ return XCAR (tem);
else
tem = XCDR (tem);
if (EQ (shadow_lookup (keymaps, tem, Qnil, 0), definition))
- RETURN_UNGCPRO (tem);
+ return tem;
}
sequences = Freverse (where_is_internal (definition, keymaps,
nil, then we should return the first ascii-only binding
we find. */
if (EQ (firstonly, Qnon_ascii))
- RETURN_UNGCPRO (sequence);
+ return sequence;
else if (!NILP (firstonly)
&& 2 == preferred_sequence_p (sequence))
- RETURN_UNGCPRO (sequence);
+ return sequence;
}
UNGCPRO;
DESCRIBER is the output function used; nil means use `princ'. */)
(Lisp_Object vector, Lisp_Object describer)
{
- ptrdiff_t count = SPECPDL_INDEX ();
+ dynwind_begin ();
if (NILP (describer))
describer = intern ("princ");
specbind (Qstandard_output, Fcurrent_buffer ());
describe_vector (vector, Qnil, describer, describe_vector_princ, 0,
Qnil, Qnil, 0, 0);
- return unbind_to (count, Qnil);
+ dynwind_end ();
+ return Qnil;
}
/* Insert in the current buffer a description of the contents of VECTOR.
{
FILE *stream = NULL;
int fd;
- ptrdiff_t count = SPECPDL_INDEX ();
+ dynwind_begin ();
struct gcpro gcpro1, gcpro2, gcpro3;
Lisp_Object found, efound, hist_file_name;
/* True means we printed the ".el is newer" message. */
{
file = internal_condition_case_1 (Fsubstitute_in_file_name, file,
Qt, load_error_handler);
- if (NILP (file))
- return Qnil;
+ if (NILP (file)) {
+ dynwind_end ();
+ return Qnil;
+ }
}
else
file = Fsubstitute_in_file_name (file);
{
if (NILP (noerror))
report_file_error ("Cannot open load file", file);
+ dynwind_end ();
return Qnil;
}
handler = Ffind_file_name_handler (found, Qt);
else
handler = Ffind_file_name_handler (found, Qload);
- if (! NILP (handler))
- return call5 (handler, Qload, found, noerror, nomessage, Qt);
+ if (! NILP (handler)) {
+ dynwind_end ();
+ return call5 (handler, Qload, found, noerror, nomessage, Qt);
+ }
#ifdef DOS_NT
/* Tramp has to deal with semi-broken packages that prepend
drive letters to remote files. For that reason, Tramp
val = call4 (Vload_source_file_function, found, hist_file_name,
NILP (noerror) ? Qnil : Qt,
(NILP (nomessage) || force_load_messages) ? Qnil : Qt);
- return unbind_to (count, val);
+ dynwind_end ();
+ return val;
}
}
readevalloop (Qget_emacs_mule_file_char, stream, hist_file_name,
0, Qnil, Qnil, Qnil, Qnil);
}
- unbind_to (count, Qnil);
+ dynwind_end ();
/* Run any eval-after-load forms for this file. */
if (!NILP (Ffboundp (Qdo_after_load_evaluation)))
{
register int c;
register Lisp_Object val;
- ptrdiff_t count = SPECPDL_INDEX ();
+ dynwind_begin ();
struct gcpro gcpro1, gcpro2, gcpro3, gcpro4;
struct buffer *b = 0;
bool continue_reading_p;
continue_reading_p = 1;
while (continue_reading_p)
{
- ptrdiff_t count1 = SPECPDL_INDEX ();
+ dynwind_begin ();
if (b != 0 && !BUFFER_LIVE_P (b))
error ("Reading from killed buffer");
}
if (c < 0)
{
- unbind_to (count1, Qnil);
+ dynwind_end ();
break;
}
start = Fpoint_marker ();
/* Restore saved point and BEGV. */
- unbind_to (count1, Qnil);
+ dynwind_end ();
/* Now eval what we just read. */
if (!NILP (macroexpand))
UNGCPRO;
- unbind_to (count, Qnil);
+ dynwind_end ();
}
DEFUN ("eval-buffer", Feval_buffer, Seval_buffer, 0, 5, "",
This function preserves the position of point. */)
(Lisp_Object buffer, Lisp_Object printflag, Lisp_Object filename, Lisp_Object unibyte, Lisp_Object do_allow_print)
{
- ptrdiff_t count = SPECPDL_INDEX ();
+ dynwind_begin ();
Lisp_Object tem, buf;
if (NILP (buffer))
specbind (Qlexical_binding, lisp_file_lexically_bound_p (buf) ? Qt : Qnil);
readevalloop (buf, 0, filename,
!NILP (printflag), unibyte, Qnil, Qnil, Qnil);
- unbind_to (count, Qnil);
+ dynwind_end ();
return Qnil;
}
(Lisp_Object start, Lisp_Object end, Lisp_Object printflag, Lisp_Object read_function)
{
/* FIXME: Do the eval-sexp-add-defvars dance! */
- ptrdiff_t count = SPECPDL_INDEX ();
+ dynwind_begin ();
Lisp_Object tem, cbuf;
cbuf = Fcurrent_buffer ();
!NILP (printflag), Qnil, read_function,
start, end);
- return unbind_to (count, Qnil);
+ dynwind_end ();
+ return Qnil;
}
\f
{
Lisp_Object final;
Lisp_Object tem;
- ptrdiff_t pdlcount = SPECPDL_INDEX ();
+ dynwind_begin ();
EMACS_INT repeat = 1;
struct gcpro gcpro1, gcpro2;
EMACS_INT success_count = 0;
Vreal_this_command = Vexecuting_kbd_macro;
UNGCPRO;
- return unbind_to (pdlcount, Qnil);
+ dynwind_end ();
+ return Qnil;
}
\f
void
struct frame *f = NULL;
Lisp_Object x, y, window;
int menuflags = 0;
- ptrdiff_t specpdl_count = SPECPDL_INDEX ();
+ dynwind_begin ();
ptrdiff_t specpdl_count2;
struct gcpro gcpro1;
if (NILP (position))
/* This is an obsolete call, which wants us to precompute the
keybinding equivalents, but we don't do that any more anyway. */
- return Qnil;
+ {
+ dynwind_end ();
+ return Qnil;
+ }
{
bool get_current_pos_p = 0;
menuflags &= ~MENU_KEYMAPS;
}
- unbind_to (specpdl_count, Qnil);
+ dynwind_end ();
#ifdef HAVE_WINDOW_SYSTEM
/* Hide a previous tip, if any. */
}
#endif
- specpdl_count2 = SPECPDL_INDEX ();
+ dynwind_begin ();
#ifdef HAVE_NS /* FIXME: ns-specific, why? --Stef */
record_unwind_protect_void (discard_menu_items);
discard_menu_items ();
#endif
- unbind_to (specpdl_count2, Qnil);
+ dynwind_end ();
#ifdef HAVE_NTGUI /* FIXME: Is it really w32-specific? --Stef */
if (FRAME_W32_P (f))
}
val = Fcar (expr_and_pos);
- RETURN_UNGCPRO (val);
+ return val;
}
bool allow_props, bool inherit_input_method)
{
Lisp_Object val;
- ptrdiff_t count = SPECPDL_INDEX ();
+ dynwind_begin ();
Lisp_Object mini_frame, ambient_dir, minibuffer, input_method;
struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5;
Lisp_Object enable_multibyte;
expflag, histvar, histpos, defalt,
allow_props, inherit_input_method);
UNGCPRO;
- return unbind_to (count, val);
+ dynwind_end ();
+ return val;
}
/* Choose the minibuffer window and frame, and take action on them. */
/* Erase the buffer. */
{
- ptrdiff_t count1 = SPECPDL_INDEX ();
+ dynwind_begin ();
specbind (Qinhibit_read_only, Qt);
specbind (Qinhibit_modification_hooks, Qt);
Ferase_buffer ();
Fadd_text_properties (make_number (BEG), make_number (PT),
Vminibuffer_prompt_properties, Qnil);
}
- unbind_to (count1, Qnil);
+ dynwind_end ();
}
minibuf_prompt_width = current_column ();
/* The appropriate frame will get selected
in set-window-configuration. */
UNGCPRO;
- return unbind_to (count, val);
+ dynwind_end ();
+ return val;
}
/* Return a buffer to be used as the minibuffer at depth `depth'.
}
else
{
- ptrdiff_t count = SPECPDL_INDEX ();
+ dynwind_begin ();
/* We have to empty both overlay lists. Otherwise we end
up with overlays that think they belong to this buffer
while the buffer doesn't know about them any more. */
call0 (intern ("minibuffer-inactive-mode"));
else
Fkill_all_local_variables ();
- unbind_to (count, Qnil);
+ dynwind_end ();
}
return buf;
/* Erase the minibuffer we were using at this level. */
{
- ptrdiff_t count = SPECPDL_INDEX ();
+ dynwind_begin ();
/* Prevent error in erase-buffer. */
specbind (Qinhibit_read_only, Qt);
specbind (Qinhibit_modification_hooks, Qt);
old_deactivate_mark = Vdeactivate_mark;
Ferase_buffer ();
Vdeactivate_mark = old_deactivate_mark;
- unbind_to (count, Qnil);
+ dynwind_end ();
}
/* When we get to the outmost level, make sure we resize the
(Lisp_Object prompt, Lisp_Object initial_input, Lisp_Object history, Lisp_Object default_value, Lisp_Object inherit_input_method)
{
Lisp_Object val;
- ptrdiff_t count = SPECPDL_INDEX ();
+ dynwind_begin ();
/* Just in case we're in a recursive minibuffer, make it clear that the
previous minibuffer's completion table does not apply to the new
inherit_input_method);
if (STRINGP (val) && SCHARS (val) == 0 && ! NILP (default_value))
val = CONSP (default_value) ? XCAR (default_value) : default_value;
- return unbind_to (count, val);
+ dynwind_end ();
+ return val;
}
DEFUN ("read-no-blanks-input", Fread_no_blanks_input, Sread_no_blanks_input, 1, 3, 0,
Lisp_Object args[4], result;
char *s;
ptrdiff_t len;
- ptrdiff_t count = SPECPDL_INDEX ();
+ dynwind_begin ();
if (BUFFERP (def))
def = BVAR (XBUFFER (def), name);
args[3] = require_match;
result = Ffuncall (4, args);
}
- return unbind_to (count, result);
+ dynwind_end ();
+ return result;
}
\f
static Lisp_Object
/* Reject this element if it fails to match all the regexps. */
if (CONSP (Vcompletion_regexp_list))
{
- ptrdiff_t count = SPECPDL_INDEX ();
+ dynwind_begin ();
specbind (Qcase_fold_search, completion_ignore_case ? Qt : Qnil);
for (regexps = Vcompletion_regexp_list; CONSP (regexps);
regexps = XCDR (regexps))
{
if (NILP (Fstring_match (XCAR (regexps),
SYMBOLP (tem) ? string : tem,
- Qnil)))
- return unbind_to (count, Qnil);
+ Qnil))){
+
+ dynwind_end ();
+ return Qnil;
+ }
}
- unbind_to (count, Qnil);
+ dynwind_end ();
}
/* Finally, check the predicate. */
Lisp_Object buffer, name, program, proc, current_dir, tem;
register unsigned char **new_argv;
ptrdiff_t i;
- ptrdiff_t count = SPECPDL_INDEX ();
+ dynwind_begin ();
buffer = args[1];
if (!NILP (buffer))
else
create_pty (proc);
- return unbind_to (count, proc);
+ dynwind_end ();
+ return proc;
}
/* This function is the unwind_protect form for Fstart_process. If
name = port;
CHECK_STRING (name);
proc = make_process (name);
- specpdl_count = SPECPDL_INDEX ();
+ dynwind_begin ();
record_unwind_protect_1 (remove_process, proc, false);
p = XPROCESS (proc);
Fserial_process_configure (nargs, args);
- unbind_to (specpdl_count, Qnil);
+ dynwind_end ();
UNGCPRO;
return proc;
s = socket (AF_INET, SOCK_STREAM | SOCK_CLOEXEC, 0);
if (s < 0)
return Qnil;
- count = SPECPDL_INDEX ();
+ dynwind_begin ();
record_unwind_protect_int (close_file_unwind, s);
do
{
emacs_close (s);
xfree (buf);
+ dynwind_end ();
return Qnil;
}
}
while (ifconf.ifc_len == buf_size);
- unbind_to (count, Qnil);
+ dynwind_end ();
ifreq = ifconf.ifc_req;
while ((char *) ifreq < (char *) ifconf.ifc_req + ifconf.ifc_len)
{
s = socket (AF_INET, SOCK_STREAM | SOCK_CLOEXEC, 0);
if (s < 0)
return Qnil;
- count = SPECPDL_INDEX ();
+ dynwind_begin ();
record_unwind_protect_int (close_file_unwind, s);
elt = Qnil;
#endif
res = Fcons (elt, res);
- return unbind_to (count, any ? res : Qnil);
+ Lisp_Object tem0 = any ? res : Qnil;
+ dynwind_end ();
+ return tem0;
}
#endif /* !SIOCGIFADDR && !SIOCGIFHWADDR && !SIOCGIFFLAGS */
#endif /* defined (HAVE_NET_IF_H) */
return;
}
- count = SPECPDL_INDEX ();
+ dynwind_begin ();
record_unwind_protect_int_1 (close_file_unwind, s, false);
connect_counter++;
pset_command (p, Qnil);
p->pid = 0;
- unbind_to (count, Qnil);
+ dynwind_end ();
p->open_fd[SUBPROCESS_STDIN] = s;
p->infd = s;
Lisp_Object proc;
struct timespec timeout, end_time;
int got_some_input = -1;
- ptrdiff_t count = SPECPDL_INDEX ();
+ dynwind_begin ();
FD_ZERO (&Available);
FD_ZERO (&Writeok);
} /* End for each file descriptor. */
} /* End while exit conditions not met. */
- unbind_to (count, Qnil);
+ dynwind_end ();
/* If calling from keyboard input, do not quit
since we want to return C-g as an input character.
struct coding_system *coding = proc_decode_coding_system[channel];
int carryover = p->decoding_carryover;
int readmax = 4096;
- ptrdiff_t count = SPECPDL_INDEX ();
+ dynwind_begin ();
Lisp_Object odeactivate;
chars = alloca (carryover + readmax);
(including the one in proc_buffered_char[channel]). */
if (nbytes <= 0)
{
- if (nbytes < 0 || coding->mode & CODING_MODE_LAST_BLOCK)
- return nbytes;
+ if (nbytes < 0 || coding->mode & CODING_MODE_LAST_BLOCK) {
+ dynwind_end ();
+ return nbytes;
+ }
coding->mode |= CODING_MODE_LAST_BLOCK;
}
/* Handling the process output should not deactivate the mark. */
Vdeactivate_mark = odeactivate;
- unbind_to (count, Qnil);
+ dynwind_end ();
return nbytes;
}
{
Lisp_Object sentinel, odeactivate;
struct Lisp_Process *p = XPROCESS (proc);
- ptrdiff_t count = SPECPDL_INDEX ();
+ dynwind_begin ();
bool outer_running_asynch_code = running_asynch_code;
int waiting = waiting_for_user_input_p;
- if (inhibit_sentinels)
+ if (inhibit_sentinels) {
+ dynwind_end ();
return;
+ }
/* No need to gcpro these, because all we do with them later
is test them for EQness, and none of them should be a string. */
if (waiting_for_user_input_p == -1)
record_asynch_buffer_change ();
- unbind_to (count, Qnil);
+ dynwind_end ();
}
/* Report all recent events of a change in process status
(Lisp_Object sound)
{
Lisp_Object attrs[SOUND_ATTR_SENTINEL];
- ptrdiff_t count = SPECPDL_INDEX ();
+ dynwind_begin ();
#ifndef WINDOWSNT
Lisp_Object file;
#endif /* WINDOWSNT */
- unbind_to (count, Qnil);
+ dynwind_end ();
return Qnil;
}
\f
if (gr)
attrs = Fcons (Fcons (Qgroup, build_string (gr->gr_name)), attrs);
- count = SPECPDL_INDEX ();
+ dynwind_begin ();
strcpy (fn, procfn);
procfn_end = fn + strlen (fn);
strcpy (procfn_end, "/stat");
attrs = Fcons (Fcons (Qpmem, make_float (pmem)), attrs);
}
}
- unbind_to (count, Qnil);
+ dynwind_end ();
/* args */
strcpy (procfn_end, "/cmdline");
if (gr)
attrs = Fcons (Fcons (Qgroup, build_string (gr->gr_name)), attrs);
- count = SPECPDL_INDEX ();
+ dynwind_begin ();
strcpy (fn, procfn);
procfn_end = fn + strlen (fn);
strcpy (procfn_end, "/psinfo");
Vlocale_coding_system, 0));
attrs = Fcons (Fcons (Qargs, decoded_cmd), attrs);
}
- unbind_to (count, Qnil);
+ dynwind_end ();
UNGCPRO;
return attrs;
}
else
{
Lisp_Object initial_value, value;
- ptrdiff_t count = SPECPDL_INDEX ();
+ dynwind_begin ();
if (! NILP (object))
CHECK_BUFFER (object);
break;
}
- unbind_to (count, Qnil);
+ dynwind_end ();
}
return position;
}
else
{
- ptrdiff_t count = SPECPDL_INDEX ();
+ dynwind_begin ();
if (! NILP (object))
CHECK_BUFFER (object);
}
}
- unbind_to (count, Qnil);
+ dynwind_end ();
}
return position;
do
{
if (got >= len)
- RETURN_UNGCPRO (Qnil);
+ return Qnil;
len -= got;
i = next_interval (i);
got = LENGTH (i);
Lisp_Object list;
Lisp_Object prev, next, last_boundary;
EMACS_INT size_so_far = 0;
- ptrdiff_t count = SPECPDL_INDEX ();
+ dynwind_begin ();
static const size_t sizeof_cons = sizeof (scm_t_cell);
/* Make the buffer current to get its local values of variables such
{
/* The function is responsible for making
any desired changes in buffer-undo-list. */
- unbind_to (count, Qnil);
+ dynwind_end ();
return;
}
/* That function probably used the minibuffer, and if so, that
else
bset_undo_list (b, Qnil);
- unbind_to (count, Qnil);
+ dynwind_end ();
}
\f
int minibuffer_only = 0;
long window_prompting = 0;
int width, height;
- ptrdiff_t count = SPECPDL_INDEX ();
+ dynwind_begin ();
struct gcpro gcpro1, gcpro2, gcpro3, gcpro4;
Lisp_Object display;
struct w32_display_info *dpyinfo = NULL;
and similar functions. */
Vwindow_list = Qnil;
- return unbind_to (count, frame);
+ dynwind_end ();
+ return frame;
}
/* FRAME is used only to get a handle on the X display. We don't pass the
Lisp_Object name;
long window_prompting = 0;
int width, height;
- ptrdiff_t count = SPECPDL_INDEX ();
+ dynwind_begin ();
struct gcpro gcpro1, gcpro2, gcpro3;
struct kboard *kb;
int face_change_count_before = face_change_count;
face_change_count = face_change_count_before;
/* Discard the unwind_protect. */
- return unbind_to (count, frame);
+ dynwind_end ();
+ return frame;
}
int i, width, height, seen_reversed_p;
struct gcpro gcpro1, gcpro2, gcpro3, gcpro4;
int old_windows_or_buffers_changed = windows_or_buffers_changed;
- ptrdiff_t count = SPECPDL_INDEX ();
+ dynwind_begin ();
specbind (Qinhibit_redisplay, Qt);
intern ("x-hide-tip"));
UNGCPRO;
- return unbind_to (count, Qnil);
+ dynwind_end ();
+ return Qnil;
}
GCPRO2 (frame, timer);
tip_frame = tip_timer = deleted = Qnil;
- count = SPECPDL_INDEX ();
+ dynwind_begin ();
specbind (Qinhibit_redisplay, Qt);
specbind (Qinhibit_quit, Qt);
}
UNGCPRO;
- return unbind_to (count, deleted);
+ dynwind_end ();
+ return deleted;
}
\f
/***********************************************************************
#endif /* !NTGUI_UNICODE */
{
- ptrdiff_t count = SPECPDL_INDEX ();
+ dynwind_begin ();
/* Prevent redisplay. */
specbind (Qinhibit_redisplay, Qt);
block_input ();
}
#endif /* !NTGUI_UNICODE */
unblock_input ();
- unbind_to (count, Qnil);
+ dynwind_end ();
}
if (file_opened)
if (NILP (filename))
Fsignal (Qquit, Qnil);
- RETURN_UNGCPRO (filename);
+ return filename;
}
\f
struct buffer *prev = current_buffer;
Lisp_Object buffer;
- ptrdiff_t specpdl_count = SPECPDL_INDEX ();
+ dynwind_begin ();
int previous_menu_items_used = f->menu_bar_items_used;
Lisp_Object *previous_items
= (Lisp_Object *) alloca (previous_menu_items_used
{
free_menubar_widget_value_tree (first_wv);
discard_menu_items ();
- unbind_to (specpdl_count, Qnil);
+ dynwind_end ();
return;
}
f->menu_bar_items_used = menu_items_used;
/* This undoes save_menu_items. */
- unbind_to (specpdl_count, Qnil);
+ dynwind_end ();
/* Now GC cannot happen during the lifetime of the widget_value,
so it's safe to store data from a Lisp_String, as long as
{
if (EQ (window, selected_window))
/* Preferably return the selected window. */
- RETURN_UNGCPRO (window);
+ return window;
else if (EQ (XWINDOW (window)->frame, selected_frame)
&& !frame_best_window_flag)
/* Prefer windows on the current frame (but don't
void
run_window_configuration_change_hook (struct frame *f)
{
- ptrdiff_t count = SPECPDL_INDEX ();
+ dynwind_begin ();
Lisp_Object frame, global_wcch
= Fdefault_value (Qwindow_configuration_change_hook);
XSETFRAME (frame, f);
- if (NILP (Vrun_hooks) || !NILP (inhibit_lisp_code))
+ if (NILP (Vrun_hooks) || !NILP (inhibit_lisp_code)) {
+ dynwind_end ();
return;
+ }
/* Use the right buffer. Matters when running the local hooks. */
if (current_buffer != XBUFFER (Fwindow_buffer (Qnil)))
if (!NILP (Flocal_variable_p (Qwindow_configuration_change_hook,
buffer)))
{
- ptrdiff_t inner_count = SPECPDL_INDEX ();
+ dynwind_begin ();
record_unwind_protect (select_window_norecord, selected_window);
select_window_norecord (window);
run_funs (Fbuffer_local_value (Qwindow_configuration_change_hook,
buffer));
- unbind_to (inner_count, Qnil);
+ dynwind_end ();
}
}
}
run_funs (global_wcch);
- unbind_to (count, Qnil);
+ dynwind_end ();
}
DEFUN ("run-window-configuration-change-hook", Frun_window_configuration_change_hook,
{
struct window *w = XWINDOW (window);
struct buffer *b = XBUFFER (buffer);
- ptrdiff_t count = SPECPDL_INDEX ();
+ dynwind_begin ();
bool samebuf = EQ (buffer, w->contents);
wset_buffer (w, buffer);
run_window_configuration_change_hook (XFRAME (WINDOW_FRAME (w)));
}
- unbind_to (count, Qnil);
+ dynwind_end ();
}
DEFUN ("set-window-buffer", Fset_window_buffer, Sset_window_buffer, 2, 3, 0,
/* Run temp-buffer-show-hook, with the chosen window selected
and its buffer current. */
{
- ptrdiff_t count = SPECPDL_INDEX ();
+ dynwind_begin ();
Lisp_Object prev_window, prev_buffer;
prev_window = selected_window;
XSETBUFFER (prev_buffer, old);
Fselect_window (window, Qt);
Fset_buffer (w->contents);
Frun_hooks (1, &Qtemp_buffer_show_hook);
- unbind_to (count, Qnil);
+ dynwind_end ();
}
}
}
static void
scroll_command (Lisp_Object n, int direction)
{
- ptrdiff_t count = SPECPDL_INDEX ();
+ dynwind_begin ();
eassert (eabs (direction) == 1);
window_scroll (selected_window, XINT (n) * direction, 0, 0);
}
- unbind_to (count, Qnil);
+ dynwind_end ();
}
DEFUN ("scroll-up", Fscroll_up, Sscroll_up, 0, 1, "^P",
{
Lisp_Object window;
struct window *w;
- ptrdiff_t count = SPECPDL_INDEX ();
+ dynwind_begin ();
window = Fother_window_for_scrolling ();
w = XWINDOW (window);
}
set_marker_both (w->pointm, Qnil, PT, PT_BYTE);
- unbind_to (count, Qnil);
+ dynwind_end ();
return Qnil;
}
else
{
ptrdiff_t i;
- ptrdiff_t count = SPECPDL_INDEX ();
+ dynwind_begin ();
struct gcpro gcpro1;
Lisp_Object *args = alloca (nargs * word_size);
val = internal_condition_case_n (Ffuncall, nargs, args, Qt,
safe_eval_handler);
UNGCPRO;
- unbind_to (count, val);
+ dynwind_end ();
}
return val;
no amount of fontifying will be able to change it. */
NILP (prop) && IT_CHARPOS (*it) < Z))
{
- ptrdiff_t count = SPECPDL_INDEX ();
+ dynwind_begin ();
Lisp_Object val;
struct buffer *obuf = current_buffer;
ptrdiff_t begv = BEGV, zv = ZV;
UNGCPRO;
}
- unbind_to (count, Qnil);
+ dynwind_end ();
/* Fontification functions routinely call `save-restriction'.
Normally, this tags clip_changed, which can confuse redisplay
if (!NILP (form) && !EQ (form, Qt))
{
- ptrdiff_t count = SPECPDL_INDEX ();
+ dynwind_begin ();
struct gcpro gcpro1;
/* Bind `object' to the object having the `display' property, a
GCPRO1 (form);
form = safe_eval (form);
UNGCPRO;
- unbind_to (count, Qnil);
+ dynwind_end ();
}
if (NILP (form))
{
/* Evaluate IT->font_height with `height' bound to the
current specified height to get the new height. */
- ptrdiff_t count = SPECPDL_INDEX ();
+ dynwind_begin ();
specbind (Qheight, face->lface[LFACE_HEIGHT_INDEX]);
value = safe_eval (it->font_height);
- unbind_to (count, Qnil);
+ dynwind_end ();
if (NUMBERP (value))
new_height = XFLOATINT (value);
{
Lisp_Object buffer;
int this_one, the_other, clear_buffer_p, rc;
- ptrdiff_t count = SPECPDL_INDEX ();
+ dynwind_begin ();
/* If buffers aren't live, make new ones. */
ensure_echo_area_buffers ();
eassert (BEGV >= BEG);
eassert (ZV <= Z && ZV >= BEGV);
- unbind_to (count, Qnil);
+ dynwind_end ();
return rc;
}
if (Z > BEG)
{
- ptrdiff_t count = SPECPDL_INDEX ();
+ dynwind_begin ();
specbind (Qinhibit_read_only, Qt);
/* Note that undo recording is always disabled. */
del_range (BEG, Z);
- unbind_to (count, Qnil);
+ dynwind_end ();
}
TEMP_SET_PT_BOTH (BEG, BEG_BYTE);
/* Must update other windows. Likewise as in other
cases, don't let this update be interrupted by
pending input. */
- ptrdiff_t count = SPECPDL_INDEX ();
+ dynwind_begin ();
specbind (Qredisplay_dont_pause, Qt);
windows_or_buffers_changed = 44;
redisplay_internal ();
- unbind_to (count, Qnil);
+ dynwind_end ();
}
else if (FRAME_WINDOW_P (f) && n == 0)
{
char *title;
ptrdiff_t len;
struct it it;
- ptrdiff_t count = SPECPDL_INDEX ();
+ dynwind_begin ();
FOR_EACH_FRAME (tail, other_frame)
{
display_mode_element (&it, 0, -1, -1, fmt, Qnil, 0);
len = MODE_LINE_NOPROP_LEN (title_start);
title = mode_line_noprop_buf + title_start;
- unbind_to (count, Qnil);
+ dynwind_end ();
/* Set the title only if it's changed. This avoids consing in
the common case where it hasn't. (If it turns out that we've
if (all_windows)
{
Lisp_Object tail, frame;
- ptrdiff_t count = SPECPDL_INDEX ();
+ dynwind_begin ();
/* 1 means that update_menu_bar has run its hooks
so any further calls to update_menu_bar shouldn't do so again. */
int menu_bar_hooks_run = 0;
UNGCPRO;
}
- unbind_to (count, Qnil);
+ dynwind_end ();
}
else
{
|| window_buffer_changed (w))
{
struct buffer *prev = current_buffer;
- ptrdiff_t count = SPECPDL_INDEX ();
+ dynwind_begin ();
specbind (Qinhibit_menubar_update, Qt);
w->update_mode_line = 1;
#endif /* ! (USE_X_TOOLKIT || HAVE_NTGUI || HAVE_NS || USE_GTK) */
- unbind_to (count, Qnil);
+ dynwind_end ();
set_buffer_internal_1 (prev);
}
}
|| window_buffer_changed (w))
{
struct buffer *prev = current_buffer;
- ptrdiff_t count = SPECPDL_INDEX ();
+ dynwind_begin ();
Lisp_Object frame, new_tool_bar;
int new_n_tool_bar;
struct gcpro gcpro1;
UNGCPRO;
- unbind_to (count, Qnil);
+ dynwind_end ();
set_buffer_internal_1 (prev);
}
}
/* Record a function that clears redisplaying_p
when we leave this function. */
- count = SPECPDL_INDEX ();
+ dynwind_begin ();
record_unwind_protect_void (unwind_redisplay);
redisplaying_p = 1;
specbind (Qinhibit_free_realized_faces, Qnil);
if (interrupt_input && interrupts_deferred)
request_sigio ();
- unbind_to (count, Qnil);
+ dynwind_end ();
RESUME_POLLING;
}
It indicates that the buffer contents and narrowing are unchanged. */
bool buffer_unchanged_p = false;
int temp_scroll_step = 0;
- ptrdiff_t count = SPECPDL_INDEX ();
+ dynwind_begin ();
int rc;
int centering_position = -1;
int last_line_misfit = 0;
if (CHARPOS (lpoint) <= ZV)
TEMP_SET_PT_BOTH (CHARPOS (lpoint), BYTEPOS (lpoint));
- unbind_to (count, Qnil);
+ dynwind_end ();
}
{
struct it it;
struct face *face;
- ptrdiff_t count = SPECPDL_INDEX ();
+ dynwind_begin ();
init_iterator (&it, w, -1, -1, NULL, face_id);
/* Don't extend on a previously drawn mode-line.
display_mode_element (&it, 0, 0, 0, format, Qnil, 0);
pop_kboard ();
- unbind_to (count, Qnil);
+ dynwind_end ();
/* Fill up with spaces. */
display_string (" ", Qnil, Qnil, 0, 0, &it, 10000, -1, -1, 0);
struct buffer *old_buffer = NULL;
int face_id;
int no_props = INTEGERP (face);
- ptrdiff_t count = SPECPDL_INDEX ();
+ dynwind_begin ();
Lisp_Object str;
int string_start = 0;
/* Make formatting the modeline a non-op when noninteractive, otherwise
there will be problems later caused by a partially initialized frame. */
- if (NILP (format) || noninteractive)
+ if (NILP (format) || noninteractive) {
+ dynwind_end ();
return empty_unibyte_string;
+ }
if (no_props)
face = Qnil;
empty_unibyte_string);
}
- unbind_to (count, Qnil);
+ dynwind_end ();
return str;
}
realize_basic_faces (struct frame *f)
{
bool success_p = 0;
- ptrdiff_t count = SPECPDL_INDEX ();
+ dynwind_begin ();
/* Block input here so that we won't be surprised by an X expose
event, for instance, without having the faces set up. */
success_p = 1;
}
- unbind_to (count, Qnil);
+ dynwind_end ();
unblock_input ();
return success_p;
}
int minibuffer_only = 0;
long window_prompting = 0;
int width, height;
- ptrdiff_t count = SPECPDL_INDEX ();
+ dynwind_begin ();
struct gcpro gcpro1, gcpro2, gcpro3, gcpro4;
Lisp_Object display;
struct x_display_info *dpyinfo = NULL;
could get an infloop in next_frame since the frame is not yet in
Vframe_list. */
{
- ptrdiff_t count2 = SPECPDL_INDEX ();
+ dynwind_begin ();
record_unwind_protect (unwind_create_frame_1, inhibit_lisp_code);
inhibit_lisp_code = Qt;
? make_number (0) : make_number (1),
NULL, NULL, RES_TYPE_NUMBER);
- unbind_to (count2, Qnil);
+ dynwind_end ();
}
x_default_parameter (f, parms, Qbuffer_predicate, Qnil,
and similar functions. */
Vwindow_list = Qnil;
- return unbind_to (count, frame);
+ dynwind_end ();
+ return frame;
}
Lisp_Object frame;
Lisp_Object name;
int width, height;
- ptrdiff_t count = SPECPDL_INDEX ();
+ dynwind_begin ();
struct gcpro gcpro1, gcpro2, gcpro3;
int face_change_count_before = face_change_count;
Lisp_Object buffer;
face_change_count = face_change_count_before;
/* Discard the unwind_protect. */
- return unbind_to (count, frame);
+ dynwind_end ();
+ return frame;
}
int i, width, height, seen_reversed_p;
struct gcpro gcpro1, gcpro2, gcpro3, gcpro4;
int old_windows_or_buffers_changed = windows_or_buffers_changed;
- ptrdiff_t count = SPECPDL_INDEX ();
+ dynwind_begin ();
specbind (Qinhibit_redisplay, Qt);
intern ("x-hide-tip"));
UNGCPRO;
- return unbind_to (count, Qnil);
+ dynwind_end ();
+ return Qnil;
}
GCPRO2 (frame, timer);
tip_frame = tip_timer = deleted = Qnil;
- count = SPECPDL_INDEX ();
+ dynwind_begin ();
specbind (Qinhibit_redisplay, Qt);
specbind (Qinhibit_quit, Qt);
}
UNGCPRO;
- return unbind_to (count, deleted);
+ dynwind_end ();
+ return deleted;
}
Arg al[10];
int ac = 0;
XmString dir_xmstring, pattern_xmstring;
- ptrdiff_t count = SPECPDL_INDEX ();
+ dynwind_begin ();
struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5, gcpro6;
check_window_system (f);
decoded_file = DECODE_FILE (file);
- return unbind_to (count, decoded_file);
+ dynwind_end ();
+ return decoded_file;
}
#endif /* USE_MOTIF */
char *fn;
Lisp_Object file = Qnil;
Lisp_Object decoded_file;
- ptrdiff_t count = SPECPDL_INDEX ();
+ dynwind_begin ();
struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5, gcpro6;
char *cdef_file;
decoded_file = DECODE_FILE (file);
- return unbind_to (count, decoded_file);
+ dynwind_end ();
+ return decoded_file;
}
Lisp_Object font_param;
char *default_name = NULL;
struct gcpro gcpro1, gcpro2;
- ptrdiff_t count = SPECPDL_INDEX ();
+ dynwind_begin ();
if (popup_activated ())
error ("Trying to use a menu from within a menu-entry");
if (NILP (font))
Fsignal (Qquit, Qnil);
- return unbind_to (count, font);
+ dynwind_end ();
+ return font;
}
#endif /* HAVE_FREETYPE */
struct buffer *prev = current_buffer;
Lisp_Object buffer;
- ptrdiff_t specpdl_count = SPECPDL_INDEX ();
+ dynwind_begin ();
int previous_menu_items_used = f->menu_bar_items_used;
Lisp_Object *previous_items
= alloca (previous_menu_items_used * sizeof *previous_items);
the menus in any form, since it would be a no-op. */
free_menubar_widget_value_tree (first_wv);
discard_menu_items ();
- unbind_to (specpdl_count, Qnil);
+ dynwind_end ();
return;
}
f->menu_bar_items_used = menu_items_used;
/* This undoes save_menu_items. */
- unbind_to (specpdl_count, Qnil);
+ dynwind_end ();
/* Now GC cannot happen during the lifetime of the widget_value,
so it's safe to store data from a Lisp_String. */
GtkWidget *menu;
GtkMenuPositionFunc pos_func = 0; /* Pop up at pointer. */
struct next_popup_x_y popup_x_y;
- ptrdiff_t specpdl_count = SPECPDL_INDEX ();
+ dynwind_begin ();
bool use_pos_func = ! for_click;
#ifdef HAVE_GTK3
popup_widget_loop (1, menu);
}
- unbind_to (specpdl_count, Qnil);
+ dynwind_end ();
/* Must reset this manually because the button release event is not passed
to Emacs event loop. */
{
int fact = 4 * sizeof (LWLIB_ID);
- ptrdiff_t specpdl_count = SPECPDL_INDEX ();
+ dynwind_begin ();
record_unwind_protect (pop_down_menu,
Fcons (make_number (menu_id >> (fact)),
make_number (menu_id & ~(-1 << (fact)))));
/* Process events that apply to the menu. */
popup_get_selection (0, FRAME_DISPLAY_INFO (f), menu_id, 1);
- unbind_to (specpdl_count, Qnil);
+ dynwind_end ();
}
}
int first_pane;
- ptrdiff_t specpdl_count = SPECPDL_INDEX ();
+ dynwind_begin ();
eassert (FRAME_X_P (f));
if (menu_items_used <= MENU_ITEMS_PANE_LENGTH)
{
*error_name = "Empty menu";
+ dynwind_end ();
return Qnil;
}
create_and_show_popup_menu (f, first_wv, x, y,
menuflags & MENU_FOR_CLICK);
- unbind_to (specpdl_count, Qnil);
+ dynwind_end ();
/* Find the selected item, and its pane, to return
the proper value. */
if (menu)
{
- ptrdiff_t specpdl_count = SPECPDL_INDEX ();
+ dynwind_begin ();
record_unwind_protect_ptr (pop_down_menu, menu);
/* Display the menu. */
/* Process events that apply to the menu. */
popup_widget_loop (1, menu);
- unbind_to (specpdl_count, Qnil);
+ dynwind_end ();
}
}
/* Process events that apply to the dialog box.
Also handle timers. */
{
- ptrdiff_t count = SPECPDL_INDEX ();
+ dynwind_begin ();
int fact = 4 * sizeof (LWLIB_ID);
/* xdialog_show_unwind is responsible for popping the dialog box down. */
popup_get_selection (0, FRAME_DISPLAY_INFO (f), dialog_id, 1);
- unbind_to (count, Qnil);
+ dynwind_end ();
}
}
/* 1 means we've seen the boundary between left-hand elts and right-hand. */
int boundary_seen = 0;
- ptrdiff_t specpdl_count = SPECPDL_INDEX ();
+ dynwind_begin ();
eassert (FRAME_X_P (f));
if (menu_items_n_panes > 1)
{
*error_name = "Multiple panes in dialog box";
+ dynwind_end ();
return Qnil;
}
{
free_menubar_widget_value_tree (first_wv);
*error_name = "Submenu in dialog items";
+ dynwind_end ();
return Qnil;
}
if (EQ (item_name, Qquote))
{
free_menubar_widget_value_tree (first_wv);
*error_name = "Too many dialog items";
+ dynwind_end ();
return Qnil;
}
/* Actually create and show the dialog. */
create_and_show_dialog (f, first_wv);
- unbind_to (specpdl_count, Qnil);
+ dynwind_end ();
/* Find the selected item, and its pane, to return
the proper value. */
int maxwidth;
int dummy_int;
unsigned int dummy_uint;
- ptrdiff_t specpdl_count = SPECPDL_INDEX ();
+ dynwind_begin ();
eassert (FRAME_X_P (f) || FRAME_MSDOS_P (f));
*error_name = 0;
- if (menu_items_n_panes == 0)
+ if (menu_items_n_panes == 0) {
+ dynwind_end ();
return Qnil;
+ }
if (menu_items_used <= MENU_ITEMS_PANE_LENGTH)
{
*error_name = "Empty menu";
+ dynwind_end ();
return Qnil;
}
{
*error_name = "Can't create menu";
unblock_input ();
+ dynwind_end ();
return Qnil;
}
XMenuDestroy (FRAME_X_DISPLAY (f), menu);
*error_name = "Can't create pane";
unblock_input ();
+ dynwind_end ();
return Qnil;
}
i += MENU_ITEMS_PANE_LENGTH;
XMenuDestroy (FRAME_X_DISPLAY (f), menu);
*error_name = "Can't add selection to menu";
unblock_input ();
+ dynwind_end ();
return Qnil;
}
i += MENU_ITEMS_ITEM_LENGTH;
}
unblock_input ();
- unbind_to (specpdl_count, Qnil);
+ dynwind_end ();
return entry;
}
/* 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. */
- ptrdiff_t count = SPECPDL_INDEX ();
+ dynwind_begin ();
specbind (Qinhibit_quit, Qt);
CHECK_SYMBOL (target_type);
XCAR (XCDR (local_value)));
else
value = Qnil;
- unbind_to (count, Qnil);
+ dynwind_end ();
}
/* Make sure this value is of a type that we could transmit
Window window = SELECTION_EVENT_REQUESTOR (event);
ptrdiff_t bytes_remaining;
int max_bytes = selection_quantum (display);
- ptrdiff_t count = SPECPDL_INDEX ();
+ dynwind_begin ();
struct selection_data *cs;
reply->type = SelectionNotify;
and then BLOCK again because x_uncatch_errors requires it. */
block_input ();
/* This calls x_uncatch_errors. */
- unbind_to (count, Qnil);
+ dynwind_end ();
unblock_input ();
}
\f
Atom property = SELECTION_EVENT_PROPERTY (event);
Lisp_Object local_selection_data;
int success = 0;
- ptrdiff_t count = SPECPDL_INDEX ();
+ dynwind_begin ();
GCPRO2 (local_selection_data, target_symbol);
if (!dpyinfo) goto DONE;
Frun_hook_with_args (4, args);
}
- unbind_to (count, Qnil);
+ dynwind_end ();
UNGCPRO;
}
static void
wait_for_property_change (struct prop_location *location)
{
- ptrdiff_t count = SPECPDL_INDEX ();
+ dynwind_begin ();
if (property_change_reply_object)
emacs_abort ();
}
}
- unbind_to (count, Qnil);
+ dynwind_end ();
}
/* Called from XTread_socket in response to a PropertyNotify event. */
{
Lisp_Object frame;
XSETFRAME (frame, f);
- RETURN_UNGCPRO (x_get_foreign_selection (selection_symbol, target_type,
- time_stamp, frame));
+ return x_get_foreign_selection (selection_symbol, target_type, time_stamp, frame);
}
if (CONSP (val) && SYMBOLP (XCAR (val)))
if (CONSP (val) && NILP (XCDR (val)))
val = XCAR (val);
}
- RETURN_UNGCPRO (clean_local_selection_data (val));
+ return clean_local_selection_data (val);
}
DEFUN ("x-disown-selection-internal", Fx_disown_selection_internal,
{
struct x_display_info *dpyinfo = x_display_info_for_display (dpy);
Lisp_Object frame, tail;
- ptrdiff_t idx = SPECPDL_INDEX ();
+ dynwind_begin ();
error_msg = alloca (strlen (error_message) + 1);
strcpy (error_msg, error_message);
totally_unblock_input ();
- unbind_to (idx, Qnil);
+ dynwind_end ();
clear_waiting_for_input ();
/* Tell GCC not to suggest attribute 'noreturn' for this function. */