Created
September 29, 2011 12:53
-
-
Save n-miyo/1250669 to your computer and use it in GitHub Desktop.
patch for emacs-inline.patch: Use preferredLanguages instead of currentLocale.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/macim.m b/src/macim.m | |
index d4444db..515cf25 100644 | |
--- a/src/macim.m | |
+++ b/src/macim.m | |
@@ -100,7 +100,14 @@ DEFUN ("mac-toggle-input-source", Fmac_toggle_input_source, | |
} | |
else | |
{ | |
- NSString *locale = [[NSLocale currentLocale] localeIdentifier]; | |
+ NSString *locale; | |
+ NSArray *languages = [NSLocale preferredLanguages]; | |
+ if (languages != nil) { | |
+ locale = [languages objectAtIndex:0]; | |
+ } else { | |
+ locale = [[NSLocale currentLocale] | |
+ objectForKey:NSLocaleLanguageCode]; | |
+ } | |
is = TISCopyInputSourceForLanguage(locale); | |
} | |
if (is) TISSelectInputSource(is); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
see: http://blogger.tempus.org/2011/09/cocoa-emacs-23ime-patchpreferred.html