#include <sys/time.h>
#endif
-#ifdef NULL
-#undef NULL
-#endif
#include "config.h"
#include "lisp.h"
#include "buffer.h"
char *buf;
CHECK_STRING (file, 0);
- if (NULL (file))
+ if (NILP (file))
return Qnil;
buf = (char *) alloca (XSTRING (file)->size + 10);
return build_string (file_name_as_directory (buf, XSTRING (file)->data));
CHECK_STRING (directory, 0);
- if (NULL (directory))
+ if (NILP (directory))
return Qnil;
#ifdef VMS
/* 20 extra chars is insufficient for VMS, since we might perform a
#endif /* not VMS */
&& !newdir)
{
- if (NULL (defalt))
+ if (NILP (defalt))
defalt = current_buffer->directory;
CHECK_STRING (defalt, 1);
newdir = XSTRING (defalt)->data;
#endif /* not VMS */
&& !newdir)
{
- if (NULL (defalt))
+ if (NILP (defalt))
defalt = current_buffer->directory;
CHECK_STRING (defalt, 1);
newdir = XSTRING (defalt)->data;
tem = do_yes_or_no_p (format1 ("File %s already exists; %s anyway? ",
XSTRING (absname)->data, querystring));
UNGCPRO;
- if (NULL (tem))
+ if (NILP (tem))
Fsignal (Qfile_already_exists,
Fcons (build_string ("File already exists"),
Fcons (absname, Qnil)));
CHECK_STRING (newname, 1);
filename = Fexpand_file_name (filename, Qnil);
newname = Fexpand_file_name (newname, Qnil);
- if (NULL (ok_if_already_exists)
+ if (NILP (ok_if_already_exists)
|| XTYPE (ok_if_already_exists) == Lisp_Int)
barf_or_query_if_file_exists (newname, "copy to it",
XTYPE (ok_if_already_exists) == Lisp_Int);
if (fstat (ifd, &st) >= 0)
{
#ifdef HAVE_TIMEVAL
- if (!NULL (keep_date))
+ if (!NILP (keep_date))
{
#ifdef USE_UTIME
/* AIX has utimes() in compatibility package, but it dies. So use good old
CHECK_STRING (newname, 1);
filename = Fexpand_file_name (filename, Qnil);
newname = Fexpand_file_name (newname, Qnil);
- if (NULL (ok_if_already_exists)
+ if (NILP (ok_if_already_exists)
|| XTYPE (ok_if_already_exists) == Lisp_Int)
barf_or_query_if_file_exists (newname, "rename to it",
XTYPE (ok_if_already_exists) == Lisp_Int);
CHECK_STRING (newname, 1);
filename = Fexpand_file_name (filename, Qnil);
newname = Fexpand_file_name (newname, Qnil);
- if (NULL (ok_if_already_exists)
+ if (NILP (ok_if_already_exists)
|| XTYPE (ok_if_already_exists) == Lisp_Int)
barf_or_query_if_file_exists (newname, "make it a new name",
XTYPE (ok_if_already_exists) == Lisp_Int);
filename = Fexpand_file_name (filename, Qnil);
#endif
newname = Fexpand_file_name (newname, Qnil);
- if (NULL (ok_if_already_exists)
+ if (NILP (ok_if_already_exists)
|| XTYPE (ok_if_already_exists) == Lisp_Int)
barf_or_query_if_file_exists (newname, "make it a link",
XTYPE (ok_if_already_exists) == Lisp_Int);
Lisp_Object string;
{
CHECK_STRING (varname, 0);
- if (NULL (string))
+ if (NILP (string))
delete_logical_name (XSTRING (varname)->data);
else
{
return (access (XSTRING (abspath)->data, 2) >= 0) ? Qt : Qnil;
dir = Ffile_name_directory (abspath);
#ifdef VMS
- if (!NULL (dir))
+ if (!NILP (dir))
dir = Fdirectory_file_name (dir);
#endif /* VMS */
- return (access (!NULL (dir) ? (char *) XSTRING (dir)->data : "", 2) >= 0
+ return (access (!NILP (dir) ? (char *) XSTRING (dir)->data : "", 2) >= 0
? Qt : Qnil);
}
struct gcpro gcpro1;
GCPRO1 (filename);
- if (!NULL (current_buffer->read_only))
+ if (!NILP (current_buffer->read_only))
Fbarf_if_buffer_read_only();
CHECK_STRING (filename, 0);
#endif /* not APOLLO */
{
if (fd >= 0) close (fd);
- if (NULL (visit))
+ if (NILP (visit))
report_file_error ("Opening input file", Fcons (filename, Qnil));
st.st_mtime = -1;
how_much = 0;
error ("maximum buffer size exceeded");
}
- if (NULL (visit))
+ if (NILP (visit))
prepare_to_modify_buffer (point, point);
move_gap (point);
notfound:
- if (!NULL (visit))
+ if (!NILP (visit))
{
current_buffer->undo_list = Qnil;
#ifdef APOLLO
current_buffer->auto_save_modified = MODIFF;
XFASTINT (current_buffer->save_length) = Z - BEG;
#ifdef CLASH_DETECTION
- if (!NULL (current_buffer->filename))
+ if (!NILP (current_buffer->filename))
unlock_file (current_buffer->filename);
unlock_file (filename);
#endif /* CLASH_DETECTION */
#endif /* VMS */
/* Special kludge to simplify auto-saving */
- if (NULL (start))
+ if (NILP (start))
{
XFASTINT (start) = BEG;
XFASTINT (end) = Z;
#endif /* CLASH_DETECTION */
desc = -1;
- if (!NULL (append))
+ if (!NILP (append))
desc = open (fn, O_WRONLY);
if (desc < 0)
Lisp_Object temp_name;
temp_name = Ffile_name_directory (filename);
- if (!NULL (temp_name))
+ if (!NILP (temp_name))
{
temp_name = Fmake_temp_name (concat2 (temp_name,
build_string ("$$SAVE$$")));
record_unwind_protect (close_file_unwind, make_number (desc));
- if (!NULL (append))
+ if (!NILP (append))
if (lseek (desc, 0, 2) < 0)
{
#ifdef CLASH_DETECTION
XFASTINT (current_buffer->save_length) = Z - BEG;
current_buffer->filename = filename;
}
- else if (!NULL (visit))
+ else if (!NILP (visit))
return Qnil;
if (!auto_saving)
/* Vrun_hooks is nil before emacs is dumped, and inc-vers.el will
eventually call do-auto-save, so don't err here in that case. */
- if (!NULL (Vrun_hooks))
+ if (!NILP (Vrun_hooks))
call1 (Vrun_hooks, intern ("auto-save-hook"));
for (tail = Vbuffer_alist; XGCTYPE (tail) == Lisp_Cons;
continue;
}
set_buffer_internal (b);
- if (!auto_saved && NULL (nomsg))
+ if (!auto_saved && NILP (nomsg))
message1 ("Auto-saving...");
internal_condition_case (auto_save_1, Qt, auto_save_error);
auto_saved++;
if (auto_saved)
record_auto_save ();
- if (auto_saved && NULL (nomsg))
+ if (auto_saved && NILP (nomsg))
message1 (omessage ? omessage : "Auto-saving...done");
auto_saving = 0;
string = Fsubstitute_in_file_name (string);
name = Ffile_name_nondirectory (string);
realdir = Ffile_name_directory (string);
- if (NULL (realdir))
+ if (NILP (realdir))
realdir = dir;
else
realdir = Fexpand_file_name (realdir, dir);
}
- if (NULL (action))
+ if (NILP (action))
{
specdir = Ffile_name_directory (string);
val = Ffile_name_completion (name, realdir);
if (XTYPE (val) != Lisp_String)
{
- if (NULL (Fstring_equal (string, orig_string)))
+ if (NILP (Fstring_equal (string, orig_string)))
return string;
return (val);
}
- if (!NULL (specdir))
+ if (!NILP (specdir))
val = concat2 (specdir, val);
#ifndef VMS
{
register char *homedir;
int count;
- if (NULL (dir))
+ if (NILP (dir))
dir = current_buffer->directory;
- if (NULL (defalt))
+ if (NILP (defalt))
defalt = current_buffer->filename;
/* If dir starts with user's homedir, change that to ~. */
if (insert_default_directory)
{
insdef = dir;
- if (!NULL (initial))
+ if (!NILP (initial))
{
Lisp_Object args[2];
#endif
UNGCPRO;
- if (NULL (val))
+ if (NILP (val))
error ("No file name specified");
tem = Fstring_equal (val, insdef);
- if (!NULL (tem) && !NULL (defalt))
+ if (!NILP (tem) && !NILP (defalt))
return defalt;
return Fsubstitute_in_file_name (val);
}
register char *homedir;
int count;
- if (NULL (dir))
+ if (NILP (dir))
dir = current_buffer->directory;
- if (NULL (defalt))
+ if (NILP (defalt))
defalt = current_buffer->filename;
/* If dir starts with user's homedir, change that to ~. */
XSTRING (dir)->data[0] = '~';
}
- if (!NULL (initial))
+ if (!NILP (initial))
insdef = initial;
else if (insert_default_directory)
insdef = dir;
#endif
UNGCPRO;
- if (NULL (val))
+ if (NILP (val))
error ("No file name specified");
tem = Fstring_equal (val, insdef);
- if (!NULL (tem) && !NULL (defalt))
+ if (!NILP (tem) && !NILP (defalt))
return defalt;
return Fsubstitute_in_file_name (val);
}