Skip to content

Instantly share code, notes, and snippets.

@ganta
Forked from n-miyo/gist:1250669
Created June 13, 2012 15:13
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save ganta/2924676 to your computer and use it in GitHub Desktop.
patch for emacs-inline.patch: Use preferredLanguages instead of currentLocale. (Deal with Emacs 24.1)
*** a/src/macim.m 2012-06-12 13:09:43.000000000 +0900
--- b/src/macim.m 2012-06-12 13:11:47.000000000 +0900
***************
*** 99,105 ****
}
else
{
! NSString *locale = [[NSLocale currentLocale] localeIdentifier];
is = TISCopyInputSourceForLanguage((CFStringRef)locale);
}
if (is) TISSelectInputSource(is);
--- 99,111 ----
}
else
{
! NSString *locale;
! NSArray *languages = [NSLocale preferredLanguages];
! if (languages != nil) {
! locale = [languages objectAtIndex:0];
! } else {
! locale = [[NSLocale currentLocale] objectForKey:NSLocaleLanguageCode];
! }
is = TISCopyInputSourceForLanguage((CFStringRef)locale);
}
if (is) TISSelectInputSource(is);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment