emacs-pretest-bug
[Top][All Lists]
Advanced

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

Re: OS X: additional characters copied to clipboard


From: YAMAMOTO Mitsuharu
Subject: Re: OS X: additional characters copied to clipboard
Date: Sat, 15 Oct 2005 10:11:56 +0900
User-agent: Wanderlust/2.14.0 (Africa) SEMI/1.14.6 (Maruoka) FLIM/1.14.6 (Marutamachi) APEL/10.6 Emacs/22.0.50 (sparc-sun-solaris2.8) MULE/5.0 (SAKAKI)

>>>>> On Fri, 14 Oct 2005 11:57:27 +0100, David Reitter <address@hidden> said:

> Tried this, didn't work.

Oops, CFStringCreateExternalRepresentation also adds BOM.  Please try
the following patch together with the previous one.

                                     YAMAMOTO Mitsuharu
                                address@hidden

Index: src/mac.c
===================================================================
RCS file: /cvsroot/emacs/emacs/src/mac.c,v
retrieving revision 1.44
diff -c -r1.44 mac.c
*** src/mac.c   7 Aug 2005 12:33:17 -0000       1.44
--- src/mac.c   15 Oct 2005 01:01:59 -0000
***************
*** 4126,4132 ****
    Lisp_Object result = Qnil;
    CFStringEncoding src_encoding, tgt_encoding;
    CFStringRef str = NULL;
-   CFDataRef data = NULL;
  
    CHECK_STRING (string);
    if (!INTEGERP (source) && !STRINGP (source))
--- 4126,4131 ----
***************
*** 4160,4173 ****
  #endif
    if (str)
      {
!       data = CFStringCreateExternalRepresentation (NULL, str,
!                                                  tgt_encoding, '\0');
        CFRelease (str);
-     }
-   if (data)
-     {
-       result = cfdata_to_lisp (data);
-       CFRelease (data);
      }
  
    UNBLOCK_INPUT;
--- 4159,4175 ----
  #endif
    if (str)
      {
!       CFIndex str_len, buf_len;
! 
!       str_len = CFStringGetLength (str);
!       if (CFStringGetBytes (str, CFRangeMake (0, str_len), tgt_encoding,
!                           0, false, NULL, 0, &buf_len) == str_len)
!       {
!         result = make_uninit_string (buf_len);
!         CFStringGetBytes (str, CFRangeMake (0, str_len), tgt_encoding,
!                           0, false, SDATA (result), buf_len, NULL);
!       }
        CFRelease (str);
      }
  
    UNBLOCK_INPUT;




reply via email to

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