aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPhilipp Stephani2017-10-09 16:08:15 +0200
committerPhilipp Stephani2017-10-09 16:08:15 +0200
commit6abff55b5514515c5a28397b34aee478926af232 (patch)
treec7d722049149ad0182c86dc1ac20d72df74f4f7f /src
parent2c39565dc046d428127735552db6e7814631d4d4 (diff)
downloademacs-6abff55b5514515c5a28397b34aee478926af232.tar.gz
emacs-6abff55b5514515c5a28397b34aee478926af232.zip
Revert "Raise an error when detecting old-style backquotes."
This reverts commit 9613690f6e51e2f2aa2bcbbede3e209d08cfaaad.
Diffstat (limited to 'src')
-rw-r--r--src/lread.c32
1 files changed, 26 insertions, 6 deletions
diff --git a/src/lread.c b/src/lread.c
index c073fc4ce6d..6bc93b14817 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -1003,11 +1003,14 @@ load_error_handler (Lisp_Object data)
1003 return Qnil; 1003 return Qnil;
1004} 1004}
1005 1005
1006static _Noreturn void 1006static void
1007load_error_old_style_backquotes (void) 1007load_warn_old_style_backquotes (Lisp_Object file)
1008{ 1008{
1009 AUTO_STRING (format, "Loading `%s': old-style backquotes detected!"); 1009 if (!NILP (Vlread_old_style_backquotes))
1010 xsignal1 (Qerror, CALLN (Fformat_message, format, Vload_file_name)); 1010 {
1011 AUTO_STRING (format, "Loading `%s': old-style backquotes detected!");
1012 CALLN (Fmessage, format, file);
1013 }
1011} 1014}
1012 1015
1013static void 1016static void
@@ -1279,6 +1282,10 @@ Return t if the file exists and loads successfully. */)
1279 1282
1280 version = -1; 1283 version = -1;
1281 1284
1285 /* Check for the presence of old-style quotes and warn about them. */
1286 specbind (Qlread_old_style_backquotes, Qnil);
1287 record_unwind_protect (load_warn_old_style_backquotes, file);
1288
1282 /* Check for the presence of unescaped character literals and warn 1289 /* Check for the presence of unescaped character literals and warn
1283 about them. */ 1290 about them. */
1284 specbind (Qlread_unescaped_character_literals, Qnil); 1291 specbind (Qlread_unescaped_character_literals, Qnil);
@@ -3171,7 +3178,10 @@ read1 (Lisp_Object readcharfun, int *pch, bool first_in_list)
3171 first_in_list exception (old-style can still be obtained via 3178 first_in_list exception (old-style can still be obtained via
3172 "(\`" anyway). */ 3179 "(\`" anyway). */
3173 if (!new_backquote_flag && first_in_list && next_char == ' ') 3180 if (!new_backquote_flag && first_in_list && next_char == ' ')
3174 load_error_old_style_backquotes (); 3181 {
3182 Vlread_old_style_backquotes = Qt;
3183 goto default_label;
3184 }
3175 else 3185 else
3176 { 3186 {
3177 Lisp_Object value; 3187 Lisp_Object value;
@@ -3222,7 +3232,10 @@ read1 (Lisp_Object readcharfun, int *pch, bool first_in_list)
3222 return list2 (comma_type, value); 3232 return list2 (comma_type, value);
3223 } 3233 }
3224 else 3234 else
3225 load_error_old_style_backquotes (); 3235 {
3236 Vlread_old_style_backquotes = Qt;
3237 goto default_label;
3238 }
3226 } 3239 }
3227 case '?': 3240 case '?':
3228 { 3241 {
@@ -3410,6 +3423,7 @@ read1 (Lisp_Object readcharfun, int *pch, bool first_in_list)
3410 row. */ 3423 row. */
3411 FALLTHROUGH; 3424 FALLTHROUGH;
3412 default: 3425 default:
3426 default_label:
3413 if (c <= 040) goto retry; 3427 if (c <= 040) goto retry;
3414 if (c == NO_BREAK_SPACE) 3428 if (c == NO_BREAK_SPACE)
3415 goto retry; 3429 goto retry;
@@ -4982,6 +4996,12 @@ variables, this must be set in the first line of a file. */);
4982 doc: /* List of buffers being read from by calls to `eval-buffer' and `eval-region'. */); 4996 doc: /* List of buffers being read from by calls to `eval-buffer' and `eval-region'. */);
4983 Veval_buffer_list = Qnil; 4997 Veval_buffer_list = Qnil;
4984 4998
4999 DEFVAR_LISP ("lread--old-style-backquotes", Vlread_old_style_backquotes,
5000 doc: /* Set to non-nil when `read' encounters an old-style backquote.
5001For internal use only. */);
5002 Vlread_old_style_backquotes = Qnil;
5003 DEFSYM (Qlread_old_style_backquotes, "lread--old-style-backquotes");
5004
4985 DEFVAR_LISP ("lread--unescaped-character-literals", 5005 DEFVAR_LISP ("lread--unescaped-character-literals",
4986 Vlread_unescaped_character_literals, 5006 Vlread_unescaped_character_literals,
4987 doc: /* List of deprecated unescaped character literals encountered by `read'. 5007 doc: /* List of deprecated unescaped character literals encountered by `read'.