193 |
Lisp_Object spec; |
Lisp_Object spec; |
194 |
{ |
{ |
195 |
if (STRINGP (spec)) |
if (STRINGP (spec)) |
196 |
error ("No buffer named %s", XSTRING (spec)->data); |
error ("No buffer named %s", SDATA (spec)); |
197 |
error ("Invalid buffer argument"); |
error ("Invalid buffer argument"); |
198 |
} |
} |
199 |
|
|
341 |
if (!NILP (buf)) |
if (!NILP (buf)) |
342 |
return buf; |
return buf; |
343 |
|
|
344 |
if (XSTRING (name)->size == 0) |
if (SCHARS (name) == 0) |
345 |
error ("Empty string for buffer name is not allowed"); |
error ("Empty string for buffer name is not allowed"); |
346 |
|
|
347 |
b = (struct buffer *) allocate_buffer (); |
b = (struct buffer *) allocate_buffer (); |
397 |
b->zv_marker = Qnil; |
b->zv_marker = Qnil; |
398 |
|
|
399 |
name = Fcopy_sequence (name); |
name = Fcopy_sequence (name); |
400 |
XSTRING (name)->intervals = NULL_INTERVAL; |
STRING_INTERVALS (name) = NULL_INTERVAL; |
401 |
b->name = name; |
b->name = name; |
402 |
|
|
403 |
if (XSTRING (name)->data[0] != ' ') |
if (SREF (name, 0) != ' ') |
404 |
b->undo_list = Qnil; |
b->undo_list = Qnil; |
405 |
else |
else |
406 |
b->undo_list = Qt; |
b->undo_list = Qt; |
520 |
|
|
521 |
buf = Fget_buffer (name); |
buf = Fget_buffer (name); |
522 |
if (!NILP (buf)) |
if (!NILP (buf)) |
523 |
error ("Buffer name `%s' is in use", XSTRING (name)->data); |
error ("Buffer name `%s' is in use", SDATA (name)); |
524 |
|
|
525 |
base_buffer = Fget_buffer (base_buffer); |
base_buffer = Fget_buffer (base_buffer); |
526 |
if (NILP (base_buffer)) |
if (NILP (base_buffer)) |
527 |
error ("No such buffer: `%s'", XSTRING (name)->data); |
error ("No such buffer: `%s'", SDATA (name)); |
528 |
|
|
529 |
if (XSTRING (name)->size == 0) |
if (SCHARS (name) == 0) |
530 |
error ("Empty string for buffer name is not allowed"); |
error ("Empty string for buffer name is not allowed"); |
531 |
|
|
532 |
b = (struct buffer *) allocate_buffer (); |
b = (struct buffer *) allocate_buffer (); |
556 |
all_buffers = b; |
all_buffers = b; |
557 |
|
|
558 |
name = Fcopy_sequence (name); |
name = Fcopy_sequence (name); |
559 |
XSTRING (name)->intervals = NULL_INTERVAL; |
STRING_INTERVALS (name) = NULL_INTERVAL; |
560 |
b->name = name; |
b->name = name; |
561 |
|
|
562 |
reset_buffer (b); |
reset_buffer (b); |
1091 |
|
|
1092 |
CHECK_STRING (newname); |
CHECK_STRING (newname); |
1093 |
|
|
1094 |
if (XSTRING (newname)->size == 0) |
if (SCHARS (newname) == 0) |
1095 |
error ("Empty string is invalid as a buffer name"); |
error ("Empty string is invalid as a buffer name"); |
1096 |
|
|
1097 |
tem = Fget_buffer (newname); |
tem = Fget_buffer (newname); |
1106 |
if (!NILP (unique)) |
if (!NILP (unique)) |
1107 |
newname = Fgenerate_new_buffer_name (newname, current_buffer->name); |
newname = Fgenerate_new_buffer_name (newname, current_buffer->name); |
1108 |
else |
else |
1109 |
error ("Buffer name `%s' is in use", XSTRING (newname)->data); |
error ("Buffer name `%s' is in use", SDATA (newname)); |
1110 |
} |
} |
1111 |
|
|
1112 |
current_buffer->name = newname; |
current_buffer->name = newname; |
1163 |
buf = Fcdr (Fcar (tail)); |
buf = Fcdr (Fcar (tail)); |
1164 |
if (EQ (buf, buffer)) |
if (EQ (buf, buffer)) |
1165 |
continue; |
continue; |
1166 |
if (XSTRING (XBUFFER (buf)->name)->data[0] == ' ') |
if (SDATA (XBUFFER (buf)->name)[0] == ' ') |
1167 |
continue; |
continue; |
1168 |
/* If the selected frame has a buffer_predicate, |
/* If the selected frame has a buffer_predicate, |
1169 |
disregard buffers that don't fit the predicate. */ |
disregard buffers that don't fit the predicate. */ |
1289 |
{ |
{ |
1290 |
GCPRO1 (buf); |
GCPRO1 (buf); |
1291 |
tem = do_yes_or_no_p (format1 ("Buffer %s modified; kill anyway? ", |
tem = do_yes_or_no_p (format1 ("Buffer %s modified; kill anyway? ", |
1292 |
XSTRING (b->name)->data)); |
SDATA (b->name))); |
1293 |
UNGCPRO; |
UNGCPRO; |
1294 |
if (NILP (tem)) |
if (NILP (tem)) |
1295 |
return Qnil; |
return Qnil; |
1535 |
Lisp_Object function; |
Lisp_Object function; |
1536 |
|
|
1537 |
if (STRINGP (XBUFFER (buffer)->name) |
if (STRINGP (XBUFFER (buffer)->name) |
1538 |
&& strcmp (XSTRING (XBUFFER (buffer)->name)->data, "*scratch*") == 0) |
&& strcmp (SDATA (XBUFFER (buffer)->name), "*scratch*") == 0) |
1539 |
function = find_symbol_value (intern ("initial-major-mode")); |
function = find_symbol_value (intern ("initial-major-mode")); |
1540 |
else |
else |
1541 |
{ |
{ |
2883 |
ssl->used++; |
ssl->used++; |
2884 |
|
|
2885 |
if (NILP (current_buffer->enable_multibyte_characters)) |
if (NILP (current_buffer->enable_multibyte_characters)) |
2886 |
nbytes = XSTRING (str)->size; |
nbytes = SCHARS (str); |
2887 |
else if (! STRING_MULTIBYTE (str)) |
else if (! STRING_MULTIBYTE (str)) |
2888 |
nbytes = count_size_as_multibyte (XSTRING (str)->data, |
nbytes = count_size_as_multibyte (SDATA (str), |
2889 |
STRING_BYTES (XSTRING (str))); |
SBYTES (str)); |
2890 |
else |
else |
2891 |
nbytes = STRING_BYTES (XSTRING (str)); |
nbytes = SBYTES (str); |
2892 |
|
|
2893 |
ssl->bytes += nbytes; |
ssl->bytes += nbytes; |
2894 |
|
|
2895 |
if (STRINGP (str2)) |
if (STRINGP (str2)) |
2896 |
{ |
{ |
2897 |
if (NILP (current_buffer->enable_multibyte_characters)) |
if (NILP (current_buffer->enable_multibyte_characters)) |
2898 |
nbytes = XSTRING (str2)->size; |
nbytes = SCHARS (str2); |
2899 |
else if (! STRING_MULTIBYTE (str2)) |
else if (! STRING_MULTIBYTE (str2)) |
2900 |
nbytes = count_size_as_multibyte (XSTRING (str2)->data, |
nbytes = count_size_as_multibyte (SDATA (str2), |
2901 |
STRING_BYTES (XSTRING (str2))); |
SBYTES (str2)); |
2902 |
else |
else |
2903 |
nbytes = STRING_BYTES (XSTRING (str2)); |
nbytes = SBYTES (str2); |
2904 |
|
|
2905 |
ssl->bytes += nbytes; |
ssl->bytes += nbytes; |
2906 |
} |
} |
3012 |
{ |
{ |
3013 |
int nbytes; |
int nbytes; |
3014 |
tem = overlay_tails.buf[i].string; |
tem = overlay_tails.buf[i].string; |
3015 |
nbytes = copy_text (XSTRING (tem)->data, p, |
nbytes = copy_text (SDATA (tem), p, |
3016 |
STRING_BYTES (XSTRING (tem)), |
SBYTES (tem), |
3017 |
STRING_MULTIBYTE (tem), multibyte); |
STRING_MULTIBYTE (tem), multibyte); |
3018 |
p += nbytes; |
p += nbytes; |
3019 |
} |
} |
3021 |
{ |
{ |
3022 |
int nbytes; |
int nbytes; |
3023 |
tem = overlay_heads.buf[i].string; |
tem = overlay_heads.buf[i].string; |
3024 |
nbytes = copy_text (XSTRING (tem)->data, p, |
nbytes = copy_text (SDATA (tem), p, |
3025 |
STRING_BYTES (XSTRING (tem)), |
SBYTES (tem), |
3026 |
STRING_MULTIBYTE (tem), multibyte); |
STRING_MULTIBYTE (tem), multibyte); |
3027 |
p += nbytes; |
p += nbytes; |
3028 |
tem = overlay_heads.buf[i].string2; |
tem = overlay_heads.buf[i].string2; |
3029 |
if (STRINGP (tem)) |
if (STRINGP (tem)) |
3030 |
{ |
{ |
3031 |
nbytes = copy_text (XSTRING (tem)->data, p, |
nbytes = copy_text (SDATA (tem), p, |
3032 |
STRING_BYTES (XSTRING (tem)), |
SBYTES (tem), |
3033 |
STRING_MULTIBYTE (tem), multibyte); |
STRING_MULTIBYTE (tem), multibyte); |
3034 |
p += nbytes; |
p += nbytes; |
3035 |
} |
} |
4282 |
|
|
4283 |
sym = PER_BUFFER_SYMBOL (offset); |
sym = PER_BUFFER_SYMBOL (offset); |
4284 |
error ("Only %s should be stored in the buffer-local variable %s", |
error ("Only %s should be stored in the buffer-local variable %s", |
4285 |
type_name, XSTRING (SYMBOL_NAME (sym))->data); |
type_name, SDATA (SYMBOL_NAME (sym))); |
4286 |
} |
} |
4287 |
|
|
4288 |
|
|
5066 |
because of the ange-ftp completion handler. |
because of the ange-ftp completion handler. |
5067 |
However, it is not necessary to turn / into /:/. |
However, it is not necessary to turn / into /:/. |
5068 |
So avoid doing that. */ |
So avoid doing that. */ |
5069 |
&& strcmp ("/", XSTRING (current_buffer->directory)->data)) |
&& strcmp ("/", SDATA (current_buffer->directory))) |
5070 |
current_buffer->directory |
current_buffer->directory |
5071 |
= concat2 (build_string ("/:"), current_buffer->directory); |
= concat2 (build_string ("/:"), current_buffer->directory); |
5072 |
|
|