176 |
#include "termchar.h" |
#include "termchar.h" |
177 |
#include "dispextern.h" |
#include "dispextern.h" |
178 |
#include "buffer.h" |
#include "buffer.h" |
179 |
|
#include "character.h" |
180 |
#include "charset.h" |
#include "charset.h" |
181 |
#include "indent.h" |
#include "indent.h" |
182 |
#include "commands.h" |
#include "commands.h" |
4232 |
else if ((it->c < ' ' |
else if ((it->c < ' ' |
4233 |
&& (it->area != TEXT_AREA |
&& (it->area != TEXT_AREA |
4234 |
|| (it->c != '\n' && it->c != '\t'))) |
|| (it->c != '\n' && it->c != '\t'))) |
4235 |
|| (it->c >= 127 |
|| (it->multibyte_p ? CHAR_BYTE8_P (it->c) : it->c >= 127) |
4236 |
&& it->len == 1) |
|| (it->c != '\n' && it->c != '\t' |
4237 |
|| !CHAR_PRINTABLE_P (it->c)) |
&& !CHAR_PRINTABLE_P (it->c))) |
4238 |
{ |
{ |
4239 |
/* IT->c is a control character which must be displayed |
/* IT->c is a control character which must be displayed |
4240 |
either as '\003' or as `^C' where the '\\' and '^' |
either as '\003' or as `^C' where the '\\' and '^' |
4280 |
else |
else |
4281 |
escape_glyph = FAST_MAKE_GLYPH ('\\', 0); |
escape_glyph = FAST_MAKE_GLYPH ('\\', 0); |
4282 |
|
|
4283 |
if (SINGLE_BYTE_CHAR_P (it->c)) |
if (CHAR_BYTE8_P (it->c)) |
4284 |
str[0] = it->c, len = 1; |
{ |
4285 |
|
str[0] = CHAR_TO_BYTE8 (it->c); |
4286 |
|
len = 1; |
4287 |
|
} |
4288 |
|
else if (it->c < 256) |
4289 |
|
{ |
4290 |
|
str[0] = it->c; |
4291 |
|
len = 1; |
4292 |
|
} |
4293 |
else |
else |
4294 |
{ |
{ |
4295 |
len = CHAR_STRING_NO_SIGNAL (it->c, str); |
/* It's an invalid character, which |
4296 |
if (len < 0) |
shouldn't happen actually, but due to |
4297 |
{ |
bugs it may happen. Let's print the char |
4298 |
/* It's an invalid character, which |
as is, there's not much meaningful we can |
4299 |
shouldn't happen actually, but due to |
do with it. */ |
4300 |
bugs it may happen. Let's print the char |
str[0] = it->c; |
4301 |
as is, there's not much meaningful we can |
str[1] = it->c >> 8; |
4302 |
do with it. */ |
str[2] = it->c >> 16; |
4303 |
str[0] = it->c; |
str[3] = it->c >> 24; |
4304 |
str[1] = it->c >> 8; |
len = 4; |
|
str[2] = it->c >> 16; |
|
|
str[3] = it->c >> 24; |
|
|
len = 4; |
|
|
} |
|
4305 |
} |
} |
4306 |
|
|
4307 |
for (i = 0; i < len; i++) |
for (i = 0; i < len; i++) |
9240 |
struct Lisp_Char_Table *dp; |
struct Lisp_Char_Table *dp; |
9241 |
int c; |
int c; |
9242 |
{ |
{ |
|
int code[4], i; |
|
9243 |
Lisp_Object val; |
Lisp_Object val; |
9244 |
|
|
9245 |
if (SINGLE_BYTE_CHAR_P (c)) |
if (ASCII_CHAR_P (c)) |
9246 |
return (dp->contents[c]); |
{ |
9247 |
|
val = dp->ascii; |
9248 |
SPLIT_CHAR (c, code[0], code[1], code[2]); |
if (SUB_CHAR_TABLE_P (val)) |
9249 |
if (code[1] < 32) |
val = XSUB_CHAR_TABLE (val)->contents[c]; |
9250 |
code[1] = -1; |
} |
9251 |
else if (code[2] < 32) |
else |
9252 |
code[2] = -1; |
{ |
9253 |
|
Lisp_Object table; |
9254 |
/* Here, the possible range of code[0] (== charset ID) is |
|
9255 |
128..max_charset. Since the top level char table contains data |
XSETCHAR_TABLE (table, dp); |
9256 |
for multibyte characters after 256th element, we must increment |
val = char_table_ref (table, c); |
9257 |
code[0] by 128 to get a correct index. */ |
} |
9258 |
code[0] += 128; |
if (NILP (val)) |
9259 |
code[3] = -1; /* anchor */ |
val = dp->defalt; |
9260 |
|
return val; |
9261 |
for (i = 0; code[i] >= 0; i++, dp = XCHAR_TABLE (val)) |
} |
|
{ |
|
|
val = dp->contents[code[i]]; |
|
|
if (!SUB_CHAR_TABLE_P (val)) |
|
|
return (NILP (val) ? dp->defalt : val); |
|
|
} |
|
|
|
|
|
/* Here, val is a sub char table. We return the default value of |
|
|
it. */ |
|
|
return (dp->defalt); |
|
|
} |
|
9262 |
|
|
9263 |
|
|
9264 |
|
|
13940 |
/* The EOL conversion we are using. */ |
/* The EOL conversion we are using. */ |
13941 |
Lisp_Object eoltype; |
Lisp_Object eoltype; |
13942 |
|
|
13943 |
val = Fget (coding_system, Qcoding_system); |
val = CODING_SYSTEM_SPEC (coding_system); |
13944 |
eoltype = Qnil; |
eoltype = Qnil; |
13945 |
|
|
13946 |
if (!VECTORP (val)) /* Not yet decided. */ |
if (!VECTORP (val)) /* Not yet decided. */ |
13953 |
} |
} |
13954 |
else |
else |
13955 |
{ |
{ |
13956 |
|
Lisp_Object attrs; |
13957 |
Lisp_Object eolvalue; |
Lisp_Object eolvalue; |
13958 |
|
|
13959 |
eolvalue = Fget (coding_system, Qeol_type); |
attrs = AREF (val, 0); |
13960 |
|
eolvalue = AREF (val, 2); |
13961 |
|
|
13962 |
if (multibyte) |
if (multibyte) |
13963 |
*buf++ = XFASTINT (AREF (val, 1)); |
*buf++ = XFASTINT (CODING_ATTR_MNEMONIC (attrs)); |
13964 |
|
|
13965 |
if (eol_flag) |
if (eol_flag) |
13966 |
{ |
{ |
13970 |
eoltype = eol_mnemonic_undecided; |
eoltype = eol_mnemonic_undecided; |
13971 |
else if (VECTORP (eolvalue)) /* Not yet decided. */ |
else if (VECTORP (eolvalue)) /* Not yet decided. */ |
13972 |
eoltype = eol_mnemonic_undecided; |
eoltype = eol_mnemonic_undecided; |
13973 |
else /* INTEGERP (eolvalue) -- 0:LF, 1:CRLF, 2:CR */ |
else /* eolvalue is Qunix, Qdos, or Qmac. */ |
13974 |
eoltype = (XFASTINT (eolvalue) == 0 |
eoltype = (EQ (eolvalue, Qunix) |
13975 |
? eol_mnemonic_unix |
? eol_mnemonic_unix |
13976 |
: (XFASTINT (eolvalue) == 1 |
: (EQ (eolvalue, Qdos) == 1 |
13977 |
? eol_mnemonic_dos : eol_mnemonic_mac)); |
? eol_mnemonic_dos : eol_mnemonic_mac)); |
13978 |
} |
} |
13979 |
} |
} |
14335 |
{ |
{ |
14336 |
/* No need to mention EOL here--the terminal never needs |
/* No need to mention EOL here--the terminal never needs |
14337 |
to do EOL conversion. */ |
to do EOL conversion. */ |
14338 |
p = decode_mode_spec_coding (keyboard_coding.symbol, p, 0); |
p = decode_mode_spec_coding (CODING_ID_NAME (keyboard_coding.id), |
14339 |
p = decode_mode_spec_coding (terminal_coding.symbol, p, 0); |
p, 0); |
14340 |
|
p = decode_mode_spec_coding (CODING_ID_NAME (terminal_coding.id), |
14341 |
|
p, 0); |
14342 |
} |
} |
14343 |
p = decode_mode_spec_coding (b->buffer_file_coding_system, |
p = decode_mode_spec_coding (b->buffer_file_coding_system, |
14344 |
p, eol_flag); |
p, eol_flag); |