]> code.delx.au - gnu-emacs/blobdiff - src/lread.c
Minor typo fixes in vc-src.el.
[gnu-emacs] / src / lread.c
index b6f259f1a957c162da9624977f82d671a43b3985..6f71ff5f468c2786a83bd0f5ef7ff53d2af3e177 100644 (file)
@@ -66,7 +66,8 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 
 /* Hash table read constants.  */
 static Lisp_Object Qhash_table, Qdata;
-static Lisp_Object Qtest, Qsize;
+static Lisp_Object Qtest;
+Lisp_Object Qsize;
 static Lisp_Object Qweakness;
 static Lisp_Object Qrehash_size;
 static Lisp_Object Qrehash_threshold;
@@ -969,9 +970,10 @@ static void
 load_warn_old_style_backquotes (Lisp_Object file)
 {
   if (!NILP (Vold_style_backquotes))
-    Fmessage (2, ((Lisp_Object [])
-      { build_local_string ("Loading `%s': old-style backquotes detected!"),
-       file }));
+    {
+      AUTO_STRING (format, "Loading `%s': old-style backquotes detected!");
+      Fmessage (2, (Lisp_Object []) {format, file});
+    }
 }
 
 DEFUN ("get-load-suffixes", Fget_load_suffixes, Sget_load_suffixes, 0, 0, 0,
@@ -2095,9 +2097,10 @@ DEFUN ("read-from-string", Fread_from_string, Sread_from_string, 1, 3, 0,
        doc: /* Read one Lisp expression which is represented as text by STRING.
 Returns a cons: (OBJECT-READ . FINAL-STRING-INDEX).
 FINAL-STRING-INDEX is an integer giving the position of the next
- remaining character in STRING.
-START and END optionally delimit a substring of STRING from which to read;
- they default to 0 and (length STRING) respectively.  */)
+remaining character in STRING.  START and END optionally delimit
+a substring of STRING from which to read;  they default to 0 and
+(length STRING) respectively.  Negative values are counted from
+the end of STRING.  */)
   (Lisp_Object string, Lisp_Object start, Lisp_Object end)
 {
   Lisp_Object ret;
@@ -2108,10 +2111,9 @@ START and END optionally delimit a substring of STRING from which to read;
 }
 
 /* Function to set up the global context we need in toplevel read
-   calls.  */
+   calls.  START and END only used when STREAM is a string.  */
 static Lisp_Object
 read_internal_start (Lisp_Object stream, Lisp_Object start, Lisp_Object end)
-/* `start', `end' only used when stream is a string.  */
 {
   Lisp_Object retval;
 
@@ -2133,25 +2135,9 @@ read_internal_start (Lisp_Object stream, Lisp_Object start, Lisp_Object end)
       else
        string = XCAR (stream);
 
-      if (NILP (end))
-       endval = SCHARS (string);
-      else
-       {
-         CHECK_NUMBER (end);
-         if (! (0 <= XINT (end) && XINT (end) <= SCHARS (string)))
-           args_out_of_range (string, end);
-         endval = XINT (end);
-       }
+      validate_subarray (string, start, end, SCHARS (string),
+                        &startval, &endval);
 
-      if (NILP (start))
-       startval = 0;
-      else
-       {
-         CHECK_NUMBER (start);
-         if (! (0 <= XINT (start) && XINT (start) <= endval))
-           args_out_of_range (string, start);
-         startval = XINT (start);
-       }
       read_from_string_index = startval;
       read_from_string_index_byte = string_char_to_byte (string, startval);
       read_from_string_limit = endval;
@@ -2888,11 +2874,8 @@ read1 (Lisp_Object readcharfun, int *pch, bool first_in_list)
                  if (c == '=')
                    {
                      /* Make a placeholder for #n# to use temporarily.  */
-                     Lisp_Object placeholder;
-                     Lisp_Object cell;
-
-                     placeholder = scoped_cons (Qnil, Qnil);
-                     cell = Fcons (make_number (n), placeholder);
+                     AUTO_CONS (placeholder, Qnil, Qnil);
+                     Lisp_Object cell = Fcons (make_number (n), placeholder);
                      read_objects = Fcons (cell, read_objects);
 
                      /* Read the object itself.  */
@@ -3371,7 +3354,7 @@ substitute_object_recurse (Lisp_Object object, Lisp_Object placeholder, Lisp_Obj
           substitute_in_interval contains part of the logic.  */
 
        INTERVAL root_interval = string_intervals (subtree);
-       Lisp_Object arg = scoped_cons (object, placeholder);
+       AUTO_CONS (arg, object, placeholder);
 
        traverse_intervals_noorder (root_interval,
                                    &substitute_in_interval, arg);
@@ -3678,8 +3661,10 @@ read_list (bool flag, Lisp_Object readcharfun)
               in the installed Lisp directory.
               We don't use Fexpand_file_name because that would make
               the directory absolute now.  */
-           elt = concat2 (build_local_string ("../lisp/"),
-                          Ffile_name_nondirectory (elt));
+           {
+             AUTO_STRING (dot_dot_lisp, "../lisp/");
+             elt = concat2 (dot_dot_lisp, Ffile_name_nondirectory (elt));
+           }
        }
       else if (EQ (elt, Vload_file_name)
               && ! NILP (elt)