changeset 62102:b710f3bc2da3

(x_own_selection): Accept Lisp string as result of selection converter function. (x_clear_frame_selections): Don't call x-lost-selection-functions if Emacs is not owner of the selection. (Vmac_services_selection): Put variable and initialization in #ifdef MAC_OSX. (syms_of_macselect) [MAC_OSX]: Set default value of Vmac_services_selection to PRIMARY.
author YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
date Fri, 06 May 2005 08:03:08 +0000
parents ad0379779256
children 2d42fd79f829
files src/macselect.c
diffstat 1 files changed, 11 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/macselect.c	Fri May 06 08:02:19 2005 +0000
+++ b/src/macselect.c	Fri May 06 08:03:08 2005 +0000
@@ -98,8 +98,10 @@
    selection type with a scrap flavor type via `mac-ostype'.  */
 static Lisp_Object Qmac_scrap_name, Qmac_ostype;
 
+#ifdef MAC_OSX
 /* Selection name for communication via Services menu.  */
 static Lisp_Object Vmac_services_selection;
+#endif
 
 /* Get a reference to the scrap corresponding to the symbol SYM.  The
    reference is set to *SCRAP, and it becomes NULL if there's no
@@ -455,9 +457,11 @@
 	    value = call3 (handler_fn, selection_name,
 			   type, selection_value);
 
-	  if (CONSP (value)
-	      && EQ (XCAR (value), type)
-	      && STRINGP (XCDR (value)))
+	  if (STRINGP (value))
+	    err = put_scrap_string (scrap, type, value);
+	  else if (CONSP (value)
+		   && EQ (XCAR (value), type)
+		   && STRINGP (XCDR (value)))
 	    err = put_scrap_string (scrap, type, XCDR (value));
 	}
 
@@ -622,7 +626,8 @@
       hooks = Vx_lost_selection_functions;
       selection_symbol = Fcar (Fcar (Vselection_alist));
 
-      if (!EQ (hooks, Qunbound))
+      if (!EQ (hooks, Qunbound)
+	  && !NILP (Fx_selection_owner_p (selection_symbol)))
 	{
 	  for (; CONSP (hooks); hooks = Fcdr (hooks))
 	    call1 (Fcar (hooks), selection_symbol);
@@ -646,7 +651,8 @@
 	hooks = Vx_lost_selection_functions;
 	selection_symbol = Fcar (Fcar (XCDR (rest)));
 
-	if (!EQ (hooks, Qunbound))
+	if (!EQ (hooks, Qunbound)
+	  && !NILP (Fx_selection_owner_p (selection_symbol)))
 	  {
 	    for (; CONSP (hooks); hooks = Fcdr (hooks))
 	      call1 (Fcar (hooks), selection_symbol);