diff options
| author | Stefan Monnier | 2007-08-22 16:46:45 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2007-08-22 16:46:45 +0000 |
| commit | 1d06469794a66d6c8b424e6f17da029ebc5bb295 (patch) | |
| tree | dbf1412add2b3f1aac35fa757210a9872c872877 /src | |
| parent | 5772ed4bf34e2c64ccb2a7699a1769072a263c18 (diff) | |
| download | emacs-1d06469794a66d6c8b424e6f17da029ebc5bb295.tar.gz emacs-1d06469794a66d6c8b424e6f17da029ebc5bb295.zip | |
(Qold_style_backquotes): New var.
(syms_of_lread): Init and staticpro it.
(load_warn_old_style_backquotes): New fun.
(Fload): Use them to warn about old style backquotes.
(end_of_file_error, Fload): Remove unused vars.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 6 | ||||
| -rw-r--r-- | src/lread.c | 25 |
2 files changed, 27 insertions, 4 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index b0a6698a7cb..b2d065e13fb 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,5 +1,11 @@ | |||
| 1 | 2007-08-22 Stefan Monnier <monnier@iro.umontreal.ca> | 1 | 2007-08-22 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 2 | ||
| 3 | * lread.c (Qold_style_backquotes): New var. | ||
| 4 | (syms_of_lread): Init and staticpro it. | ||
| 5 | (load_warn_old_style_backquotes): New fun. | ||
| 6 | (Fload): Use them to warn about old style backquotes. | ||
| 7 | (end_of_file_error, Fload): Remove unused vars. | ||
| 8 | |||
| 3 | * lisp.h (Fclear_face_cache, Fx_send_client_event): Declare. | 9 | * lisp.h (Fclear_face_cache, Fx_send_client_event): Declare. |
| 4 | 10 | ||
| 5 | * lread.c (Vold_style_backquotes): New var. | 11 | * lread.c (Vold_style_backquotes): New var. |
diff --git a/src/lread.c b/src/lread.c index 02abed1ca99..20eafbcd5ee 100644 --- a/src/lread.c +++ b/src/lread.c | |||
| @@ -193,7 +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. */ |
| 195 | static int new_backquote_flag; | 195 | static int new_backquote_flag; |
| 196 | static Lisp_Object Vold_style_backquotes; | 196 | static Lisp_Object Vold_style_backquotes, Qold_style_backquotes; |
| 197 | 197 | ||
| 198 | /* 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 |
| 199 | check for recursive loads. */ | 199 | check for recursive loads. */ |
| @@ -699,6 +699,20 @@ load_error_handler (data) | |||
| 699 | return Qnil; | 699 | return Qnil; |
| 700 | } | 700 | } |
| 701 | 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[1]; | ||
| 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 | |||
| 702 | 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, |
| 703 | 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 \ |
| 704 | required. | 718 | required. |
| @@ -763,7 +777,6 @@ Return t if the file exists and loads successfully. */) | |||
| 763 | register FILE *stream; | 777 | register FILE *stream; |
| 764 | register int fd = -1; | 778 | register int fd = -1; |
| 765 | int count = SPECPDL_INDEX (); | 779 | int count = SPECPDL_INDEX (); |
| 766 | Lisp_Object temp; | ||
| 767 | struct gcpro gcpro1, gcpro2, gcpro3; | 780 | struct gcpro gcpro1, gcpro2, gcpro3; |
| 768 | Lisp_Object found, efound, hist_file_name; | 781 | Lisp_Object found, efound, hist_file_name; |
| 769 | /* 1 means we printed the ".el is newer" message. */ | 782 | /* 1 means we printed the ".el is newer" message. */ |
| @@ -897,6 +910,10 @@ Return t if the file exists and loads successfully. */) | |||
| 897 | tmp)) | 910 | tmp)) |
| 898 | : found) ; | 911 | : found) ; |
| 899 | 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 | |||
| 900 | if (!bcmp (SDATA (found) + SBYTES (found) - 4, | 917 | if (!bcmp (SDATA (found) + SBYTES (found) - 4, |
| 901 | ".elc", 4)) | 918 | ".elc", 4)) |
| 902 | /* Load .elc files directly, but not when they are | 919 | /* Load .elc files directly, but not when they are |
| @@ -1382,8 +1399,6 @@ readevalloop_1 (old) | |||
| 1382 | static void | 1399 | static void |
| 1383 | end_of_file_error () | 1400 | end_of_file_error () |
| 1384 | { | 1401 | { |
| 1385 | Lisp_Object data; | ||
| 1386 | |||
| 1387 | if (STRINGP (Vload_file_name)) | 1402 | if (STRINGP (Vload_file_name)) |
| 1388 | xsignal1 (Qend_of_file, Vload_file_name); | 1403 | xsignal1 (Qend_of_file, Vload_file_name); |
| 1389 | 1404 | ||
| @@ -4198,6 +4213,8 @@ to load. See also `load-dangerous-libraries'. */); | |||
| 4198 | DEFVAR_LISP ("old-style-backquotes", &Vold_style_backquotes, | 4213 | DEFVAR_LISP ("old-style-backquotes", &Vold_style_backquotes, |
| 4199 | doc: /* Set to non-nil when `read' encounters an old-style backquote. */); | 4214 | doc: /* Set to non-nil when `read' encounters an old-style backquote. */); |
| 4200 | Vold_style_backquotes = Qnil; | 4215 | Vold_style_backquotes = Qnil; |
| 4216 | Qold_style_backquotes = intern ("old-style-backquotes"); | ||
| 4217 | staticpro (&Qold_style_backquotes); | ||
| 4201 | 4218 | ||
| 4202 | /* Vsource_directory was initialized in init_lread. */ | 4219 | /* Vsource_directory was initialized in init_lread. */ |
| 4203 | 4220 | ||