]> git.eshelyaron.com Git - emacs.git/commitdiff
* alloc.c (mark_overlay): Assume that overlay boundaries are
authorDmitry Antipov <dmantipov@yandex.ru>
Thu, 2 Oct 2014 14:01:27 +0000 (18:01 +0400)
committerDmitry Antipov <dmantipov@yandex.ru>
Thu, 2 Oct 2014 14:01:27 +0000 (18:01 +0400)
always markers.  Add comment.
* lread.c (read_internal_start): Use convenient validate_subarray.
Adjust docstring.
(Fread_from_string): Adjust docstring.

src/ChangeLog
src/alloc.c
src/lread.c

index f3c881f630d99312ccc34e52841add754dfb5a13..2a4ce099021454303129531d01fa16b02bf21cff 100644 (file)
@@ -1,3 +1,11 @@
+2014-10-02  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       * alloc.c (mark_overlay): Assume that overlay boundaries are
+       always markers.  Add comment.
+       * lread.c (read_internal_start): Use convenient validate_subarray.
+       Adjust docstring.
+       (Fread_from_string): Adjust docstring.
+
 2014-10-02  Stefan Monnier  <monnier@iro.umontreal.ca>
 
        * lisp.h: Fix up compilation for USE_STACK_LISP_OBJECTS=false.
index f656dc94216ea9d25e204dd797c8bbf1ba026514..faad0b59c878e845dc764d19c55b422d0b062cbe 100644 (file)
@@ -6015,8 +6015,9 @@ mark_overlay (struct Lisp_Overlay *ptr)
   for (; ptr && !ptr->gcmarkbit; ptr = ptr->next)
     {
       ptr->gcmarkbit = 1;
-      mark_object (ptr->start);
-      mark_object (ptr->end);
+      /* These two are always markers and can be marked fast.  */
+      XMARKER (ptr->start)->gcmarkbit = 1;
+      XMARKER (ptr->end)->gcmarkbit = 1;
       mark_object (ptr->plist);
     }
 }
index 0e71b13c5c80b58f8c50b8b28c2749fa139e4f19..59af12cf6da98f21b236e05e6df14c7e4e237969 100644 (file)
@@ -2096,9 +2096,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;
@@ -2109,10 +2110,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;
 
@@ -2134,25 +2134,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;