/* 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.
GNU Emacs is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
+the Free Software Foundation; either version 3, or (at your option)
any later version.
GNU Emacs is distributed in the hope that it will be useful,
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)))
* if we do writes that don't end with a carriage return. Furthermore
* it cannot handle writes of more then 16K. The modified
* version of "sys_write" in SYSDEP.C (see comment there) copes with
- * this EXCEPT for the last record (iff it doesn't end with a carriage
+ * this EXCEPT for the last record (if it doesn't end with a carriage
* return). This implies that if your buffer doesn't end with a carriage
* return, you get one free... tough. However it also means that if
* we make two calls to sys_write (a la the following code) you can
See Info node `(elisp)Modification Time' for more details. */)
()
{
- Lisp_Object tcons;
- tcons = long_to_cons ((unsigned long) current_buffer->modtime);
- if (CONSP (tcons))
- return list2 (XCAR (tcons), XCDR (tcons));
- return tcons;
+ if (! current_buffer->modtime)
+ return make_number (0);
+ return make_time ((time_t) current_buffer->modtime);
}
DEFUN ("set-visited-file-modtime", Fset_visited_file_modtime,
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))
{