Merge from emacs--rel--22
[bpt/emacs.git] / src / lread.c
index 5037937..282bf1d 100644 (file)
@@ -1199,7 +1199,7 @@ openp (path, str, suffixes, storeptr, predicate)
        fn = (char *) alloca (fn_size = 100 + want_size);
 
       /* Loop over suffixes.  */
-      for (tail = NILP (suffixes) ? Fcons (build_string (""), Qnil) : suffixes;
+      for (tail = NILP (suffixes) ? Fcons (empty_unibyte_string, Qnil) : suffixes;
           CONSP (tail); tail = XCDR (tail))
        {
          int lsuffix = SBYTES (XCAR (tail));
@@ -1501,7 +1501,8 @@ readevalloop (readcharfun, stream, sourcename, evalfun,
        }
 
       /* Ignore whitespace here, so we can detect eof.  */
-      if (c == ' ' || c == '\t' || c == '\n' || c == '\f' || c == '\r')
+      if (c == ' ' || c == '\t' || c == '\n' || c == '\f' || c == '\r'
+         || c == 0x8a0)  /* NBSP */
        goto read_next;
 
       if (!NILP (Vpurify_flag) && c == '(')
@@ -1894,7 +1895,7 @@ read_escape (readcharfun, stringp, byterep)
 
     case 's':
       c = READCHAR;
-      if (c != '-')
+      if (stringp || c != '-')
        {
          UNREAD (c);
          return ' ';
@@ -2693,7 +2694,9 @@ read1 (readcharfun, pch, first_in_list)
       }
     default:
     default_label:
-      if (c <= 040) goto retry;
+      if (c <= 040) goto retry;        
+      if (c == 0x8a0) /* NBSP */
+       goto retry;
       {
        char *p = read_buffer;
        int quoted = 0;
@@ -2702,6 +2705,7 @@ read1 (readcharfun, pch, first_in_list)
          char *end = read_buffer + read_buffer_size;
 
          while (c > 040
+                && c != 0x8a0 /* NBSP */
                 && (c >= 0200
                     || (!index ("\"';()[]#", c)
                         && !(!first_in_list && c == '`')
@@ -4070,8 +4074,7 @@ and, if so, which suffixes they should try to append to the file name
 in order to do so.  However, if you want to customize which suffixes
 the loading functions recognize as compression suffixes, you should
 customize `jka-compr-load-suffixes' rather than the present variable.  */);
-  /* We don't use empty_string because it's not initialized yet.  */
-  Vload_file_rep_suffixes = Fcons (build_string (""), Qnil);
+  Vload_file_rep_suffixes = Fcons (empty_unibyte_string, Qnil);
 
   DEFVAR_BOOL ("load-in-progress", &load_in_progress,
               doc: /* Non-nil if inside of `load'.  */);