comparison src/xdisp.c @ 24199:204d0a24ddf5

(decode_mode_spec_coding): Display the EOL type as a string.
author Eli Zaretskii <eliz@gnu.org>
date Wed, 27 Jan 1999 10:06:21 +0000
parents d178122d6122
children 6e1f6e29422a
comparison
equal deleted inserted replaced
24198:ee8046b6187d 24199:204d0a24ddf5
4554 4554
4555 /* Set a mnemonic character for CODING_SYSTEM (Lisp symbol) in BUF. 4555 /* Set a mnemonic character for CODING_SYSTEM (Lisp symbol) in BUF.
4556 If EOL_FLAG is 1, set also a mnemonic character for end-of-line 4556 If EOL_FLAG is 1, set also a mnemonic character for end-of-line
4557 type of CODING_SYSTEM. Return updated pointer into BUF. */ 4557 type of CODING_SYSTEM. Return updated pointer into BUF. */
4558 4558
4559 static char invalid_eol_type[] = "(*invalid*)";
4560
4559 static char * 4561 static char *
4560 decode_mode_spec_coding (coding_system, buf, eol_flag) 4562 decode_mode_spec_coding (coding_system, buf, eol_flag)
4561 Lisp_Object coding_system; 4563 Lisp_Object coding_system;
4562 register char *buf; 4564 register char *buf;
4563 int eol_flag; 4565 int eol_flag;
4591 if (multibyte) 4593 if (multibyte)
4592 *buf++ = XFASTINT (XVECTOR (val)->contents[1]); 4594 *buf++ = XFASTINT (XVECTOR (val)->contents[1]);
4593 4595
4594 if (eol_flag) 4596 if (eol_flag)
4595 { 4597 {
4598 unsigned char *eol_str;
4599 int eol_str_len;
4596 /* The EOL conversion we are using. */ 4600 /* The EOL conversion we are using. */
4597 int eoltype; 4601 Lisp_Object eoltype;
4598 /* The EOL conversion that is normal on this system. */ 4602 /* The EOL conversion that is normal on this system. */
4599 4603
4600 if (NILP (eolvalue)) /* Not yet decided. */ 4604 if (NILP (eolvalue)) /* Not yet decided. */
4601 eoltype = eol_mnemonic_undecided; 4605 eoltype = eol_mnemonic_undecided;
4602 else if (VECTORP (eolvalue)) /* Not yet decided. */ 4606 else if (VECTORP (eolvalue)) /* Not yet decided. */
4606 ? eol_mnemonic_unix 4610 ? eol_mnemonic_unix
4607 : (XFASTINT (eolvalue) == 1 4611 : (XFASTINT (eolvalue) == 1
4608 ? eol_mnemonic_dos : eol_mnemonic_mac)); 4612 ? eol_mnemonic_dos : eol_mnemonic_mac));
4609 4613
4610 /* Mention the EOL conversion if it is not the usual one. */ 4614 /* Mention the EOL conversion if it is not the usual one. */
4611 *buf++ = eoltype; 4615 if (STRINGP (eoltype))
4616 {
4617 eol_str = XSTRING (eoltype)->data;
4618 eol_str_len = XSTRING (eoltype)->size;
4619 }
4620 else
4621 {
4622 eol_str = invalid_eol_type;
4623 eol_str_len = sizeof (invalid_eol_type) - 1;
4624 }
4625 strcpy (buf, eol_str);
4626 buf += eol_str_len;
4612 } 4627 }
4613 } 4628 }
4614 return buf; 4629 return buf;
4615 } 4630 }
4616 4631