aboutsummaryrefslogtreecommitdiffstats
path: root/src/lread.c
diff options
context:
space:
mode:
authorMiles Bader2007-08-27 04:00:19 +0000
committerMiles Bader2007-08-27 04:00:19 +0000
commit7f22a76506a3f3db2eb4bce1cfc49105bd8d0824 (patch)
tree02ffae400506ae46fcf03eacaa5210aac7fe57de /src/lread.c
parentd53a60a6f76043ba9fb395eece2aaccc67a0d1b2 (diff)
parent619fb9ee822da1d92d8b7974b827dac6a918967f (diff)
downloademacs-7f22a76506a3f3db2eb4bce1cfc49105bd8d0824.tar.gz
emacs-7f22a76506a3f3db2eb4bce1cfc49105bd8d0824.zip
Merge from emacs--rel--22
Patches applied: * emacs--rel--22 (patch 97-100) - Update from CVS - Merge from gnus--rel--5.10 * gnus--rel--5.10 (patch 246-247) - Update from CVS Revision: emacs@sv.gnu.org/emacs--devo--0--patch-860
Diffstat (limited to 'src/lread.c')
-rw-r--r--src/lread.c38
1 files changed, 33 insertions, 5 deletions
diff --git a/src/lread.c b/src/lread.c
index 282bf1d6b07..a67fff1fc92 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -193,6 +193,7 @@ static file_offset prev_saved_doc_string_position;
193 Fread initializes this to zero, so we need not specbind it 193 Fread initializes this to zero, so we need not specbind it
194 or worry about what happens to it when there is an error. */ 194 or worry about what happens to it when there is an error. */
195static int new_backquote_flag; 195static int new_backquote_flag;
196static Lisp_Object Vold_style_backquotes, Qold_style_backquotes;
196 197
197/* A list of file names for files being loaded in Fload. Used to 198/* A list of file names for files being loaded in Fload. Used to
198 check for recursive loads. */ 199 check for recursive loads. */
@@ -698,6 +699,20 @@ load_error_handler (data)
698 return Qnil; 699 return Qnil;
699} 700}
700 701
702static Lisp_Object
703load_warn_old_style_backquotes (file)
704 Lisp_Object file;
705{
706 if (!NILP (Vold_style_backquotes))
707 {
708 Lisp_Object args[2];
709 args[0] = build_string ("!! File %s uses old-style backquotes !!");
710 args[1] = file;
711 Fmessage (2, args);
712 }
713 return Qnil;
714}
715
701DEFUN ("get-load-suffixes", Fget_load_suffixes, Sget_load_suffixes, 0, 0, 0, 716DEFUN ("get-load-suffixes", Fget_load_suffixes, Sget_load_suffixes, 0, 0, 0,
702 doc: /* Return the suffixes that `load' should try if a suffix is \ 717 doc: /* Return the suffixes that `load' should try if a suffix is \
703required. 718required.
@@ -762,7 +777,6 @@ Return t if the file exists and loads successfully. */)
762 register FILE *stream; 777 register FILE *stream;
763 register int fd = -1; 778 register int fd = -1;
764 int count = SPECPDL_INDEX (); 779 int count = SPECPDL_INDEX ();
765 Lisp_Object temp;
766 struct gcpro gcpro1, gcpro2, gcpro3; 780 struct gcpro gcpro1, gcpro2, gcpro3;
767 Lisp_Object found, efound, hist_file_name; 781 Lisp_Object found, efound, hist_file_name;
768 /* 1 means we printed the ".el is newer" message. */ 782 /* 1 means we printed the ".el is newer" message. */
@@ -896,6 +910,10 @@ Return t if the file exists and loads successfully. */)
896 tmp)) 910 tmp))
897 : found) ; 911 : found) ;
898 912
913 /* Check fore the presence of old-style quotes and warn about them. */
914 specbind (Qold_style_backquotes, Qnil);
915 record_unwind_protect (load_warn_old_style_backquotes, file);
916
899 if (!bcmp (SDATA (found) + SBYTES (found) - 4, 917 if (!bcmp (SDATA (found) + SBYTES (found) - 4,
900 ".elc", 4)) 918 ".elc", 4))
901 /* Load .elc files directly, but not when they are 919 /* Load .elc files directly, but not when they are
@@ -1381,8 +1399,6 @@ readevalloop_1 (old)
1381static void 1399static void
1382end_of_file_error () 1400end_of_file_error ()
1383{ 1401{
1384 Lisp_Object data;
1385
1386 if (STRINGP (Vload_file_name)) 1402 if (STRINGP (Vload_file_name))
1387 xsignal1 (Qend_of_file, Vload_file_name); 1403 xsignal1 (Qend_of_file, Vload_file_name);
1388 1404
@@ -2443,7 +2459,10 @@ read1 (readcharfun, pch, first_in_list)
2443 2459
2444 case '`': 2460 case '`':
2445 if (first_in_list) 2461 if (first_in_list)
2446 goto default_label; 2462 {
2463 Vold_style_backquotes = Qt;
2464 goto default_label;
2465 }
2447 else 2466 else
2448 { 2467 {
2449 Lisp_Object value; 2468 Lisp_Object value;
@@ -2478,7 +2497,10 @@ read1 (readcharfun, pch, first_in_list)
2478 return Fcons (comma_type, Fcons (value, Qnil)); 2497 return Fcons (comma_type, Fcons (value, Qnil));
2479 } 2498 }
2480 else 2499 else
2481 goto default_label; 2500 {
2501 Vold_style_backquotes = Qt;
2502 goto default_label;
2503 }
2482 2504
2483 case '?': 2505 case '?':
2484 { 2506 {
@@ -4191,6 +4213,12 @@ to load. See also `load-dangerous-libraries'. */);
4191 doc: /* List of buffers being read from by calls to `eval-buffer' and `eval-region'. */); 4213 doc: /* List of buffers being read from by calls to `eval-buffer' and `eval-region'. */);
4192 Veval_buffer_list = Qnil; 4214 Veval_buffer_list = Qnil;
4193 4215
4216 DEFVAR_LISP ("old-style-backquotes", &Vold_style_backquotes,
4217 doc: /* Set to non-nil when `read' encounters an old-style backquote. */);
4218 Vold_style_backquotes = Qnil;
4219 Qold_style_backquotes = intern ("old-style-backquotes");
4220 staticpro (&Qold_style_backquotes);
4221
4194 /* Vsource_directory was initialized in init_lread. */ 4222 /* Vsource_directory was initialized in init_lread. */
4195 4223
4196 load_descriptor_list = Qnil; 4224 load_descriptor_list = Qnil;