diff -Nru emacs-21.3.50-20040303.orig/lisp/menu-bar.el emacs/lisp/menu-bar.el
--- emacs-21.3.50-20040303.orig/lisp/menu-bar.el	Tue Sep  2 03:48:10 2003
+++ emacs/lisp/menu-bar.el	Sun Jun 20 15:41:58 2004
@@ -456,7 +456,9 @@
 		       ;; Emacs compiled --without-x doesn't have
 		       ;; x-selection-exists-p.
 		       (fboundp 'x-selection-exists-p)
-		       (x-selection-exists-p) (not buffer-read-only))
+		       (or (x-selection-exists-p)
+			   (x-selection-exists-p 'CLIPBOARD))
+		       (not buffer-read-only))
 	      :help "Paste (yank) text most recently cut/copied"))
 (define-key menu-bar-edit-menu [copy]
   '(menu-item "Copy" menu-bar-kill-ring-save
diff -Nru emacs-21.3.50-20040303.orig/lisp/term/mac-win.el emacs/lisp/term/mac-win.el
--- emacs-21.3.50-20040303.orig/lisp/term/mac-win.el	Tue Sep  2 00:45:36 2003
+++ emacs/lisp/term/mac-win.el	Sun Jun 20 15:54:35 2004
@@ -125,16 +125,46 @@
 ;; mac-paste-function are defined in mac.c.
 (set-selection-coding-system 'compound-text-mac)
 
+(when (featurep 'mac-carbon)
+  (defcustom mac-access-clipboard-in-unicode t
+    "Whether or not to access Mac clipboard in Unicode \(utf-16-be)."
+    :type 'boolean
+    :group 'killing)
+  )
+(defun mac-access-clipboard-in-unicode-p ()
+  "Test whether or not to access Mac clipboard in Unicode \(utf-16-be).
+Non-Carbon Emacs always returns nil. If you are running Carbon Emacs
+and you turned mac-access-clipboard-in-unicode, returns t."
+  (and (featurep 'mac-carbon) mac-access-clipboard-in-unicode))
+
 (setq interprogram-cut-function
       '(lambda (str push)
-	 (mac-cut-function
-	  (encode-coding-string str selection-coding-system t) push)))
+	 (if (mac-access-clipboard-in-unicode-p)
+	     (mac-cut-function-unicode
+	      (encode-coding-string str 'utf-16-be t) push)
+	   (mac-cut-function
+	    (encode-coding-string str selection-coding-system t) push))))
 
 (setq interprogram-paste-function
       '(lambda ()
-	 (let ((clipboard (mac-paste-function)))
-	   (if clipboard
-	       (decode-coding-string clipboard selection-coding-system t)))))
+	 (if (mac-access-clipboard-in-unicode-p)
+	     (let ((clipboard (mac-paste-function-unicode)))
+	       (if clipboard
+		   (decode-coding-string clipboard 'utf-16-be t)))
+	   (let ((clipboard (mac-paste-function)))
+	     (if clipboard
+		 (decode-coding-string clipboard selection-coding-system t))))))
+
+(defun x-selection-exists-p (&optional selection)
+  "Whether there is an owner for the given X Selection.
+The arg should be the name of the selection in question, typically one of
+the symbols `PRIMARY', `SECONDARY', or `CLIPBOARD'.
+\(Those are literal upper-case symbol names, since that's what X expects.)
+For convenience, the symbol nil is the same as `PRIMARY',
+and t is the same as `SECONDARY'."
+  (if (eq selection 'CLIPBOARD)
+      (mac-clipboard-data-exists-p (mac-access-clipboard-in-unicode-p))
+    nil))
 
 (defun mac-drag-n-drop (event)
   "Edit the files listed in the drag-n-drop event.\n\
diff -Nru emacs-21.3.50-20040303.orig/src/mac.c emacs/src/mac.c
--- emacs-21.3.50-20040303.orig/src/mac.c	Sun Nov 23 08:00:59 2003
+++ emacs/src/mac.c	Sun Jun 20 15:33:53 2004
@@ -2673,6 +2673,48 @@
 #endif /* not TARGET_API_MAC_CARBON */
 }
 
+#if TARGET_API_MAC_CARBON
+DEFUN ("mac-paste-function-unicode", Fmac_paste_function_unicode,
+       Smac_paste_function_unicode, 0, 0, 0,
+       doc: /* Return the contents of the Mac clipboard as a
+Unicode \(utf-16-be) string.  */)
+     ()
+{
+  ScrapRef scrap;
+  ScrapFlavorFlags sff;
+  Size s;
+  size_t ulen, i;
+  UniChar *data;
+
+  if (GetCurrentScrap (&scrap) != noErr)
+    return Qnil;
+
+  if (GetScrapFlavorFlags (scrap, kScrapFlavorTypeUnicode, &sff) != noErr)
+    return Qnil;
+
+  if (GetScrapFlavorSize (scrap, kScrapFlavorTypeUnicode, &s) != noErr)
+    return Qnil;
+
+  if (s % sizeof(UniChar))
+    abort();
+  ulen = s / sizeof(UniChar);
+
+  if ((data = (UniChar*) alloca (s)) == NULL)
+    return Qnil;
+
+  if (GetScrapFlavorData (scrap, kScrapFlavorTypeUnicode, &s, data) != noErr
+      || s == 0)
+    return Qnil;
+
+  /* Emacs expects clipboard contents have Unix-style eol's */
+  for (i = 0; i < ulen; i++)
+    if (data[i] == '\r')
+      data[i] = '\n';
+
+  return make_unibyte_string ((char *)data, s);
+}
+#endif /* TARGET_API_MAC_CARBON */
+
 
 /* set interprogram-cut-function to mac-cut-function in mac-win.el
    to enable Emacs to write the top of the kill-ring to the Mac clipboard. */
@@ -2717,7 +2759,51 @@
   return Qnil;
 }
 
+#if TARGET_API_MAC_CARBON
+DEFUN ("mac-cut-function-unicode", Fmac_cut_function_unicode,
+       Smac_cut_function_unicode, 1, 2, 0,
+       doc: /* Put the value of the Unicode \(utf-16-be) string parameter
+to the Mac clipboard.  */)
+  (value, push)
+    Lisp_Object value, push;
+{
+  UniChar *buf;
+  size_t len, ulen, i;
+
+  /* fixme: ignore the push flag for now */
+
+  CHECK_STRING (value);
+
+  len = SCHARS(value);
+  if (len % sizeof(UniChar))
+    error("not a utf-16-be string");
+  ulen = len / sizeof(UniChar);
+  buf = (UniChar *) alloca ((ulen + 1) * sizeof(UniChar));
+  bcopy (SDATA (value), (char *)buf, len);
+  buf[ulen] = '\0';
+
+  /* convert to Mac-style eol's before sending to clipboard */
+  for (i = 0; i < ulen; i++)
+    if (buf[i] == '\n')
+      buf[i] = '\r';
+
+  {
+    ScrapRef scrap;
+    ClearCurrentScrap ();
+    if (GetCurrentScrap (&scrap) != noErr)
+      error ("cannot get current scrap");
+
+    if (PutScrapFlavor (scrap, kScrapFlavorTypeUnicode,
+		kScrapFlavorMaskNone, len, buf) != noErr)
+      error ("cannot put to scrap");
+  }
 
+  return Qnil;
+}
+#endif /* TARGET_API_MAC_CARBON */
+
+
+#if 0
 DEFUN ("x-selection-exists-p", Fx_selection_exists_p, Sx_selection_exists_p,
        0, 1, 0,
        doc: /* Whether there is an owner for the given X Selection.
@@ -2762,6 +2848,49 @@
     }
   return Qnil;
 }
+#endif
+
+DEFUN ("mac-clipboard-data-exists-p", Fmac_clipboard_data_exists_p,
+       Smac_clipboard_data_exists_p, 1, 1, 0,
+       doc: /* Whether there is a text data in the clipboard.
+
+The arg specifies whether to receive the data in Unicode. Only Carbon
+Emacs is able to receive it in Unicode. Non-Carbon Emacs always returns
+nil if you specify non-nil to the arg. */)
+  (in_unicode)
+     Lisp_Object in_unicode;
+{
+  Lisp_Object val = Qnil;
+
+#if TARGET_API_MAC_CARBON
+  {
+    ScrapRef scrap;
+    ScrapFlavorFlags sff;
+    ScrapFlavorType type;
+    
+    type = NILP(in_unicode) ? kScrapFlavorTypeText : kScrapFlavorTypeUnicode;
+    if (GetCurrentScrap (&scrap) == noErr)
+      if (GetScrapFlavorFlags (scrap, type, &sff) == noErr)
+	val = Qt;
+  }
+#else /* not TARGET_API_MAC_CARBON */
+  if (NILP(in_unicode))
+    {
+      Handle my_handle;
+      long rc, scrap_offset;
+
+      my_handle = NewHandle (0);
+
+      rc = GetScrap (my_handle, 'TEXT', &scrap_offset);
+      if (rc >= 0)
+	val = Qt;
+
+      DisposeHandle (my_handle);
+    }
+#endif /* not TARGET_API_MAC_CARBON */
+
+  return val;
+}
 
 #ifdef MAC_OSX
 #undef select
@@ -2997,7 +3126,14 @@
 
   defsubr (&Smac_paste_function);
   defsubr (&Smac_cut_function);
+#if 0
   defsubr (&Sx_selection_exists_p);
+#endif
+  defsubr (&Smac_clipboard_data_exists_p);
+#ifdef TARGET_API_MAC_CARBON
+  defsubr (&Smac_paste_function_unicode);
+  defsubr (&Smac_cut_function_unicode);
+#endif
 
   defsubr (&Sdo_applescript);
   defsubr (&Smac_file_name_to_posix);
