/* Lisp parsing and input streams.
Copyright (C) 1985, 1986, 1987, 1988, 1989, 1993, 1994, 1995,
1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
- 2005, 2006, 2007 Free Software Foundation, Inc.
+ 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
This file is part of GNU Emacs.
Fread initializes this to zero, so we need not specbind it
or worry about what happens to it when there is an error. */
static int new_backquote_flag;
-static Lisp_Object Vold_style_backquotes;
+static Lisp_Object Vold_style_backquotes, Qold_style_backquotes;
/* A list of file names for files being loaded in Fload. Used to
check for recursive loads. */
\f
-/* Value is non-zero if the file asswociated with file descriptor FD
+/* Value is non-zero if the file associated with file descriptor FD
is a compiled Lisp file that's safe to load. Only files compiled
with Emacs are safe to load. Files compiled with XEmacs can lead
to a crash in Fbyte_code because of an incompatible change in the
return Qnil;
}
+static Lisp_Object
+load_warn_old_style_backquotes (file)
+ Lisp_Object file;
+{
+ if (!NILP (Vold_style_backquotes))
+ {
+ Lisp_Object args[2];
+ args[0] = build_string ("!! File %s uses old-style backquotes !!");
+ args[1] = file;
+ Fmessage (2, args);
+ }
+ return Qnil;
+}
+
DEFUN ("get-load-suffixes", Fget_load_suffixes, Sget_load_suffixes, 0, 0, 0,
doc: /* Return the suffixes that `load' should try if a suffix is \
required.
doc: /* Execute a file of Lisp code named FILE.
First try FILE with `.elc' appended, then try with `.el',
then try FILE unmodified (the exact suffixes in the exact order are
-determined by `load-suffixes'). Environment variable references in
+determined by `load-suffixes'). Environment variable references in
FILE are replaced with their values by calling `substitute-in-file-name'.
This function searches the directories in `load-path'.
register FILE *stream;
register int fd = -1;
int count = SPECPDL_INDEX ();
- Lisp_Object temp;
struct gcpro gcpro1, gcpro2, gcpro3;
Lisp_Object found, efound, hist_file_name;
/* 1 means we printed the ".el is newer" message. */
tmp))
: found) ;
+ /* Check for the presence of old-style quotes and warn about them. */
+ specbind (Qold_style_backquotes, Qnil);
+ record_unwind_protect (load_warn_old_style_backquotes, file);
+
if (!bcmp (SDATA (found) + SBYTES (found) - 4,
".elc", 4))
/* Load .elc files directly, but not when they are
static void
end_of_file_error ()
{
- Lisp_Object data;
-
if (STRINGP (Vload_file_name))
xsignal1 (Qend_of_file, Vload_file_name);
Vload_path = Fcons (tem, Vload_path);
}
- /* Add site-list under the installation dir, if it exists. */
+ /* Add site-lisp under the installation dir, if it exists. */
tem = Fexpand_file_name (build_string ("site-lisp"),
Vinstallation_directory);
tem1 = Ffile_exists_p (tem);
/* NORMAL refers to the lisp dir in the source directory. */
/* We used to add ../lisp at the front here, but
that caused trouble because it was copied from dump_path
- into Vload_path, aboe, when Vinstallation_directory was non-nil.
+ into Vload_path, above, when Vinstallation_directory was non-nil.
It should be unnecessary. */
Vload_path = decode_env_path (0, normal);
dump_path = Vload_path;
}
/* Print a warning, using format string FORMAT, that directory DIRNAME
- does not exist. Print it on stderr and put it in *Message*. */
+ does not exist. Print it on stderr and put it in *Messages*. */
void
dir_warning (format, dirname)
doc: /* List of buffers being read from by calls to `eval-buffer' and `eval-region'. */);
Veval_buffer_list = Qnil;
+ DEFVAR_LISP ("old-style-backquotes", &Vold_style_backquotes,
+ doc: /* Set to non-nil when `read' encounters an old-style backquote. */);
+ Vold_style_backquotes = Qnil;
+ Qold_style_backquotes = intern ("old-style-backquotes");
+ staticpro (&Qold_style_backquotes);
+
/* Vsource_directory was initialized in init_lread. */
load_descriptor_list = Qnil;
Vloads_in_progress = Qnil;
staticpro (&Vloads_in_progress);
-
- Vold_style_backquotes = Qnil;
- staticpro (&Vold_style_backquotes);
}
/* arch-tag: a0d02733-0f96-4844-a659-9fd53c4f414d