aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorYAMAMOTO Mitsuharu2005-05-06 08:03:08 +0000
committerYAMAMOTO Mitsuharu2005-05-06 08:03:08 +0000
commit956c0f10b5eb31886aaa0a2c69e209f02d4f249a (patch)
treeac61186ed35e1866f5e73b588eba22a9c2b41d24 /src
parent1c9a39ee4e3406c83f21998673cbb00366b6142a (diff)
downloademacs-956c0f10b5eb31886aaa0a2c69e209f02d4f249a.tar.gz
emacs-956c0f10b5eb31886aaa0a2c69e209f02d4f249a.zip
(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.
Diffstat (limited to 'src')
-rw-r--r--src/macselect.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/macselect.c b/src/macselect.c
index 49246f7eddc..a115c9b3229 100644
--- a/src/macselect.c
+++ b/src/macselect.c
@@ -98,8 +98,10 @@ static Lisp_Object Vselection_converter_alist;
98 selection type with a scrap flavor type via `mac-ostype'. */ 98 selection type with a scrap flavor type via `mac-ostype'. */
99static Lisp_Object Qmac_scrap_name, Qmac_ostype; 99static Lisp_Object Qmac_scrap_name, Qmac_ostype;
100 100
101#ifdef MAC_OSX
101/* Selection name for communication via Services menu. */ 102/* Selection name for communication via Services menu. */
102static Lisp_Object Vmac_services_selection; 103static Lisp_Object Vmac_services_selection;
104#endif
103 105
104/* Get a reference to the scrap corresponding to the symbol SYM. The 106/* Get a reference to the scrap corresponding to the symbol SYM. The
105 reference is set to *SCRAP, and it becomes NULL if there's no 107 reference is set to *SCRAP, and it becomes NULL if there's no
@@ -455,9 +457,11 @@ x_own_selection (selection_name, selection_value)
455 value = call3 (handler_fn, selection_name, 457 value = call3 (handler_fn, selection_name,
456 type, selection_value); 458 type, selection_value);
457 459
458 if (CONSP (value) 460 if (STRINGP (value))
459 && EQ (XCAR (value), type) 461 err = put_scrap_string (scrap, type, value);
460 && STRINGP (XCDR (value))) 462 else if (CONSP (value)
463 && EQ (XCAR (value), type)
464 && STRINGP (XCDR (value)))
461 err = put_scrap_string (scrap, type, XCDR (value)); 465 err = put_scrap_string (scrap, type, XCDR (value));
462 } 466 }
463 467
@@ -622,7 +626,8 @@ x_clear_frame_selections (f)
622 hooks = Vx_lost_selection_functions; 626 hooks = Vx_lost_selection_functions;
623 selection_symbol = Fcar (Fcar (Vselection_alist)); 627 selection_symbol = Fcar (Fcar (Vselection_alist));
624 628
625 if (!EQ (hooks, Qunbound)) 629 if (!EQ (hooks, Qunbound)
630 && !NILP (Fx_selection_owner_p (selection_symbol)))
626 { 631 {
627 for (; CONSP (hooks); hooks = Fcdr (hooks)) 632 for (; CONSP (hooks); hooks = Fcdr (hooks))
628 call1 (Fcar (hooks), selection_symbol); 633 call1 (Fcar (hooks), selection_symbol);
@@ -646,7 +651,8 @@ x_clear_frame_selections (f)
646 hooks = Vx_lost_selection_functions; 651 hooks = Vx_lost_selection_functions;
647 selection_symbol = Fcar (Fcar (XCDR (rest))); 652 selection_symbol = Fcar (Fcar (XCDR (rest)));
648 653
649 if (!EQ (hooks, Qunbound)) 654 if (!EQ (hooks, Qunbound)
655 && !NILP (Fx_selection_owner_p (selection_symbol)))
650 { 656 {
651 for (; CONSP (hooks); hooks = Fcdr (hooks)) 657 for (; CONSP (hooks); hooks = Fcdr (hooks))
652 call1 (Fcar (hooks), selection_symbol); 658 call1 (Fcar (hooks), selection_symbol);