/* File IO for GNU Emacs.
Copyright (C) 1985, 1986, 1987, 1988, 1993, 1994, 1995, 1996,
1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
- 2005, 2006 Free Software Foundation, Inc.
+ 2005, 2006, 2007 Free Software Foundation, Inc.
This file is part of GNU Emacs.
if (NILP (ok_if_already_exists)
|| INTEGERP (ok_if_already_exists))
- barf_or_query_if_file_exists (encoded_newname, "copy to it",
+ barf_or_query_if_file_exists (newname, "copy to it",
INTEGERP (ok_if_already_exists), &out_st, 0);
else if (stat (SDATA (encoded_newname), &out_st) < 0)
out_st.st_mode = 0;
#endif
if (NILP (ok_if_already_exists)
|| INTEGERP (ok_if_already_exists))
- barf_or_query_if_file_exists (encoded_newname, "rename to it",
+ barf_or_query_if_file_exists (newname, "rename to it",
INTEGERP (ok_if_already_exists), 0, 0);
#ifndef BSD4_1
if (0 > rename (SDATA (encoded_file), SDATA (encoded_newname)))
if (NILP (ok_if_already_exists)
|| INTEGERP (ok_if_already_exists))
- barf_or_query_if_file_exists (encoded_newname, "make it a new name",
+ barf_or_query_if_file_exists (newname, "make it a new name",
INTEGERP (ok_if_already_exists), 0, 0);
unlink (SDATA (newname));
if (NILP (ok_if_already_exists)
|| INTEGERP (ok_if_already_exists))
- barf_or_query_if_file_exists (encoded_linkname, "make it a link",
+ barf_or_query_if_file_exists (linkname, "make it a link",
INTEGERP (ok_if_already_exists), 0, 0);
if (0 > symlink (SDATA (encoded_filename),
SDATA (encoded_linkname)))
FILE *stream = (FILE *) XSAVE_VALUE (arg)->pointer;
auto_saving = 0;
if (stream != NULL)
- fclose (stream);
+ {
+ BLOCK_INPUT;
+ fclose (stream);
+ UNBLOCK_INPUT;
+ }
return Qnil;
}
if (STRINGP (b->auto_save_file_name)
&& stream != NULL && do_handled_files == 0)
{
+ BLOCK_INPUT;
if (!NILP (b->filename))
{
fwrite (SDATA (b->filename), 1,
fwrite (SDATA (b->auto_save_file_name), 1,
SBYTES (b->auto_save_file_name), stream);
putc ('\n', stream);
+ UNBLOCK_INPUT;
}
if (!NILP (current_only)
if (NILP (action))
{
specdir = Ffile_name_directory (string);
- val = Ffile_name_completion (name, realdir);
+ val = Ffile_name_completion (name, realdir, Vread_file_name_predicate);
UNGCPRO;
if (!STRINGP (val))
{
if (! replace_in_history)
add_to_history = 1;
- val = empty_string;
+ val = empty_unibyte_string;
}
unbind_to (count, Qnil);
DEFVAR_LISP ("after-insert-file-functions", &Vafter_insert_file_functions,
doc: /* A list of functions to be called at the end of `insert-file-contents'.
-Each is passed one argument, the number of characters inserted.
-It should return the new character count, and leave point the same.
+Each is passed one argument, the number of characters inserted,
+with point at the start of the inserted text. Each function
+should leave point the same, and return the new character count.
If `insert-file-contents' is intercepted by a handler from
`file-name-handler-alist', that handler is responsible for calling the
functions in `after-insert-file-functions' if appropriate. */);