/[emacs]/emacs/src/mac.c
ViewVC logotype

Diff of /emacs/src/mac.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.31 by mituharu, Wed Apr 6 02:23:37 2005 UTC revision 1.32 by mituharu, Thu Apr 14 09:25:01 2005 UTC
# Line 49  Boston, MA 02111-1307, USA.  */ Line 49  Boston, MA 02111-1307, USA.  */
49  #include <Events.h>  #include <Events.h>
50  #include <Processes.h>  #include <Processes.h>
51  #include <EPPC.h>  #include <EPPC.h>
52    #include <MacLocales.h>
53  #endif  /* not HAVE_CARBON */  #endif  /* not HAVE_CARBON */
54    
55  #include <utime.h>  #include <utime.h>
# Line 67  Boston, MA 02111-1307, USA.  */ Line 68  Boston, MA 02111-1307, USA.  */
68    
69  Lisp_Object QCLIPBOARD;  Lisp_Object QCLIPBOARD;
70    
71    /* The system script code. */
72    static int mac_system_script_code;
73    
74    /* The system locale identifier string.  */
75    static Lisp_Object Vmac_system_locale;
76    
77  /* An instance of the AppleScript component.  */  /* An instance of the AppleScript component.  */
78  static ComponentInstance as_scripting_component;  static ComponentInstance as_scripting_component;
79  /* The single script context used for all script executions.  */  /* The single script context used for all script executions.  */
# Line 4167  init_mac_osx_environment () Line 4174  init_mac_osx_environment ()
4174  }  }
4175  #endif /* MAC_OSX */  #endif /* MAC_OSX */
4176    
4177    
4178    static Lisp_Object
4179    mac_get_system_locale ()
4180    {
4181      OSErr err;
4182      LangCode lang;
4183      RegionCode region;
4184      LocaleRef locale;
4185      Str255 str;
4186    
4187      lang = GetScriptVariable (smSystemScript, smScriptLang);
4188      region = GetScriptManagerVariable (smRegionCode);
4189      err = LocaleRefFromLangOrRegionCode (lang, region, &locale);
4190      if (err == noErr)
4191        err = LocaleRefGetPartString (locale, kLocaleAllPartsMask,
4192                                      sizeof (str), str);
4193      if (err == noErr)
4194        return build_string (str);
4195      else
4196        return Qnil;
4197    }
4198    
4199    
4200  void  void
4201  syms_of_mac ()  syms_of_mac ()
4202  {  {
# Line 4197  syms_of_mac () Line 4227  syms_of_mac ()
4227    defsubr (&Sdo_applescript);    defsubr (&Sdo_applescript);
4228    defsubr (&Smac_file_name_to_posix);    defsubr (&Smac_file_name_to_posix);
4229    defsubr (&Sposix_file_name_to_mac);    defsubr (&Sposix_file_name_to_mac);
4230    
4231      DEFVAR_INT ("mac-system-script-code", &mac_system_script_code,
4232        doc: /* The system script code.  */);
4233      mac_system_script_code = (ScriptCode) GetScriptManagerVariable (smSysScript);
4234    
4235      DEFVAR_LISP ("mac-system-locale", &Vmac_system_locale,
4236        doc: /* The system locale identifier string.
4237    This is not a POSIX locale ID, but an ICU locale ID.  So encoding
4238    information is not included.  */);
4239      Vmac_system_locale = mac_get_system_locale ();
4240  }  }
4241    
4242  /* arch-tag: 29d30c1f-0c6b-4f88-8a6d-0558d7f9dbff  /* arch-tag: 29d30c1f-0c6b-4f88-8a6d-0558d7f9dbff

Legend:
Removed from v.1.31  
changed lines
  Added in v.1.32

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26