Mercurial > emacs
comparison src/xterm.c @ 23115:b992f7bb67d7
(fixup_locale): New function. For now, it resets
LC_TIME to "C" (reverting the 1998-08-07 change), and also
resets LC_MESSAGES to "C".
(x_term_init): Use it to fix up the locale after setlocale
(LC_ALL, "").
author | Paul Eggert <eggert@twinsun.com> |
---|---|
date | Thu, 27 Aug 1998 02:00:35 +0000 |
parents | 44eda932afcf |
children | dad3317e5d8c |
comparison
equal
deleted
inserted
replaced
23114:e51b304d8195 | 23115:b992f7bb67d7 |
---|---|
6948 && (*name1 == '.' || *name1 == '\0') | 6948 && (*name1 == '.' || *name1 == '\0') |
6949 && (*name2 == '.' || *name2 == '\0')); | 6949 && (*name2 == '.' || *name2 == '\0')); |
6950 } | 6950 } |
6951 #endif | 6951 #endif |
6952 | 6952 |
6953 #if defined (HAVE_X_I18N) || (defined (USE_X_TOOLKIT) && defined (HAVE_X11XTR6)) | |
6954 /* Recover from setlocale (LC_ALL, ""). */ | |
6955 static void | |
6956 fixup_locale () | |
6957 { | |
6958 /* Currently we require strerror to use the "C" locale, | |
6959 since we don't yet support decoding its string result. */ | |
6960 #ifdef LC_MESSAGES | |
6961 setlocale (LC_MESSAGES, "C"); | |
6962 #endif | |
6963 | |
6964 /* The Emacs Lisp reader needs LC_NUMERIC to be "C", | |
6965 so that numbers are read and printed properly for Emacs Lisp. */ | |
6966 setlocale (LC_NUMERIC, "C"); | |
6967 | |
6968 /* Currently we require strftime to use the "C" locale, | |
6969 since we don't yet support encoding its format argument, | |
6970 or decoding its string result. */ | |
6971 setlocale (LC_TIME, "C"); | |
6972 } | |
6973 #endif | |
6974 | |
6953 struct x_display_info * | 6975 struct x_display_info * |
6954 x_term_init (display_name, xrm_option, resource_name) | 6976 x_term_init (display_name, xrm_option, resource_name) |
6955 Lisp_Object display_name; | 6977 Lisp_Object display_name; |
6956 char *xrm_option; | 6978 char *xrm_option; |
6957 char *resource_name; | 6979 char *resource_name; |
6971 x_initialized = 1; | 6993 x_initialized = 1; |
6972 } | 6994 } |
6973 | 6995 |
6974 #ifdef HAVE_X_I18N | 6996 #ifdef HAVE_X_I18N |
6975 setlocale (LC_ALL, ""); | 6997 setlocale (LC_ALL, ""); |
6976 /* In case we just overrode what init_lread did, redo it. */ | 6998 fixup_locale (); |
6977 setlocale (LC_NUMERIC, "C"); | |
6978 #endif | 6999 #endif |
6979 | 7000 |
6980 #ifdef USE_X_TOOLKIT | 7001 #ifdef USE_X_TOOLKIT |
6981 /* weiner@footloose.sps.mot.com reports that this causes | 7002 /* weiner@footloose.sps.mot.com reports that this causes |
6982 errors with X11R5: | 7003 errors with X11R5: |
7003 emacs_options, XtNumber (emacs_options), | 7024 emacs_options, XtNumber (emacs_options), |
7004 &argc, argv); | 7025 &argc, argv); |
7005 | 7026 |
7006 #ifdef HAVE_X11XTR6 | 7027 #ifdef HAVE_X11XTR6 |
7007 /* I think this is to compensate for XtSetLanguageProc. */ | 7028 /* I think this is to compensate for XtSetLanguageProc. */ |
7008 setlocale (LC_NUMERIC, "C"); | 7029 fixup_locale (); |
7009 #endif | 7030 #endif |
7010 } | 7031 } |
7011 | 7032 |
7012 #else /* not USE_X_TOOLKIT */ | 7033 #else /* not USE_X_TOOLKIT */ |
7013 #ifdef HAVE_X11R5 | 7034 #ifdef HAVE_X11R5 |