From a9f737eef69ffe03dd045df555300ae6b41d0edf Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Fri, 27 May 2011 12:17:59 -0400 Subject: Support X clipboard managers. * lisp/select.el (xselect-convert-to-targets): Add MULTIPLE target to list. (xselect-convert-to-save-targets): New function. * src/xselect.c: Support for clipboard managers. (Vselection_alist): Move to termhooks.h as terminal-local var. (LOCAL_SELECTION): New macro. (x_atom_to_symbol): Handle x_display_info_for_display fail case. (symbol_to_x_atom): Remove gratuitous arg. (x_handle_selection_request, lisp_data_to_selection_data) (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed. (x_own_selection, x_get_local_selection, x_convert_selection): New arg, specifying work frame. Use terminal-local Vselection_alist. (some_frame_on_display): Delete unused function. (Fx_own_selection_internal, Fx_get_selection_internal) (Fx_disown_selection_internal, Fx_selection_owner_p) (Fx_selection_exists_p): New optional frame arg. (frame_for_x_selection, Fx_clipboard_manager_save): New functions. (x_handle_selection_clear): Don't treat other terminals with the same keyboard specially. Use the terminal-local Vselection_alist. (x_clear_frame_selections): Use Frun_hook_with_args. * src/termhooks.h (Vselection_alist): Make it terminal-local. * src/terminal.c (create_terminal): Initialize it. * src/xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms. * src/xterm.h: Add support for those atoms. --- src/termhooks.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/termhooks.h') diff --git a/src/termhooks.h b/src/termhooks.h index 34e1364effd..6a58517a85a 100644 --- a/src/termhooks.h +++ b/src/termhooks.h @@ -335,6 +335,22 @@ struct terminal the member terminal_coding. */ Lisp_Object charset_list; + /* This is an association list containing the X selections that + Emacs might own on this terminal. Each element has the form + (SELECTION-NAME SELECTION-VALUE SELECTION-TIMESTAMP FRAME) + SELECTION-NAME is a lisp symbol, whose name is the name of an X Atom. + SELECTION-VALUE is the value that emacs owns for that selection. + It may be any kind of Lisp object. + SELECTION-TIMESTAMP is the time at which emacs began owning this + selection, as a cons of two 16-bit numbers (making a 32 bit + time.) + FRAME is the frame for which we made the selection. If there is + an entry in this alist, then it can be assumed that Emacs owns + that selection. + The only (eq) parts of this list that are visible from Lisp are + the selection-values. */ + Lisp_Object Vselection_alist; + /* All fields before `next_terminal' should be Lisp_Object and are traced by the GC. All fields afterwards are ignored by the GC. */ -- cgit v1.2.1