311 |
Lisp_Object object; |
Lisp_Object object; |
312 |
{ |
{ |
313 |
if (SYMBOLP (object) |
if (SYMBOLP (object) |
314 |
&& XSTRING (SYMBOL_NAME (object))->data[0] == ':' |
&& SREF (SYMBOL_NAME (object), 0) == ':' |
315 |
&& SYMBOL_INTERNED_IN_INITIAL_OBARRAY_P (object)) |
&& SYMBOL_INTERNED_IN_INITIAL_OBARRAY_P (object)) |
316 |
return Qt; |
return Qt; |
317 |
return Qnil; |
return Qnil; |
873 |
*XINTFWD (valcontents)->intvar = XINT (newval); |
*XINTFWD (valcontents)->intvar = XINT (newval); |
874 |
if (*XINTFWD (valcontents)->intvar != XINT (newval)) |
if (*XINTFWD (valcontents)->intvar != XINT (newval)) |
875 |
error ("Value out of range for variable `%s'", |
error ("Value out of range for variable `%s'", |
876 |
XSTRING (SYMBOL_NAME (symbol))->data); |
SDATA (SYMBOL_NAME (symbol))); |
877 |
break; |
break; |
878 |
|
|
879 |
case Lisp_Misc_Boolfwd: |
case Lisp_Misc_Boolfwd: |
891 |
|
|
892 |
type = PER_BUFFER_TYPE (offset); |
type = PER_BUFFER_TYPE (offset); |
893 |
if (XINT (type) == -1) |
if (XINT (type) == -1) |
894 |
error ("Variable %s is read-only", XSTRING (SYMBOL_NAME (symbol))->data); |
error ("Variable %s is read-only", SDATA (SYMBOL_NAME (symbol))); |
895 |
|
|
896 |
if (! NILP (type) && ! NILP (newval) |
if (! NILP (type) && ! NILP (newval) |
897 |
&& XTYPE (newval) != XINT (type)) |
&& XTYPE (newval) != XINT (type)) |
1447 |
|
|
1448 |
valcontents = SYMBOL_VALUE (variable); |
valcontents = SYMBOL_VALUE (variable); |
1449 |
if (EQ (variable, Qnil) || EQ (variable, Qt) || KBOARD_OBJFWDP (valcontents)) |
if (EQ (variable, Qnil) || EQ (variable, Qt) || KBOARD_OBJFWDP (valcontents)) |
1450 |
error ("Symbol %s may not be buffer-local", XSTRING (SYMBOL_NAME (variable))->data); |
error ("Symbol %s may not be buffer-local", SDATA (SYMBOL_NAME (variable))); |
1451 |
|
|
1452 |
if (BUFFER_LOCAL_VALUEP (valcontents) || BUFFER_OBJFWDP (valcontents)) |
if (BUFFER_LOCAL_VALUEP (valcontents) || BUFFER_OBJFWDP (valcontents)) |
1453 |
return variable; |
return variable; |
1500 |
|
|
1501 |
valcontents = SYMBOL_VALUE (variable); |
valcontents = SYMBOL_VALUE (variable); |
1502 |
if (EQ (variable, Qnil) || EQ (variable, Qt) || KBOARD_OBJFWDP (valcontents)) |
if (EQ (variable, Qnil) || EQ (variable, Qt) || KBOARD_OBJFWDP (valcontents)) |
1503 |
error ("Symbol %s may not be buffer-local", XSTRING (SYMBOL_NAME (variable))->data); |
error ("Symbol %s may not be buffer-local", SDATA (SYMBOL_NAME (variable))); |
1504 |
|
|
1505 |
if (BUFFER_LOCAL_VALUEP (valcontents) || BUFFER_OBJFWDP (valcontents)) |
if (BUFFER_LOCAL_VALUEP (valcontents) || BUFFER_OBJFWDP (valcontents)) |
1506 |
{ |
{ |
1643 |
valcontents = SYMBOL_VALUE (variable); |
valcontents = SYMBOL_VALUE (variable); |
1644 |
if (EQ (variable, Qnil) || EQ (variable, Qt) || KBOARD_OBJFWDP (valcontents) |
if (EQ (variable, Qnil) || EQ (variable, Qt) || KBOARD_OBJFWDP (valcontents) |
1645 |
|| BUFFER_OBJFWDP (valcontents)) |
|| BUFFER_OBJFWDP (valcontents)) |
1646 |
error ("Symbol %s may not be frame-local", XSTRING (SYMBOL_NAME (variable))->data); |
error ("Symbol %s may not be frame-local", SDATA (SYMBOL_NAME (variable))); |
1647 |
|
|
1648 |
if (BUFFER_LOCAL_VALUEP (valcontents) |
if (BUFFER_LOCAL_VALUEP (valcontents) |
1649 |
|| SOME_BUFFER_LOCAL_VALUEP (valcontents)) |
|| SOME_BUFFER_LOCAL_VALUEP (valcontents)) |
1827 |
{ |
{ |
1828 |
int c, idxval_byte; |
int c, idxval_byte; |
1829 |
|
|
1830 |
if (idxval < 0 || idxval >= XSTRING (array)->size) |
if (idxval < 0 || idxval >= SCHARS (array)) |
1831 |
args_out_of_range (array, idx); |
args_out_of_range (array, idx); |
1832 |
if (! STRING_MULTIBYTE (array)) |
if (! STRING_MULTIBYTE (array)) |
1833 |
return make_number ((unsigned char) XSTRING (array)->data[idxval]); |
return make_number ((unsigned char) SREF (array, idxval)); |
1834 |
idxval_byte = string_char_to_byte (array, idxval); |
idxval_byte = string_char_to_byte (array, idxval); |
1835 |
|
|
1836 |
c = STRING_CHAR (&XSTRING (array)->data[idxval_byte], |
c = STRING_CHAR (&SREF (array, idxval_byte), |
1837 |
STRING_BYTES (XSTRING (array)) - idxval_byte); |
SBYTES (array) - idxval_byte); |
1838 |
return make_number (c); |
return make_number (c); |
1839 |
} |
} |
1840 |
else if (BOOL_VECTOR_P (array)) |
else if (BOOL_VECTOR_P (array)) |
2026 |
int idxval_byte, prev_bytes, new_bytes; |
int idxval_byte, prev_bytes, new_bytes; |
2027 |
unsigned char workbuf[MAX_MULTIBYTE_LENGTH], *p0 = workbuf, *p1; |
unsigned char workbuf[MAX_MULTIBYTE_LENGTH], *p0 = workbuf, *p1; |
2028 |
|
|
2029 |
if (idxval < 0 || idxval >= XSTRING (array)->size) |
if (idxval < 0 || idxval >= SCHARS (array)) |
2030 |
args_out_of_range (array, idx); |
args_out_of_range (array, idx); |
2031 |
CHECK_NUMBER (newelt); |
CHECK_NUMBER (newelt); |
2032 |
|
|
2033 |
idxval_byte = string_char_to_byte (array, idxval); |
idxval_byte = string_char_to_byte (array, idxval); |
2034 |
p1 = &XSTRING (array)->data[idxval_byte]; |
p1 = &SREF (array, idxval_byte); |
2035 |
PARSE_MULTIBYTE_SEQ (p1, nbytes - idxval_byte, prev_bytes); |
PARSE_MULTIBYTE_SEQ (p1, nbytes - idxval_byte, prev_bytes); |
2036 |
new_bytes = CHAR_STRING (XINT (newelt), p0); |
new_bytes = CHAR_STRING (XINT (newelt), p0); |
2037 |
if (prev_bytes != new_bytes) |
if (prev_bytes != new_bytes) |
2038 |
{ |
{ |
2039 |
/* We must relocate the string data. */ |
/* We must relocate the string data. */ |
2040 |
int nchars = XSTRING (array)->size; |
int nchars = SCHARS (array); |
2041 |
int nbytes = STRING_BYTES (XSTRING (array)); |
int nbytes = SBYTES (array); |
2042 |
unsigned char *str; |
unsigned char *str; |
2043 |
|
|
2044 |
str = (nbytes <= MAX_ALLOCA |
str = (nbytes <= MAX_ALLOCA |
2045 |
? (unsigned char *) alloca (nbytes) |
? (unsigned char *) alloca (nbytes) |
2046 |
: (unsigned char *) xmalloc (nbytes)); |
: (unsigned char *) xmalloc (nbytes)); |
2047 |
bcopy (XSTRING (array)->data, str, nbytes); |
bcopy (SDATA (array), str, nbytes); |
2048 |
allocate_string_data (XSTRING (array), nchars, |
allocate_string_data (XSTRING (array), nchars, |
2049 |
nbytes + new_bytes - prev_bytes); |
nbytes + new_bytes - prev_bytes); |
2050 |
bcopy (str, XSTRING (array)->data, idxval_byte); |
bcopy (str, SDATA (array), idxval_byte); |
2051 |
p1 = XSTRING (array)->data + idxval_byte; |
p1 = SDATA (array) + idxval_byte; |
2052 |
bcopy (str + idxval_byte + prev_bytes, p1 + new_bytes, |
bcopy (str + idxval_byte + prev_bytes, p1 + new_bytes, |
2053 |
nbytes - (idxval_byte + prev_bytes)); |
nbytes - (idxval_byte + prev_bytes)); |
2054 |
if (nbytes > MAX_ALLOCA) |
if (nbytes > MAX_ALLOCA) |
2060 |
} |
} |
2061 |
else |
else |
2062 |
{ |
{ |
2063 |
if (idxval < 0 || idxval >= XSTRING (array)->size) |
if (idxval < 0 || idxval >= SCHARS (array)) |
2064 |
args_out_of_range (array, idx); |
args_out_of_range (array, idx); |
2065 |
CHECK_NUMBER (newelt); |
CHECK_NUMBER (newelt); |
2066 |
|
|
2067 |
if (XINT (newelt) < 0 || SINGLE_BYTE_CHAR_P (XINT (newelt))) |
if (XINT (newelt) < 0 || SINGLE_BYTE_CHAR_P (XINT (newelt))) |
2068 |
XSTRING (array)->data[idxval] = XINT (newelt); |
SREF (array, idxval) = XINT (newelt); |
2069 |
else |
else |
2070 |
{ |
{ |
2071 |
/* We must relocate the string data while converting it to |
/* We must relocate the string data while converting it to |
2072 |
multibyte. */ |
multibyte. */ |
2073 |
int idxval_byte, prev_bytes, new_bytes; |
int idxval_byte, prev_bytes, new_bytes; |
2074 |
unsigned char workbuf[MAX_MULTIBYTE_LENGTH], *p0 = workbuf, *p1; |
unsigned char workbuf[MAX_MULTIBYTE_LENGTH], *p0 = workbuf, *p1; |
2075 |
unsigned char *origstr = XSTRING (array)->data, *str; |
unsigned char *origstr = SDATA (array), *str; |
2076 |
int nchars, nbytes; |
int nchars, nbytes; |
2077 |
|
|
2078 |
nchars = XSTRING (array)->size; |
nchars = SCHARS (array); |
2079 |
nbytes = idxval_byte = count_size_as_multibyte (origstr, idxval); |
nbytes = idxval_byte = count_size_as_multibyte (origstr, idxval); |
2080 |
nbytes += count_size_as_multibyte (origstr + idxval, |
nbytes += count_size_as_multibyte (origstr + idxval, |
2081 |
nchars - idxval); |
nchars - idxval); |
2082 |
str = (nbytes <= MAX_ALLOCA |
str = (nbytes <= MAX_ALLOCA |
2083 |
? (unsigned char *) alloca (nbytes) |
? (unsigned char *) alloca (nbytes) |
2084 |
: (unsigned char *) xmalloc (nbytes)); |
: (unsigned char *) xmalloc (nbytes)); |
2085 |
copy_text (XSTRING (array)->data, str, nchars, 0, 1); |
copy_text (SDATA (array), str, nchars, 0, 1); |
2086 |
PARSE_MULTIBYTE_SEQ (str + idxval_byte, nbytes - idxval_byte, |
PARSE_MULTIBYTE_SEQ (str + idxval_byte, nbytes - idxval_byte, |
2087 |
prev_bytes); |
prev_bytes); |
2088 |
new_bytes = CHAR_STRING (XINT (newelt), p0); |
new_bytes = CHAR_STRING (XINT (newelt), p0); |
2089 |
allocate_string_data (XSTRING (array), nchars, |
allocate_string_data (XSTRING (array), nchars, |
2090 |
nbytes + new_bytes - prev_bytes); |
nbytes + new_bytes - prev_bytes); |
2091 |
bcopy (str, XSTRING (array)->data, idxval_byte); |
bcopy (str, SDATA (array), idxval_byte); |
2092 |
p1 = XSTRING (array)->data + idxval_byte; |
p1 = SDATA (array) + idxval_byte; |
2093 |
while (new_bytes--) |
while (new_bytes--) |
2094 |
*p1++ = *p0++; |
*p1++ = *p0++; |
2095 |
bcopy (str + idxval_byte + prev_bytes, p1, |
bcopy (str + idxval_byte + prev_bytes, p1, |
2339 |
|
|
2340 |
/* Skip any whitespace at the front of the number. Some versions of |
/* Skip any whitespace at the front of the number. Some versions of |
2341 |
atoi do this anyway, so we might as well make Emacs lisp consistent. */ |
atoi do this anyway, so we might as well make Emacs lisp consistent. */ |
2342 |
p = XSTRING (string)->data; |
p = SDATA (string); |
2343 |
while (*p == ' ' || *p == '\t') |
while (*p == ' ' || *p == '\t') |
2344 |
p++; |
p++; |
2345 |
|
|