comparison src/xdisp.c @ 24215:6e1f6e29422a

(decode_mode_spec_coding): Fix previous change.
author Eli Zaretskii <eliz@gnu.org>
date Thu, 28 Jan 1999 16:30:23 +0000
parents 204d0a24ddf5
children 2612f75bdd2a
comparison
equal deleted inserted replaced
24214:4fb0bce809bc 24215:6e1f6e29422a
4564 register char *buf; 4564 register char *buf;
4565 int eol_flag; 4565 int eol_flag;
4566 { 4566 {
4567 Lisp_Object val; 4567 Lisp_Object val;
4568 int multibyte = !NILP (current_buffer->enable_multibyte_characters); 4568 int multibyte = !NILP (current_buffer->enable_multibyte_characters);
4569 unsigned char *eol_str;
4570 int eol_str_len;
4571 /* The EOL conversion we are using. */
4572 Lisp_Object eoltype;
4569 4573
4570 val = coding_system; 4574 val = coding_system;
4571 4575
4572 if (NILP (val)) /* Not yet decided. */ 4576 if (NILP (val)) /* Not yet decided. */
4573 { 4577 {
4574 if (multibyte) 4578 if (multibyte)
4575 *buf++ = '-'; 4579 *buf++ = '-';
4576 if (eol_flag) 4580 if (eol_flag)
4577 *buf++ = eol_mnemonic_undecided; 4581 eoltype = eol_mnemonic_undecided;
4578 /* Don't mention EOL conversion if it isn't decided. */ 4582 /* Don't mention EOL conversion if it isn't decided. */
4579 } 4583 }
4580 else 4584 else
4581 { 4585 {
4582 Lisp_Object eolvalue; 4586 Lisp_Object eolvalue;
4593 if (multibyte) 4597 if (multibyte)
4594 *buf++ = XFASTINT (XVECTOR (val)->contents[1]); 4598 *buf++ = XFASTINT (XVECTOR (val)->contents[1]);
4595 4599
4596 if (eol_flag) 4600 if (eol_flag)
4597 { 4601 {
4598 unsigned char *eol_str;
4599 int eol_str_len;
4600 /* The EOL conversion we are using. */
4601 Lisp_Object eoltype;
4602 /* The EOL conversion that is normal on this system. */ 4602 /* The EOL conversion that is normal on this system. */
4603 4603
4604 if (NILP (eolvalue)) /* Not yet decided. */ 4604 if (NILP (eolvalue)) /* Not yet decided. */
4605 eoltype = eol_mnemonic_undecided; 4605 eoltype = eol_mnemonic_undecided;
4606 else if (VECTORP (eolvalue)) /* Not yet decided. */ 4606 else if (VECTORP (eolvalue)) /* Not yet decided. */
4608 else /* INTEGERP (eolvalue) -- 0:LF, 1:CRLF, 2:CR */ 4608 else /* INTEGERP (eolvalue) -- 0:LF, 1:CRLF, 2:CR */
4609 eoltype = (XFASTINT (eolvalue) == 0 4609 eoltype = (XFASTINT (eolvalue) == 0
4610 ? eol_mnemonic_unix 4610 ? eol_mnemonic_unix
4611 : (XFASTINT (eolvalue) == 1 4611 : (XFASTINT (eolvalue) == 1
4612 ? eol_mnemonic_dos : eol_mnemonic_mac)); 4612 ? eol_mnemonic_dos : eol_mnemonic_mac));
4613 4613 }
4614 /* Mention the EOL conversion if it is not the usual one. */ 4614 }
4615 if (STRINGP (eoltype)) 4615
4616 { 4616 if (eol_flag)
4617 eol_str = XSTRING (eoltype)->data; 4617 {
4618 eol_str_len = XSTRING (eoltype)->size; 4618 /* Mention the EOL conversion if it is not the usual one. */
4619 } 4619 if (STRINGP (eoltype))
4620 else 4620 {
4621 { 4621 eol_str = XSTRING (eoltype)->data;
4622 eol_str = invalid_eol_type; 4622 eol_str_len = XSTRING (eoltype)->size;
4623 eol_str_len = sizeof (invalid_eol_type) - 1; 4623 }
4624 } 4624 else
4625 strcpy (buf, eol_str); 4625 {
4626 buf += eol_str_len; 4626 eol_str = invalid_eol_type;
4627 } 4627 eol_str_len = sizeof (invalid_eol_type) - 1;
4628 } 4628 }
4629 strcpy (buf, eol_str);
4630 buf += eol_str_len;
4631 }
4632
4629 return buf; 4633 return buf;
4630 } 4634 }
4631 4635
4632 /* Return a string for the output of a mode line %-spec for window W, 4636 /* Return a string for the output of a mode line %-spec for window W,
4633 generated by character C. SPEC_WIDTH is the field width when 4637 generated by character C. SPEC_WIDTH is the field width when