# HG changeset patch # User Dave Love # Date 1023820348 0 # Node ID b908df09ec8a863337de60c02cd356c911a89acf # Parent baa14ec2c76bf1d64a4054d2d18438a20154762f (count_combining): Comment out (unused). (Flocale_codeset): New. (syms_of_fns): Defsubr it. diff -r baa14ec2c76b -r b908df09ec8a src/fns.c --- a/src/fns.c Tue Jun 11 18:31:18 2002 +0000 +++ b/src/fns.c Tue Jun 11 18:32:28 2002 +0000 @@ -474,6 +474,7 @@ return concat (1, &arg, CONSP (arg) ? Lisp_Cons : XTYPE (arg), 0); } +#if 0 /* unused */ /* In string STR of length LEN, see if bytes before STR[I] combine with bytes after STR[I] to form a single character. If so, return the number of bytes after STR[I] which combine in this way. @@ -494,6 +495,7 @@ PARSE_MULTIBYTE_SEQ (str + j, len - j, bytes); return (bytes <= i - j ? 0 : bytes - (i - j)); } +#endif /* This structure holds information of an argument of `concat' that is a string and has text properties to be copied. */ @@ -2730,6 +2732,25 @@ UNGCPRO; return result; } + +#ifdef HAVE_LANGINFO_CODESET +#include +#endif + +/* Fixme: is it useful to get more general info from the locale? */ +DEFUN ("locale-codeset", Flocale_codeset, Slocale_codeset, 0, 0, 0, + doc: /* Return a string indicating the code set in the current locale. +If the system can't provide such information through a call to +nl_langinfo(3), return nil. */) + () +{ +#ifdef HAVE_LANGINFO_CODESET + char *str = nl_langinfo (CODESET); + return make_string (str, strlen (str)); +#else + return Qnil; +#endif +} /* base64 encode/decode functions (RFC 2045). Based on code from GNU recode. */ @@ -4866,6 +4887,7 @@ defsubr (&Sbase64_encode_string); defsubr (&Sbase64_decode_string); defsubr (&Smd5); + defsubr (&Slocale_codeset); }