diff options
| author | Paul Eggert | 2020-01-26 00:20:40 -0800 |
|---|---|---|
| committer | Paul Eggert | 2020-01-26 00:34:38 -0800 |
| commit | 26d890c9ccb1e95f5451432bb6bb764b590b165e (patch) | |
| tree | 2d664b3db019513ba11021eff23c7bed735fcdb9 /src | |
| parent | e97da6b08b1849fa9138fffce01e2ed0b8e2cc5c (diff) | |
| download | emacs-26d890c9ccb1e95f5451432bb6bb764b590b165e.tar.gz emacs-26d890c9ccb1e95f5451432bb6bb764b590b165e.zip | |
Propagate NSLocale into Emacs better
* src/emacs.c (main): Call ns_init_locale before using the
environment variable that ns_init_locale sets up (Bug#39248).
Diffstat (limited to 'src')
| -rw-r--r-- | src/emacs.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/src/emacs.c b/src/emacs.c index 4b5d00a0e80..c170333e603 100644 --- a/src/emacs.c +++ b/src/emacs.c | |||
| @@ -1242,6 +1242,9 @@ main (int argc, char **argv) | |||
| 1242 | char *lc_all = getenv ("LC_ALL"); | 1242 | char *lc_all = getenv ("LC_ALL"); |
| 1243 | if (! (lc_all && strcmp (lc_all, "C") == 0)) | 1243 | if (! (lc_all && strcmp (lc_all, "C") == 0)) |
| 1244 | { | 1244 | { |
| 1245 | #ifdef HAVE_NS | ||
| 1246 | ns_init_locale (); | ||
| 1247 | #endif | ||
| 1245 | setlocale (LC_ALL, ""); | 1248 | setlocale (LC_ALL, ""); |
| 1246 | fixup_locale (); | 1249 | fixup_locale (); |
| 1247 | } | 1250 | } |
| @@ -1610,10 +1613,6 @@ Using an Emacs configured with --with-x-toolkit=lucid does not have this problem | |||
| 1610 | 1613 | ||
| 1611 | #ifdef HAVE_NS | 1614 | #ifdef HAVE_NS |
| 1612 | ns_pool = ns_alloc_autorelease_pool (); | 1615 | ns_pool = ns_alloc_autorelease_pool (); |
| 1613 | #ifdef NS_IMPL_GNUSTEP | ||
| 1614 | /* GNUstep stupidly resets our locale settings after we made them. */ | ||
| 1615 | fixup_locale (); | ||
| 1616 | #endif | ||
| 1617 | 1616 | ||
| 1618 | if (!noninteractive) | 1617 | if (!noninteractive) |
| 1619 | { | 1618 | { |
| @@ -1724,11 +1723,6 @@ Using an Emacs configured with --with-x-toolkit=lucid does not have this problem | |||
| 1724 | globals_of_gfilenotify (); | 1723 | globals_of_gfilenotify (); |
| 1725 | #endif | 1724 | #endif |
| 1726 | 1725 | ||
| 1727 | #ifdef HAVE_NS | ||
| 1728 | /* Initialize the locale from user defaults. */ | ||
| 1729 | ns_init_locale (); | ||
| 1730 | #endif | ||
| 1731 | |||
| 1732 | /* Initialize and GC-protect Vinitial_environment and | 1726 | /* Initialize and GC-protect Vinitial_environment and |
| 1733 | Vprocess_environment before set_initial_environment fills them | 1727 | Vprocess_environment before set_initial_environment fills them |
| 1734 | in. */ | 1728 | in. */ |