emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/src/mac.c


From: YAMAMOTO Mitsuharu
Subject: [Emacs-diffs] Changes to emacs/src/mac.c
Date: Sat, 23 Jul 2005 03:47:52 -0400

Index: emacs/src/mac.c
diff -c emacs/src/mac.c:1.42 emacs/src/mac.c:1.43
*** emacs/src/mac.c:1.42        Thu Jul 21 05:36:04 2005
--- emacs/src/mac.c     Sat Jul 23 07:47:51 2005
***************
*** 59,69 ****
  #include <dirent.h>
  #include <sys/types.h>
  #include <sys/stat.h>
- #include <string.h>
  #include <pwd.h>
  #include <grp.h>
  #include <sys/param.h>
- #include <stdlib.h>
  #include <fcntl.h>
  #if __MWERKS__
  #include <unistd.h>
--- 59,67 ----
***************
*** 3447,3453 ****
  
  DEFUN ("mac-get-file-creator", Fmac_get_file_creator, Smac_get_file_creator, 
1, 1, 0,
         doc: /* Get the creator code of FILENAME as a four character string. 
*/)
!   (filename)
       Lisp_Object filename;
  {
    OSErr       status;
--- 3445,3451 ----
  
  DEFUN ("mac-get-file-creator", Fmac_get_file_creator, Smac_get_file_creator, 
1, 1, 0,
         doc: /* Get the creator code of FILENAME as a four character string. 
*/)
!      (filename)
       Lisp_Object filename;
  {
    OSErr       status;
***************
*** 3502,3508 ****
  
  DEFUN ("mac-get-file-type", Fmac_get_file_type, Smac_get_file_type, 1, 1, 0,
         doc: /* Get the type code of FILENAME as a four character string. */)
!   (filename)
       Lisp_Object filename;
  {
    OSErr       status;
--- 3500,3506 ----
  
  DEFUN ("mac-get-file-type", Fmac_get_file_type, Smac_get_file_type, 1, 1, 0,
         doc: /* Get the type code of FILENAME as a four character string. */)
!      (filename)
       Lisp_Object filename;
  {
    OSErr       status;
***************
*** 3559,3565 ****
         doc: /* Set creator code of file FILENAME to CODE.
  If non-nil, CODE must be a 4-character string.  Otherwise, 'EMAx' is
  assumed. Return non-nil if successful.  */)
!   (filename, code)
       Lisp_Object filename, code;
  {
    OSErr       status;
--- 3557,3563 ----
         doc: /* Set creator code of file FILENAME to CODE.
  If non-nil, CODE must be a 4-character string.  Otherwise, 'EMAx' is
  assumed. Return non-nil if successful.  */)
!      (filename, code)
       Lisp_Object filename, code;
  {
    OSErr       status;
***************
*** 3619,3625 ****
  DEFUN ("mac-set-file-type", Fmac_set_file_type, Smac_set_file_type, 2, 2, 0,
         doc: /* Set file code of file FILENAME to CODE.
  CODE must be a 4-character string.  Return non-nil if successful.  */)
!   (filename, code)
       Lisp_Object filename, code;
  {
    OSErr       status;
--- 3617,3623 ----
  DEFUN ("mac-set-file-type", Fmac_set_file_type, Smac_set_file_type, 2, 2, 0,
         doc: /* Set file code of file FILENAME to CODE.
  CODE must be a 4-character string.  Return non-nil if successful.  */)
!      (filename, code)
       Lisp_Object filename, code;
  {
    OSErr       status;
***************
*** 3766,3777 ****
  
  
  DEFUN ("do-applescript", Fdo_applescript, Sdo_applescript, 1, 1, 0,
!        doc: /* Compile and execute AppleScript SCRIPT and retrieve and return 
the result.
  If compilation and execution are successful, the resulting script
  value is returned as a string.  Otherwise the function aborts and
  displays the error message returned by the AppleScript scripting
  component.  */)
!   (script)
      Lisp_Object script;
  {
    char *result, *temp;
--- 3764,3775 ----
  
  
  DEFUN ("do-applescript", Fdo_applescript, Sdo_applescript, 1, 1, 0,
!        doc: /* Compile and execute AppleScript SCRIPT and return the result.
  If compilation and execution are successful, the resulting script
  value is returned as a string.  Otherwise the function aborts and
  displays the error message returned by the AppleScript scripting
  component.  */)
!     (script)
      Lisp_Object script;
  {
    char *result, *temp;
***************
*** 3811,3826 ****
  
  DEFUN ("mac-file-name-to-posix", Fmac_file_name_to_posix,
         Smac_file_name_to_posix, 1, 1, 0,
!        doc: /* Convert Macintosh filename to Posix form.  */)
!      (mac_filename)
!      Lisp_Object mac_filename;
  {
    char posix_filename[MAXPATHLEN+1];
  
!   CHECK_STRING (mac_filename);
  
!   if (mac_to_posix_pathname (SDATA (mac_filename), posix_filename,
!                          MAXPATHLEN))
      return build_string (posix_filename);
    else
      return Qnil;
--- 3809,3823 ----
  
  DEFUN ("mac-file-name-to-posix", Fmac_file_name_to_posix,
         Smac_file_name_to_posix, 1, 1, 0,
!        doc: /* Convert Macintosh FILENAME to Posix form.  */)
!      (filename)
!      Lisp_Object filename;
  {
    char posix_filename[MAXPATHLEN+1];
  
!   CHECK_STRING (filename);
  
!   if (mac_to_posix_pathname (SDATA (filename), posix_filename, MAXPATHLEN))
      return build_string (posix_filename);
    else
      return Qnil;
***************
*** 3829,3844 ****
  
  DEFUN ("posix-file-name-to-mac", Fposix_file_name_to_mac,
         Sposix_file_name_to_mac, 1, 1, 0,
!        doc: /* Convert Posix filename to Mac form.  */)
!      (posix_filename)
!      Lisp_Object posix_filename;
  {
    char mac_filename[MAXPATHLEN+1];
  
!   CHECK_STRING (posix_filename);
  
!   if (posix_to_mac_pathname (SDATA (posix_filename), mac_filename,
!                          MAXPATHLEN))
      return build_string (mac_filename);
    else
      return Qnil;
--- 3826,3840 ----
  
  DEFUN ("posix-file-name-to-mac", Fposix_file_name_to_mac,
         Sposix_file_name_to_mac, 1, 1, 0,
!        doc: /* Convert Posix FILENAME to Mac form.  */)
!      (filename)
!      Lisp_Object filename;
  {
    char mac_filename[MAXPATHLEN+1];
  
!   CHECK_STRING (filename);
  
!   if (posix_to_mac_pathname (SDATA (filename), mac_filename, MAXPATHLEN))
      return build_string (mac_filename);
    else
      return Qnil;
***************
*** 3853,3860 ****
         doc: /* Return the application preference value for KEY.
  KEY is either a string specifying a preference key, or a list of key
  strings.  If it is a list, the (i+1)-th element is used as a key for
! the CFDictionary value obtained by the i-th element.  If lookup is
! failed at some stage, nil is returned.
  
  Optional arg APPLICATION is an application ID string.  If omitted or
  nil, that stands for the current application.
--- 3849,3856 ----
         doc: /* Return the application preference value for KEY.
  KEY is either a string specifying a preference key, or a list of key
  strings.  If it is a list, the (i+1)-th element is used as a key for
! the CFDictionary value obtained by the i-th element.  Return nil if
! lookup is failed at some stage.
  
  Optional arg APPLICATION is an application ID string.  If omitted or
  nil, that stands for the current application.
***************
*** 3885,3891 ****
  generate alists.  If HASH-BOUND >= 0, generate an alist if the number
  of keys in the dictionary is smaller than HASH-BOUND, and a hash table
  otherwise.  */)
!   (key, application, format, hash_bound)
       Lisp_Object key, application, format, hash_bound;
  {
    CFStringRef app_id, key_str;
--- 3881,3887 ----
  generate alists.  If HASH-BOUND >= 0, generate an alist if the number
  of keys in the dictionary is smaller than HASH-BOUND, and a hash table
  otherwise.  */)
!      (key, application, format, hash_bound)
       Lisp_Object key, application, format, hash_bound;
  {
    CFStringRef app_id, key_str;
***************
*** 4122,4130 ****
  On Mac OS X 10.2 and later, you can do Unicode Normalization by
  specifying the optional argument NORMALIZATION-FORM with a symbol NFD,
  NFKD, NFC, NFKC, HFS+D, or HFS+C.
! On successful conversion, returns the result string, else returns
! nil.  */)
!   (string, source, target, normalization_form)
       Lisp_Object string, source, target, normalization_form;
  {
    Lisp_Object result = Qnil;
--- 4118,4125 ----
  On Mac OS X 10.2 and later, you can do Unicode Normalization by
  specifying the optional argument NORMALIZATION-FORM with a symbol NFD,
  NFKD, NFC, NFKC, HFS+D, or HFS+C.
! On successful conversion, return the result string, else return nil.  */)
!      (string, source, target, normalization_form)
       Lisp_Object string, source, target, normalization_form;
  {
    Lisp_Object result = Qnil;
***************
*** 4183,4189 ****
  
  DEFUN ("mac-clear-font-name-table", Fmac_clear_font_name_table, 
Smac_clear_font_name_table, 0, 0, 0,
         doc: /* Clear the font name table.  */)
!   ()
  {
    check_mac ();
    mac_clear_font_name_table ();
--- 4178,4184 ----
  
  DEFUN ("mac-clear-font-name-table", Fmac_clear_font_name_table, 
Smac_clear_font_name_table, 0, 0, 0,
         doc: /* Clear the font name table.  */)
!      ()
  {
    check_mac ();
    mac_clear_font_name_table ();
***************
*** 4483,4490 ****
       app_bundle_pathname.  */
  
    bundle = CFBundleGetMainBundle ();
!   if (!bundle)
!     return;
  
    bundleURL = CFBundleCopyBundleURL (bundle);
    if (!bundleURL)
--- 4478,4490 ----
       app_bundle_pathname.  */
  
    bundle = CFBundleGetMainBundle ();
!   if (!bundle || CFBundleGetIdentifier (bundle) == NULL)
!     {
!       /* We could not find the bundle identifier.  For now, prevent
!        the fatal error by bringing it up in the terminal. */
!       inhibit_window_system = 1;
!       return;
!     }
  
    bundleURL = CFBundleCopyBundleURL (bundle);
    if (!bundleURL)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]