/* If we won't print another message, mention this anyway. */
if (! NILP (nomessage))
- message ("Source file `%s' newer than byte-compiled file",
- XSTRING (found)->data);
+ message_with_string ("Source file `%s' newer than byte-compiled file",
+ found, 1);
}
XSTRING (found)->data[XSTRING (found)->size - 1] = 'c';
}
if (NILP (nomessage))
{
if (!compiled)
- message ("Loading %s (source)...", XSTRING (file)->data);
+ message_with_string ("Loading %s (source)...", file, 1);
else if (newer)
- message ("Loading %s (compiled; note, source file is newer)...",
- XSTRING (file)->data);
+ message_with_string ("Loading %s (compiled; note, source file is newer)...",
+ file, 1);
else /* The typical case; compiled file newer than source file. */
- message ("Loading %s...", XSTRING (file)->data);
+ message_with_string ("Loading %s...", file, 1);
}
GCPRO1 (file);
if (!noninteractive && NILP (nomessage))
{
if (!compiled)
- message ("Loading %s (source)...done", XSTRING (file)->data);
+ message_with_string ("Loading %s (source)...done", file, 1);
else if (newer)
- message ("Loading %s (compiled; note, source file is newer)...done",
- XSTRING (file)->data);
+ message_with_string ("Loading %s (compiled; note, source file is newer)...done",
+ file, 1);
else /* The typical case; compiled file newer than source file. */
- message ("Loading %s...done", XSTRING (file)->data);
+ message_with_string ("Loading %s...done", file, 1);
}
return Qt;
}
CHECK_STRING (string,0);
if (NILP (end))
- endval = XSTRING (string)->size;
+ endval = XSTRING (string)->size_byte;
else
- { CHECK_NUMBER (end,2);
- endval = XINT (end);
- if (endval < 0 || endval > XSTRING (string)->size)
+ {
+ CHECK_NUMBER (end, 2);
+ endval = string_char_to_byte (string, XINT (end));
+ if (endval < 0 || endval > XSTRING (string)->size_byte)
args_out_of_range (string, end);
}
if (NILP (start))
startval = 0;
else
- { CHECK_NUMBER (start,1);
- startval = XINT (start);
+ {
+ CHECK_NUMBER (start, 1);
+ startval = string_char_to_byte (string, XINT (start));
if (startval < 0 || startval > endval)
args_out_of_range (string, start);
}
read_objects = Qnil;
tem = read0 (string);
- return Fcons (tem, make_number (read_from_string_index));
+ endval = string_byte_to_char (string,
+ read_from_string_index);
+ return Fcons (tem, make_number (endval));
}
\f
/* Use this for recursive reads, in contexts where internal tokens
are not allowed. */
+
static Lisp_Object
read0 (readcharfun)
Lisp_Object readcharfun;
{
register Lisp_Object val;
- char c;
+ int c;
val = read1 (readcharfun, &c, 0);
if (c)
- Fsignal (Qinvalid_read_syntax, Fcons (make_string (&c, 1), Qnil));
+ Fsignal (Qinvalid_read_syntax, Fcons (Fmake_string (make_number (c),
+ make_number (1)),
+ Qnil));
return val;
}
return '\v';
case '\n':
return -1;
+ case ' ':
+ return -1;
case 'M':
c = READCHAR;
static Lisp_Object
read1 (readcharfun, pch, first_in_list)
register Lisp_Object readcharfun;
- char *pch;
+ int *pch;
int first_in_list;
{
register int c;
{
Lisp_Object tmp;
struct gcpro gcpro1;
- char ch;
+ int ch;
/* Read the string itself. */
tmp = read1 (readcharfun, &ch, 0);
return make_number (0);
if (read_pure)
- return make_pure_string (read_buffer, p - read_buffer);
- else
+ return make_pure_string (read_buffer, p - read_buffer,
+ p - read_buffer);
+ else if (! NILP (current_buffer->enable_multibyte_characters))
return make_string (read_buffer, p - read_buffer);
+ else
+ return make_unibyte_string (read_buffer, p - read_buffer);
}
case '.':
while (1)
{
- char ch;
+ int ch;
GCPRO2 (val, tail);
elt = read1 (readcharfun, &ch, first_in_list);
UNGCPRO;
obarray = Vobarray;
if (!VECTORP (obarray) || XVECTOR (obarray)->size == 0)
obarray = check_obarray (obarray);
- tem = oblookup (obarray, str, len);
+ tem = oblookup (obarray, str, len, len);
if (SYMBOLP (tem))
return tem;
return Fintern (make_string (str, len), obarray);
int len = strlen (str);
return Fmake_symbol ((!NILP (Vpurify_flag)
- ? make_pure_string (str, len)
+ ? make_pure_string (str, len, len)
: make_string (str, len)));
}
\f
CHECK_STRING (string, 0);
- tem = oblookup (obarray, XSTRING (string)->data, XSTRING (string)->size);
+ tem = oblookup (obarray, XSTRING (string)->data,
+ XSTRING (string)->size,
+ XSTRING (string)->size_byte);
if (!INTEGERP (tem))
return tem;
CHECK_STRING (string, 0);
- tem = oblookup (obarray, XSTRING (string)->data, XSTRING (string)->size);
+ tem = oblookup (obarray, XSTRING (string)->data,
+ XSTRING (string)->size,
+ XSTRING (string)->size_byte);
if (!INTEGERP (tem))
return tem;
return Qnil;
string = name;
}
- tem = oblookup (obarray, XSTRING (string)->data, XSTRING (string)->size);
+ tem = oblookup (obarray, XSTRING (string)->data,
+ XSTRING (string)->size,
+ XSTRING (string)->size_byte);
if (INTEGERP (tem))
return Qnil;
/* If arg was a symbol, don't delete anything but that symbol itself. */
}
\f
/* Return the symbol in OBARRAY whose names matches the string
- of SIZE characters at PTR. If there is no such symbol in OBARRAY,
- return nil.
+ of SIZE characters (SIZE_BYTE bytes) at PTR.
+ If there is no such symbol in OBARRAY, return nil.
Also store the bucket number in oblookup_last_bucket_number. */
Lisp_Object
-oblookup (obarray, ptr, size)
+oblookup (obarray, ptr, size, size_byte)
Lisp_Object obarray;
register char *ptr;
- register int size;
+ int size, size_byte;
{
int hash;
int obsize;
/* This is sometimes needed in the middle of GC. */
obsize &= ~ARRAY_MARK_FLAG;
/* Combining next two lines breaks VMS C 2.3. */
- hash = hash_string (ptr, size);
+ hash = hash_string (ptr, size_byte);
hash %= obsize;
bucket = XVECTOR (obarray)->contents[hash];
oblookup_last_bucket_number = hash;
else
for (tail = bucket; ; XSETSYMBOL (tail, XSYMBOL (tail)->next))
{
- if (XSYMBOL (tail)->name->size == size
- && !bcmp (XSYMBOL (tail)->name->data, ptr, size))
+ if (XSYMBOL (tail)->name->size_byte == size_byte
+ && XSYMBOL (tail)->name->size == size
+ && !bcmp (XSYMBOL (tail)->name->data, ptr, size_byte))
return tail;
else if (XSYMBOL (tail)->next == 0)
break;
XSETFASTINT (oblength, OBARRAY_SIZE);
- Qnil = Fmake_symbol (make_pure_string ("nil", 3));
+ Qnil = Fmake_symbol (make_pure_string ("nil", 3, 3));
Vobarray = Fmake_vector (oblength, make_number (0));
initial_obarray = Vobarray;
staticpro (&initial_obarray);
tem = &XVECTOR (Vobarray)->contents[hash];
*tem = Qnil;
- Qunbound = Fmake_symbol (make_pure_string ("unbound", 7));
+ Qunbound = Fmake_symbol (make_pure_string ("unbound", 7, 7));
XSYMBOL (Qnil)->function = Qunbound;
XSYMBOL (Qunbound)->value = Qunbound;
XSYMBOL (Qunbound)->function = Qunbound;
fprintf (stderr, format, XSTRING (dirname)->data);
sprintf (buffer, format, XSTRING (dirname)->data);
- message_dolog (buffer, strlen (buffer), 0);
+ message_dolog (buffer, strlen (buffer), 0, STRING_MULTIBYTE (dirname));
}
void