/* Char table for translating Quail and self-inserting input. */
Lisp_Object Vtranslation_table_for_input;
-/* Global flag to tell that we can't call post-read-conversion and
- pre-write-conversion functions. Usually the value is zero, but it
- is set to 1 temporarily while such functions are running. This is
- to avoid infinite recursive call. */
-static int inhibit_pre_post_conversion;
-
/* Two special coding systems. */
Lisp_Object Vsjis_coding_system;
Lisp_Object Vbig5_coding_system;
static unsigned char *
alloc_destination (coding, nbytes, dst)
struct coding_system *coding;
- int nbytes;
+ EMACS_INT nbytes;
unsigned char *dst;
{
EMACS_INT offset = dst - coding->destination;
int preferred_charset_id = -1;
CODING_GET_INFO (coding, attrs, eol_type, charset_list);
+ if (! EQ (charset_list, Vemacs_mule_charset_list))
+ {
+ CODING_ATTR_CHARSET_LIST (attrs)
+ = charset_list = Vemacs_mule_charset_list;
+ }
while (charbuf < charbuf_end)
{
if (leading_codes[1])
EMIT_ONE_BYTE (leading_codes[1]);
if (dimension == 1)
- EMIT_ONE_BYTE (code);
+ EMIT_ONE_BYTE (code | 0x80);
else
{
+ code |= 0x8080;
EMIT_ONE_BYTE (code >> 8);
EMIT_ONE_BYTE (code & 0xFF);
}
coding_inherit_eol_type (coding_system, parent)
Lisp_Object coding_system, parent;
{
- Lisp_Object spec, attrs, eol_type;
+ Lisp_Object spec, eol_type;
if (NILP (coding_system))
coding_system = Qraw_text;
spec = CODING_SYSTEM_SPEC (coding_system);
- attrs = AREF (spec, 0);
eol_type = AREF (spec, 2);
if (VECTORP (eol_type)
&& ! NILP (parent))
&& ! EQ (coding_type, Qccl))
{
int eol_seen = detect_eol (coding->source, coding->src_bytes,
- XINT (CODING_ATTR_CATEGORY (attrs)));
+ (enum coding_category) XINT (CODING_ATTR_CATEGORY (attrs)));
if (eol_seen != EOL_SEEN_NONE)
adjust_coding_eol_type (coding, eol_seen);
/* Note: composition handling is not yet implemented. */
coding->common_flags &= ~CODING_ANNOTATE_COMPOSITION_MASK;
- if (coding->common_flags & CODING_ANNOTATE_COMPOSITION_MASK)
- stop = stop_composition = pos;
- else
- stop = stop_composition = end_pos;
- if (coding->common_flags & CODING_ANNOTATE_CHARSET_MASK)
- stop = stop_charset = pos;
+ if (NILP (coding->src_object))
+ stop = stop_composition = stop_charset = end_pos;
else
- stop_charset = end_pos;
+ {
+ if (coding->common_flags & CODING_ANNOTATE_COMPOSITION_MASK)
+ stop = stop_composition = pos;
+ else
+ stop = stop_composition = end_pos;
+ if (coding->common_flags & CODING_ANNOTATE_CHARSET_MASK)
+ stop = stop_charset = pos;
+ else
+ stop_charset = end_pos;
+ }
/* Compensate for CRLF and annotation. */
buf_end -= 1 + MAX_ANNOTATION_LENGTH;
if (EQ (coding_type, Qcharset))
{
- Lisp_Object list;
/* Generate a lisp vector of 256 elements. Each element is nil,
integer, or a list of charset IDs.
If Nth element is a list of charset IDs, N is the first byte
of one of them. The list is sorted by dimensions of the
- charsets. A charset of smaller dimension comes firtst.
- */
- for (list = Qnil, tail = charset_list; CONSP (tail); tail = XCDR (tail))
- {
- struct charset *charset = CHARSET_FROM_ID (XFASTINT (XCAR (tail)));
-
- if (charset->method == CHARSET_METHOD_SUPERSET)
- {
- val = CHARSET_SUPERSET (charset);
- for (; CONSP (val); val = XCDR (val))
- list = Fcons (XCAR (XCAR (val)), list);
- }
- else
- list = Fcons (XCAR (tail), list);
- }
-
+ charsets. A charset of smaller dimension comes firtst. */
val = Fmake_vector (make_number (256), Qnil);
- for (tail = Fnreverse (list); CONSP (tail); tail = XCDR (tail))
+ for (tail = charset_list; CONSP (tail); tail = XCDR (tail))
{
struct charset *charset = CHARSET_FROM_ID (XFASTINT (XCAR (tail)));
int dim = CHARSET_DIMENSION (charset);
make_number (nargs)));
}
-/* Fixme: should this record the alias relationships for
- diagnostics? Should it update coding-system-list? */
+
DEFUN ("define-coding-system-alias", Fdefine_coding_system_alias,
Sdefine_coding_system_alias, 2, 2, 0,
doc: /* Define ALIAS as an alias for CODING-SYSTEM. */)
CHECK_SYMBOL (alias);
CHECK_CODING_SYSTEM_GET_SPEC (coding_system, spec);
aliases = AREF (spec, 1);
+ /* ALISES should be a list of length more than zero, and the first
+ element is a base coding system. Append ALIAS at the tail of the
+ list. */
while (!NILP (XCDR (aliases)))
aliases = XCDR (aliases);
XSETCDR (aliases, Fcons (alias, Qnil));
for (i = 0; i < 3; i++)
Fdefine_coding_system_alias (AREF (subsidiaries, i),
AREF (eol_type, i));
-
- ASET (spec, 2, subsidiaries);
}
Fputhash (alias, spec, Vcoding_system_hash_table);
+ Vcoding_system_list = Fcons (alias, Vcoding_system_list);
Vcoding_system_alist = Fcons (Fcons (Fsymbol_name (alias), Qnil),
Vcoding_system_alist);
iso_code_class[ISO_CODE_SS3] = ISO_single_shift_3;
iso_code_class[ISO_CODE_CSI] = ISO_control_sequence_introducer;
- inhibit_pre_post_conversion = 0;
-
for (i = 0; i < 256; i++)
{
emacs_mule_bytes[i] = 1;