Mercurial > emacs
comparison src/xselect.c @ 57777:c02cbcd40932
(Vx_lost_selection_functions, Vx_sent_selection_functions):
Rename from Vx_lost_selection_hooks and Vx_sent_selection_hooks.
(x_handle_selection_request, x_handle_selection_clear)
(x_clear_frame_selections, syms_of_xselect): Adjust accordingly.
author | Stefan Monnier <monnier@iro.umontreal.ca> |
---|---|
date | Thu, 28 Oct 2004 23:28:20 +0000 |
parents | abdfb8ccbb2b |
children | 481911368712 4056279af756 e24e2e78deda |
comparison
equal
deleted
inserted
replaced
57776:c4ba14ad9689 | 57777:c02cbcd40932 |
---|---|
106 #ifdef CUT_BUFFER_SUPPORT | 106 #ifdef CUT_BUFFER_SUPPORT |
107 Lisp_Object QCUT_BUFFER0, QCUT_BUFFER1, QCUT_BUFFER2, QCUT_BUFFER3, | 107 Lisp_Object QCUT_BUFFER0, QCUT_BUFFER1, QCUT_BUFFER2, QCUT_BUFFER3, |
108 QCUT_BUFFER4, QCUT_BUFFER5, QCUT_BUFFER6, QCUT_BUFFER7; | 108 QCUT_BUFFER4, QCUT_BUFFER5, QCUT_BUFFER6, QCUT_BUFFER7; |
109 #endif | 109 #endif |
110 | 110 |
111 static Lisp_Object Vx_lost_selection_hooks; | 111 static Lisp_Object Vx_lost_selection_functions; |
112 static Lisp_Object Vx_sent_selection_hooks; | 112 static Lisp_Object Vx_sent_selection_functions; |
113 /* Coding system for communicating with other X clients via cutbuffer, | 113 /* Coding system for communicating with other X clients via cutbuffer, |
114 selection, and clipboard. */ | 114 selection, and clipboard. */ |
115 static Lisp_Object Vselection_coding_system; | 115 static Lisp_Object Vselection_coding_system; |
116 | 116 |
117 /* Coding system for the next communicating with other X clients. */ | 117 /* Coding system for the next communicating with other X clients. */ |
854 DONE: | 854 DONE: |
855 | 855 |
856 /* Let random lisp code notice that the selection has been asked for. */ | 856 /* Let random lisp code notice that the selection has been asked for. */ |
857 { | 857 { |
858 Lisp_Object rest; | 858 Lisp_Object rest; |
859 rest = Vx_sent_selection_hooks; | 859 rest = Vx_sent_selection_functions; |
860 if (!EQ (rest, Qunbound)) | 860 if (!EQ (rest, Qunbound)) |
861 for (; CONSP (rest); rest = Fcdr (rest)) | 861 for (; CONSP (rest); rest = Fcdr (rest)) |
862 call3 (Fcar (rest), selection_symbol, target_symbol, successful_p); | 862 call3 (Fcar (rest), selection_symbol, target_symbol, successful_p); |
863 } | 863 } |
864 | 864 |
937 | 937 |
938 /* Let random lisp code notice that the selection has been stolen. */ | 938 /* Let random lisp code notice that the selection has been stolen. */ |
939 | 939 |
940 { | 940 { |
941 Lisp_Object rest; | 941 Lisp_Object rest; |
942 rest = Vx_lost_selection_hooks; | 942 rest = Vx_lost_selection_functions; |
943 if (!EQ (rest, Qunbound)) | 943 if (!EQ (rest, Qunbound)) |
944 { | 944 { |
945 for (; CONSP (rest); rest = Fcdr (rest)) | 945 for (; CONSP (rest); rest = Fcdr (rest)) |
946 call1 (Fcar (rest), selection_symbol); | 946 call1 (Fcar (rest), selection_symbol); |
947 prepare_menu_bars (); | 947 prepare_menu_bars (); |
970 && EQ (frame, Fcar (Fcdr (Fcdr (Fcdr (Fcar (Vselection_alist))))))) | 970 && EQ (frame, Fcar (Fcdr (Fcdr (Fcdr (Fcar (Vselection_alist))))))) |
971 { | 971 { |
972 /* Let random Lisp code notice that the selection has been stolen. */ | 972 /* Let random Lisp code notice that the selection has been stolen. */ |
973 Lisp_Object hooks, selection_symbol; | 973 Lisp_Object hooks, selection_symbol; |
974 | 974 |
975 hooks = Vx_lost_selection_hooks; | 975 hooks = Vx_lost_selection_functions; |
976 selection_symbol = Fcar (Fcar (Vselection_alist)); | 976 selection_symbol = Fcar (Fcar (Vselection_alist)); |
977 | 977 |
978 if (!EQ (hooks, Qunbound)) | 978 if (!EQ (hooks, Qunbound)) |
979 { | 979 { |
980 for (; CONSP (hooks); hooks = Fcdr (hooks)) | 980 for (; CONSP (hooks); hooks = Fcdr (hooks)) |
994 if (EQ (frame, Fcar (Fcdr (Fcdr (Fcdr (Fcar (XCDR (rest)))))))) | 994 if (EQ (frame, Fcar (Fcdr (Fcdr (Fcdr (Fcar (XCDR (rest)))))))) |
995 { | 995 { |
996 /* Let random Lisp code notice that the selection has been stolen. */ | 996 /* Let random Lisp code notice that the selection has been stolen. */ |
997 Lisp_Object hooks, selection_symbol; | 997 Lisp_Object hooks, selection_symbol; |
998 | 998 |
999 hooks = Vx_lost_selection_hooks; | 999 hooks = Vx_lost_selection_functions; |
1000 selection_symbol = Fcar (Fcar (XCDR (rest))); | 1000 selection_symbol = Fcar (Fcar (XCDR (rest))); |
1001 | 1001 |
1002 if (!EQ (hooks, Qunbound)) | 1002 if (!EQ (hooks, Qunbound)) |
1003 { | 1003 { |
1004 for (; CONSP (hooks); hooks = Fcdr (hooks)) | 1004 for (; CONSP (hooks); hooks = Fcdr (hooks)) |
2697 A return value which is the symbol `NULL' | 2697 A return value which is the symbol `NULL' |
2698 means that a side-effect was executed, | 2698 means that a side-effect was executed, |
2699 and there is no meaningful selection value. */); | 2699 and there is no meaningful selection value. */); |
2700 Vselection_converter_alist = Qnil; | 2700 Vselection_converter_alist = Qnil; |
2701 | 2701 |
2702 DEFVAR_LISP ("x-lost-selection-hooks", &Vx_lost_selection_hooks, | 2702 DEFVAR_LISP ("x-lost-selection-functions", &Vx_lost_selection_functions, |
2703 doc: /* A list of functions to be called when Emacs loses an X selection. | 2703 doc: /* A list of functions to be called when Emacs loses an X selection. |
2704 \(This happens when some other X client makes its own selection | 2704 \(This happens when some other X client makes its own selection |
2705 or when a Lisp program explicitly clears the selection.) | 2705 or when a Lisp program explicitly clears the selection.) |
2706 The functions are called with one argument, the selection type | 2706 The functions are called with one argument, the selection type |
2707 \(a symbol, typically `PRIMARY', `SECONDARY', or `CLIPBOARD'). */); | 2707 \(a symbol, typically `PRIMARY', `SECONDARY', or `CLIPBOARD'). */); |
2708 Vx_lost_selection_hooks = Qnil; | 2708 Vx_lost_selection_functions = Qnil; |
2709 | 2709 |
2710 DEFVAR_LISP ("x-sent-selection-hooks", &Vx_sent_selection_hooks, | 2710 DEFVAR_LISP ("x-sent-selection-functions", &Vx_sent_selection_functions, |
2711 doc: /* A list of functions to be called when Emacs answers a selection request. | 2711 doc: /* A list of functions to be called when Emacs answers a selection request. |
2712 The functions are called with four arguments: | 2712 The functions are called with four arguments: |
2713 - the selection name (typically `PRIMARY', `SECONDARY', or `CLIPBOARD'); | 2713 - the selection name (typically `PRIMARY', `SECONDARY', or `CLIPBOARD'); |
2714 - the selection-type which Emacs was asked to convert the | 2714 - the selection-type which Emacs was asked to convert the |
2715 selection into before sending (for example, `STRING' or `LENGTH'); | 2715 selection into before sending (for example, `STRING' or `LENGTH'); |
2717 We might have failed (and declined the request) for any number of reasons, | 2717 We might have failed (and declined the request) for any number of reasons, |
2718 including being asked for a selection that we no longer own, or being asked | 2718 including being asked for a selection that we no longer own, or being asked |
2719 to convert into a type that we don't know about or that is inappropriate. | 2719 to convert into a type that we don't know about or that is inappropriate. |
2720 This hook doesn't let you change the behavior of Emacs's selection replies, | 2720 This hook doesn't let you change the behavior of Emacs's selection replies, |
2721 it merely informs you that they have happened. */); | 2721 it merely informs you that they have happened. */); |
2722 Vx_sent_selection_hooks = Qnil; | 2722 Vx_sent_selection_functions = Qnil; |
2723 | 2723 |
2724 DEFVAR_LISP ("selection-coding-system", &Vselection_coding_system, | 2724 DEFVAR_LISP ("selection-coding-system", &Vselection_coding_system, |
2725 doc: /* Coding system for communicating with other X clients. | 2725 doc: /* Coding system for communicating with other X clients. |
2726 When sending or receiving text via cut_buffer, selection, and clipboard, | 2726 When sending or receiving text via cut_buffer, selection, and clipboard, |
2727 the text is encoded or decoded by this coding system. | 2727 the text is encoded or decoded by this coding system. |