#endif /* not DOS_NT */
)
{
- struct gcpro gcpro1;
-
- GCPRO1 (name);
default_directory = Fexpand_file_name (default_directory, Qnil);
- UNGCPRO;
}
}
multibyte = STRING_MULTIBYTE (name);
{
Lisp_Object tem, encoded_filename;
struct stat statbuf;
- struct gcpro gcpro1;
encoded_filename = ENCODE_FILE (absname);
if (! interactive)
xsignal2 (Qfile_already_exists,
build_string ("File already exists"), absname);
- GCPRO1 (absname);
AUTO_STRING (format, "File %s already exists; %s anyway? ");
tem = CALLN (Fformat, format, absname, build_string (querystring));
if (quick)
tem = call1 (intern ("y-or-n-p"), tem);
else
tem = do_yes_or_no_p (tem);
- UNGCPRO;
if (NILP (tem))
xsignal2 (Qfile_already_exists,
build_string ("File already exists"), absname);
Lisp_Object preserve_permissions)
{
Lisp_Object handler;
- struct gcpro gcpro1, gcpro2, gcpro3, gcpro4;
ptrdiff_t count = SPECPDL_INDEX ();
Lisp_Object encoded_file, encoded_newname;
#if HAVE_LIBSELINUX
#endif
encoded_file = encoded_newname = Qnil;
- GCPRO4 (file, newname, encoded_file, encoded_newname);
CHECK_STRING (file);
CHECK_STRING (newname);
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));
+ 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);
/* Discard the unwind protects. */
specpdl_ptr = specpdl + count;
- UNGCPRO;
return Qnil;
}
\f
{
Lisp_Object handler;
Lisp_Object encoded_file;
- struct gcpro gcpro1;
- GCPRO1 (filename);
if (!NILP (Ffile_directory_p (filename))
&& NILP (Ffile_symlink_p (filename)))
xsignal2 (Qfile_error,
build_string ("Removing old name: is a directory"),
filename);
- UNGCPRO;
filename = Fexpand_file_name (filename, Qnil);
handler = Ffind_file_name_handler (filename, Qdelete_file);
(Lisp_Object file, Lisp_Object newname, Lisp_Object ok_if_already_exists)
{
Lisp_Object handler;
- struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5;
Lisp_Object encoded_file, encoded_newname, symlink_target;
symlink_target = encoded_file = encoded_newname = Qnil;
- GCPRO5 (file, newname, encoded_file, encoded_newname, symlink_target);
CHECK_STRING (file);
CHECK_STRING (newname);
file = Fexpand_file_name (file, 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);
else
report_file_errno ("Renaming", list2 (file, newname), rename_errno);
}
- UNGCPRO;
+
return Qnil;
}
{
Lisp_Object handler;
Lisp_Object encoded_file, encoded_newname;
- struct gcpro gcpro1, gcpro2, gcpro3, gcpro4;
- GCPRO4 (file, newname, encoded_file, encoded_newname);
encoded_file = encoded_newname = Qnil;
CHECK_STRING (file);
CHECK_STRING (newname);
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);
report_file_errno ("Adding new name", list2 (file, newname), link_errno);
}
- UNGCPRO;
return Qnil;
}
{
Lisp_Object handler;
Lisp_Object encoded_target, encoded_linkname;
- struct gcpro gcpro1, gcpro2, gcpro3, gcpro4;
- GCPRO4 (target, linkname, encoded_target, encoded_linkname);
encoded_target = encoded_linkname = Qnil;
CHECK_STRING (target);
CHECK_STRING (linkname);
call the corresponding file handler. */
handler = Ffind_file_name_handler (target, Qmake_symbolic_link);
if (!NILP (handler))
- RETURN_UNGCPRO (call4 (handler, Qmake_symbolic_link, target,
- linkname, ok_if_already_exists));
+ return call4 (handler, Qmake_symbolic_link, target,
+ 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, target,
- linkname, ok_if_already_exists));
+ return call4 (handler, Qmake_symbolic_link, target,
+ linkname, ok_if_already_exists);
encoded_target = ENCODE_FILE (target);
encoded_linkname = ENCODE_FILE (linkname);
unlink (SSDATA (encoded_linkname));
if (symlink (SSDATA (encoded_target), SSDATA (encoded_linkname))
>= 0)
- {
- UNGCPRO;
- return Qnil;
- }
+ return Qnil;
}
if (errno == ENOSYS)
- {
- UNGCPRO;
- xsignal1 (Qfile_error,
- build_string ("Symbolic links are not supported"));
- }
+ xsignal1 (Qfile_error,
+ build_string ("Symbolic links are not supported"));
symlink_errno = errno;
report_file_errno ("Making symbolic link", list2 (target, linkname),
symlink_errno);
}
- UNGCPRO;
+
return Qnil;
}
Lisp_Object absname1, absname2;
struct stat st1, st2;
Lisp_Object handler;
- struct gcpro gcpro1, gcpro2;
CHECK_STRING (file1);
CHECK_STRING (file2);
absname1 = Qnil;
- GCPRO2 (absname1, file2);
absname1 = expand_and_dir_to_file (file1, BVAR (current_buffer, directory));
absname2 = expand_and_dir_to_file (file2, BVAR (current_buffer, directory));
- UNGCPRO;
/* If the file name has special constructs in it,
call the corresponding file handler. */
if (!NILP (handler))
return call3 (handler, Qfile_newer_than_file_p, absname1, absname2);
- GCPRO2 (absname1, absname2);
absname1 = ENCODE_FILE (absname1);
absname2 = ENCODE_FILE (absname2);
- UNGCPRO;
if (stat (SSDATA (absname1), &st1) < 0)
return Qnil;
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;
ptrdiff_t total = 0;
orig_filename = Qnil;
old_undo = Qnil;
- GCPRO5 (filename, val, p, orig_filename, old_undo);
-
CHECK_STRING (filename);
filename = Fexpand_file_name (filename, Qnil);
bool multibyte
= ! NILP (BVAR (current_buffer, enable_multibyte_characters));
Lisp_Object conversion_buffer;
- struct gcpro gcpro1;
conversion_buffer = code_conversion_save (1, multibyte);
inserted = 0; /* Bytes put into CONVERSION_BUFFER so far. */
unprocessed = 0; /* Bytes not processed in previous loop. */
- GCPRO1 (conversion_buffer);
while (1)
{
/* Read at most READ_BUF_SIZE bytes at a time, to allow
if (coding.carryover_bytes > 0)
memcpy (read_buf, coding.carryover, unprocessed);
}
- UNGCPRO;
+
if (this < 0)
report_file_error ("Read error", orig_filename);
emacs_close (fd);
if (NILP (val))
val = list2 (orig_filename, make_number (inserted));
- RETURN_UNGCPRO (unbind_to (count, val));
+ return unbind_to (count, val);
}
\f
static Lisp_Object build_annotations (Lisp_Object, Lisp_Object);
bool visiting = (EQ (visit, Qt) || STRINGP (visit));
bool quietly = !NILP (visit);
bool file_locked = 0;
- struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5;
struct buffer *given_buffer;
struct coding_system coding;
validate_region (&start, &end);
visit_file = Qnil;
- GCPRO5 (start, filename, visit, visit_file, lockname);
filename = Fexpand_file_name (filename, Qnil);
XSETFASTINT (BVAR (current_buffer, save_length), Z - BEG);
bset_filename (current_buffer, visit_file);
}
- UNGCPRO;
+
return val;
}
XSETFASTINT (end, ZV);
}
- UNGCPRO;
-
- GCPRO5 (start, filename, annotations, visit_file, lockname);
-
/* Decide the coding-system to encode the data with.
We used to make this choice before calling build_annotations, but that
leads to problems when a write-annotate-function takes care of
int open_errno = errno;
if (file_locked)
unlock_file (lockname);
- UNGCPRO;
report_file_errno ("Opening output file", filename, open_errno);
}
int lseek_errno = errno;
if (file_locked)
unlock_file (lockname);
- UNGCPRO;
report_file_errno ("Lseek error", filename, lseek_errno);
}
}
- UNGCPRO;
-
immediate_quit = 1;
if (STRINGP (start))
{
Lisp_Object annotations;
Lisp_Object p, res;
- struct gcpro gcpro1, gcpro2;
Lisp_Object original_buffer;
int i;
bool used_global = false;
annotations = Qnil;
p = Vwrite_region_annotate_functions;
- GCPRO2 (annotations, p);
while (CONSP (p))
{
struct buffer *given_buffer = current_buffer;
annotations = merge (annotations, res, Qcar_less_than_car);
}
- UNGCPRO;
return annotations;
}
{
Lisp_Object msg;
int i;
- struct gcpro gcpro1;
auto_save_error_occurred = 1;
AUTO_STRING (format, "Auto-saving %s: %s");
msg = CALLN (Fformat, format, BVAR (current_buffer, name),
Ferror_message_string (error_val));
- GCPRO1 (msg);
for (i = 0; i < 3; ++i)
{
Fsleep_for (make_number (1), Qnil);
}
- UNGCPRO;
return Qnil;
}
bool orig_minibuffer_auto_raise = minibuffer_auto_raise;
bool old_message_p = 0;
struct auto_save_unwind auto_save_unwind;
- struct gcpro gcpro1, gcpro2;
if (max_specpdl_size < specpdl_size + 40)
max_specpdl_size = specpdl_size + 40;
oquit = Vquit_flag;
Vquit_flag = Qnil;
- /* No GCPRO needed, because (when it matters) all Lisp_Object variables
- point to non-strings reached from Vbuffer_alist. */
-
hook = intern ("auto-save-hook");
safe_run_hooks (hook);
if (!NILP (Vrun_hooks))
{
Lisp_Object dir;
- dir = Qnil;
- GCPRO2 (dir, listfile);
dir = Ffile_name_directory (listfile);
if (NILP (Ffile_directory_p (dir)))
internal_condition_case_1 (do_auto_save_make_dir,
dir, Qt,
do_auto_save_eh);
- UNGCPRO;
}
stream = emacs_fopen (SSDATA (listfile), "w");