Mercurial > emacs
comparison src/lread.c @ 82907:92ccd83174e6
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
author | Miles Bader <miles@gnu.org> |
---|---|
date | Mon, 27 Aug 2007 04:00:19 +0000 |
parents | e5a68f18fcb9 52977b7fd128 |
children | 27d11c1d4e46 b83d0dadb2a7 |
comparison
equal
deleted
inserted
replaced
82906:69b183268e31 | 82907:92ccd83174e6 |
---|---|
191 /* Nonzero means inside a new-style backquote | 191 /* Nonzero means inside a new-style backquote |
192 with no surrounding parentheses. | 192 with no surrounding parentheses. |
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. */ |
195 static int new_backquote_flag; | 195 static int new_backquote_flag; |
196 static 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. */ |
199 | 200 |
200 static Lisp_Object Vloads_in_progress; | 201 static Lisp_Object Vloads_in_progress; |
696 Lisp_Object data; | 697 Lisp_Object data; |
697 { | 698 { |
698 return Qnil; | 699 return Qnil; |
699 } | 700 } |
700 | 701 |
702 static Lisp_Object | |
703 load_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 | |
701 DEFUN ("get-load-suffixes", Fget_load_suffixes, Sget_load_suffixes, 0, 0, 0, | 716 DEFUN ("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 \ |
703 required. | 718 required. |
704 This uses the variables `load-suffixes' and `load-file-rep-suffixes'. */) | 719 This uses the variables `load-suffixes' and `load-file-rep-suffixes'. */) |
705 () | 720 () |
760 Lisp_Object file, noerror, nomessage, nosuffix, must_suffix; | 775 Lisp_Object file, noerror, nomessage, nosuffix, must_suffix; |
761 { | 776 { |
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. */ |
769 int newer = 0; | 783 int newer = 0; |
770 /* 1 means we are loading a compiled file. */ | 784 /* 1 means we are loading a compiled file. */ |
893 hist_file_name = (! NILP (Vpurify_flag) | 907 hist_file_name = (! NILP (Vpurify_flag) |
894 ? Fconcat (2, (tmp[0] = Ffile_name_directory (file), | 908 ? Fconcat (2, (tmp[0] = Ffile_name_directory (file), |
895 tmp[1] = Ffile_name_nondirectory (found), | 909 tmp[1] = Ffile_name_nondirectory (found), |
896 tmp)) | 910 tmp)) |
897 : found) ; | 911 : found) ; |
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); | |
898 | 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 |
902 remote and have no handler! */ | 920 remote and have no handler! */ |
1379 information. */ | 1397 information. */ |
1380 | 1398 |
1381 static void | 1399 static void |
1382 end_of_file_error () | 1400 end_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 |
1389 xsignal0 (Qend_of_file); | 1405 xsignal0 (Qend_of_file); |
1390 } | 1406 } |
2441 return Fcons (Qquote, Fcons (read0 (readcharfun), Qnil)); | 2457 return Fcons (Qquote, Fcons (read0 (readcharfun), Qnil)); |
2442 } | 2458 } |
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; |
2450 | 2469 |
2451 new_backquote_flag++; | 2470 new_backquote_flag++; |
2476 value = read0 (readcharfun); | 2495 value = read0 (readcharfun); |
2477 new_backquote_flag++; | 2496 new_backquote_flag++; |
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 { |
2485 int discard; | 2507 int discard; |
2486 int next_char; | 2508 int next_char; |
4189 | 4211 |
4190 DEFVAR_LISP ("eval-buffer-list", &Veval_buffer_list, | 4212 DEFVAR_LISP ("eval-buffer-list", &Veval_buffer_list, |
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; |
4197 staticpro (&load_descriptor_list); | 4225 staticpro (&load_descriptor_list); |
4198 | 4226 |