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: Wed, 23 Nov 2005 02:19:17 -0500

Index: emacs/src/mac.c
diff -c emacs/src/mac.c:1.47 emacs/src/mac.c:1.48
*** emacs/src/mac.c:1.47        Tue Nov 15 07:56:14 2005
--- emacs/src/mac.c     Wed Nov 23 07:19:16 2005
***************
*** 265,271 ****
  #if TARGET_API_MAC_CARBON
  static Lisp_Object Qstring, Qnumber, Qboolean, Qdate, Qdata;
  static Lisp_Object Qarray, Qdictionary;
- #define DECODE_UTF_8(str) code_convert_string_norecord (str, Qutf_8, 0)
  
  struct cfdict_context
  {
--- 265,270 ----
***************
*** 336,347 ****
  }
  
  
! /* From CFString to a lisp string.  Never returns a unibyte string
!    (even if it only contains ASCII characters).
!    This may cause GC during code conversion. */
  
  Lisp_Object
! cfstring_to_lisp (string)
       CFStringRef string;
  {
    Lisp_Object result = Qnil;
--- 335,345 ----
  }
  
  
! /* From CFString to a lisp string.  Returns a unibyte string
!    containing a UTF-8 byte sequence.  */
  
  Lisp_Object
! cfstring_to_lisp_nodecode (string)
       CFStringRef string;
  {
    Lisp_Object result = Qnil;
***************
*** 362,370 ****
        }
      }
  
    if (!NILP (result))
      {
!       result = DECODE_UTF_8 (result);
        /* This may be superfluous.  Just to make sure that the result
         is a multibyte string.  */
        result = string_to_multibyte (result);
--- 360,382 ----
        }
      }
  
+   return result;
+ }
+ 
+ 
+ /* From CFString to a lisp string.  Never returns a unibyte string
+    (even if it only contains ASCII characters).
+    This may cause GC during code conversion. */
+ 
+ Lisp_Object
+ cfstring_to_lisp (string)
+      CFStringRef string;
+ {
+   Lisp_Object result = cfstring_to_lisp_nodecode (string);
+ 
    if (!NILP (result))
      {
!       result = code_convert_string_norecord (result, Qutf_8, 0);
        /* This may be superfluous.  Just to make sure that the result
         is a multibyte string.  */
        result = string_to_multibyte (result);
***************
*** 1141,1147 ****
    CFSetGetValues (key_set, (const void **)keys);
    for (index = 0; index < count; index++)
      {
!       res_name = SDATA (cfstring_to_lisp (keys[index]));
        quarks = parse_resource_name (&res_name);
        if (!(NILP (quarks) || *res_name))
        {
--- 1153,1159 ----
    CFSetGetValues (key_set, (const void **)keys);
    for (index = 0; index < count; index++)
      {
!       res_name = SDATA (cfstring_to_lisp_nodecode (keys[index]));
        quarks = parse_resource_name (&res_name);
        if (!(NILP (quarks) || *res_name))
        {




reply via email to

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