aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJan Djärv2010-09-02 11:47:08 +0200
committerJan Djärv2010-09-02 11:47:08 +0200
commit6d7cc563820685d94d006116378f155d73bbb915 (patch)
treea0c6ac62a4b11640d60567abfdb65e76ce7f673b /src
parentf68a93a990c906234ea0c8d77ca5e785d3e56dfe (diff)
downloademacs-6d7cc563820685d94d006116378f155d73bbb915.tar.gz
emacs-6d7cc563820685d94d006116378f155d73bbb915.zip
Removed cut-buffer code.
* lisp/mouse-sel.el (mouse-sel-get-selection-function): x-cut-buffer-or-selection-value renamed to x-selection-value. (x-select-text): Optional push removed. * lisp/select.el (x-get-cut-buffer, x-set-cut-buffer): Remove. * lisp/simple.el (interprogram-cut-function): Remove mention of PUSH. * lisp/w32-fns.el (x-last-selected-text): x-cut-buffer-or-selection-value renamed to x-selection-value. (x-cut-buffer-max): Remove. (x-select-text): Remove argument PUSH, update documentation. * lisp/emacs-lisp/cl-macs.el (x-get-cutbuffer, x-get-cut-buffer): Remove. * lisp/term/ns-win.el (x-setup-function-keys, ns-last-selected-text): x-cut-buffer-or-selection-value renamed to x-selection-value (x-selection-value): Renamed from x-cut-buffer-or-selection-value. (x-select-text): Remove argument PUSH, update documentation. * lisp/term/pc-win.el (x-last-selected-text): x-cut-buffer-or-selection-value renamed to x-selection-value (x-select-text): Remove argument PUSH, update documentation. * lisp/term/x-win.el: Update documentation for x-last-selected-text-*. (x-last-selected-text-cut, x-last-selected-text-cut-encoded) (x-last-cut-buffer-coding, x-cut-buffer-max): Remove. (x-select-text): Remove argument PUSH, update documentation. Remove cut-buffer code. (x-selection-value-internal): Was previously x-selection-value. (x-selection-value): Renamed from x-cut-buffer-or-selection-value. Update documentation, remove cut-buffer code. Call x-selection-value-internal. (x-clipboard-yank): Call x-selection-value-internal. (x-initialize-window-system): Remove setting of x-cut-buffer-max. * src/xselect.c: Remove declaration of cut-buffer objects and functions. (symbol_to_x_atom): Remove mapping to XA_CUT_BUFFERn. (x_atom_to_symbol): Remove mapping to QCUT_BUFFERn. (Fx_get_cut_buffer_internal, Fx_store_cut_buffer_internal) (Fx_rotate_cut_buffers_internal): Remove. (syms_of_xselect): Remove defsubr of above. Remove intern of QCUT_BUFFERn. * src/xterm.c (x_term_init): Don't set dpyinfo->cut_buffers_initialized. * src/xterm.h (struct dpyinfo): Remove cut_buffers_initialized.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog14
-rw-r--r--src/xselect.c243
-rw-r--r--src/xterm.c2
-rw-r--r--src/xterm.h2
4 files changed, 14 insertions, 247 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 8e656b525ef..c70db2ad69a 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,17 @@
12010-09-02 Jan Djärv <jan.h.d@swipnet.se>
2
3 * xterm.h (struct dpyinfo): Remove cut_buffers_initialized.
4
5 * xterm.c (x_term_init): Don't set dpyinfo->cut_buffers_initialized.
6
7 * xselect.c: Remove declaration of cut-buffer objects and functions.
8 (symbol_to_x_atom): Remove mapping to XA_CUT_BUFFERn.
9 (x_atom_to_symbol): Remove mapping to QCUT_BUFFERn.
10 (Fx_get_cut_buffer_internal, Fx_store_cut_buffer_internal)
11 (Fx_rotate_cut_buffers_internal): Remove.
12 (syms_of_xselect): Remove defsubr of above.
13 Remove intern of QCUT_BUFFERn.
14
12010-09-01 Stefan Monnier <monnier@iro.umontreal.ca> 152010-09-01 Stefan Monnier <monnier@iro.umontreal.ca>
2 16
3 * cmds.c (Vblink_paren_function): Remove. 17 * cmds.c (Vblink_paren_function): Remove.
diff --git a/src/xselect.c b/src/xselect.c
index 21684c83088..7479f245a77 100644
--- a/src/xselect.c
+++ b/src/xselect.c
@@ -83,8 +83,6 @@ static void lisp_data_to_selection_data (Display *, Lisp_Object,
83 unsigned char **, Atom *, 83 unsigned char **, Atom *,
84 unsigned *, int *, int *); 84 unsigned *, int *, int *);
85static Lisp_Object clean_local_selection_data (Lisp_Object); 85static Lisp_Object clean_local_selection_data (Lisp_Object);
86static void initialize_cut_buffers (Display *, Window);
87
88 86
89/* Printing traces to stderr. */ 87/* Printing traces to stderr. */
90 88
@@ -105,8 +103,6 @@ static void initialize_cut_buffers (Display *, Window);
105#endif 103#endif
106 104
107 105
108#define CUT_BUFFER_SUPPORT
109
110Lisp_Object QSECONDARY, QSTRING, QINTEGER, QCLIPBOARD, QTIMESTAMP, 106Lisp_Object QSECONDARY, QSTRING, QINTEGER, QCLIPBOARD, QTIMESTAMP,
111 QTEXT, QDELETE, QMULTIPLE, QINCR, QEMACS_TMP, QTARGETS, QATOM, QNULL, 107 QTEXT, QDELETE, QMULTIPLE, QINCR, QEMACS_TMP, QTARGETS, QATOM, QNULL,
112 QATOM_PAIR; 108 QATOM_PAIR;
@@ -116,11 +112,6 @@ Lisp_Object QUTF8_STRING; /* This is a type of selection. */
116 112
117Lisp_Object Qcompound_text_with_extensions; 113Lisp_Object Qcompound_text_with_extensions;
118 114
119#ifdef CUT_BUFFER_SUPPORT
120Lisp_Object QCUT_BUFFER0, QCUT_BUFFER1, QCUT_BUFFER2, QCUT_BUFFER3,
121 QCUT_BUFFER4, QCUT_BUFFER5, QCUT_BUFFER6, QCUT_BUFFER7;
122#endif
123
124static Lisp_Object Vx_lost_selection_functions; 115static Lisp_Object Vx_lost_selection_functions;
125static Lisp_Object Vx_sent_selection_functions; 116static Lisp_Object Vx_sent_selection_functions;
126static Lisp_Object Qforeign_selection; 117static Lisp_Object Qforeign_selection;
@@ -270,16 +261,6 @@ symbol_to_x_atom (struct x_display_info *dpyinfo, Display *display, Lisp_Object
270 if (EQ (sym, QEMACS_TMP)) return dpyinfo->Xatom_EMACS_TMP; 261 if (EQ (sym, QEMACS_TMP)) return dpyinfo->Xatom_EMACS_TMP;
271 if (EQ (sym, QTARGETS)) return dpyinfo->Xatom_TARGETS; 262 if (EQ (sym, QTARGETS)) return dpyinfo->Xatom_TARGETS;
272 if (EQ (sym, QNULL)) return dpyinfo->Xatom_NULL; 263 if (EQ (sym, QNULL)) return dpyinfo->Xatom_NULL;
273#ifdef CUT_BUFFER_SUPPORT
274 if (EQ (sym, QCUT_BUFFER0)) return XA_CUT_BUFFER0;
275 if (EQ (sym, QCUT_BUFFER1)) return XA_CUT_BUFFER1;
276 if (EQ (sym, QCUT_BUFFER2)) return XA_CUT_BUFFER2;
277 if (EQ (sym, QCUT_BUFFER3)) return XA_CUT_BUFFER3;
278 if (EQ (sym, QCUT_BUFFER4)) return XA_CUT_BUFFER4;
279 if (EQ (sym, QCUT_BUFFER5)) return XA_CUT_BUFFER5;
280 if (EQ (sym, QCUT_BUFFER6)) return XA_CUT_BUFFER6;
281 if (EQ (sym, QCUT_BUFFER7)) return XA_CUT_BUFFER7;
282#endif
283 if (!SYMBOLP (sym)) abort (); 264 if (!SYMBOLP (sym)) abort ();
284 265
285 TRACE1 (" XInternAtom %s", (char *) SDATA (SYMBOL_NAME (sym))); 266 TRACE1 (" XInternAtom %s", (char *) SDATA (SYMBOL_NAME (sym)));
@@ -315,24 +296,6 @@ x_atom_to_symbol (Display *dpy, Atom atom)
315 return QINTEGER; 296 return QINTEGER;
316 case XA_ATOM: 297 case XA_ATOM:
317 return QATOM; 298 return QATOM;
318#ifdef CUT_BUFFER_SUPPORT
319 case XA_CUT_BUFFER0:
320 return QCUT_BUFFER0;
321 case XA_CUT_BUFFER1:
322 return QCUT_BUFFER1;
323 case XA_CUT_BUFFER2:
324 return QCUT_BUFFER2;
325 case XA_CUT_BUFFER3:
326 return QCUT_BUFFER3;
327 case XA_CUT_BUFFER4:
328 return QCUT_BUFFER4;
329 case XA_CUT_BUFFER5:
330 return QCUT_BUFFER5;
331 case XA_CUT_BUFFER6:
332 return QCUT_BUFFER6;
333 case XA_CUT_BUFFER7:
334 return QCUT_BUFFER7;
335#endif
336 } 299 }
337 300
338 dpyinfo = x_display_info_for_display (dpy); 301 dpyinfo = x_display_info_for_display (dpy);
@@ -2258,195 +2221,6 @@ and t is the same as `SECONDARY'. */)
2258} 2221}
2259 2222
2260 2223
2261#ifdef CUT_BUFFER_SUPPORT
2262
2263/* Ensure that all 8 cut buffers exist. ICCCM says we gotta... */
2264static void
2265initialize_cut_buffers (Display *display, Window window)
2266{
2267 unsigned char *data = (unsigned char *) "";
2268 BLOCK_INPUT;
2269#define FROB(atom) XChangeProperty (display, window, atom, XA_STRING, 8, \
2270 PropModeAppend, data, 0)
2271 FROB (XA_CUT_BUFFER0);
2272 FROB (XA_CUT_BUFFER1);
2273 FROB (XA_CUT_BUFFER2);
2274 FROB (XA_CUT_BUFFER3);
2275 FROB (XA_CUT_BUFFER4);
2276 FROB (XA_CUT_BUFFER5);
2277 FROB (XA_CUT_BUFFER6);
2278 FROB (XA_CUT_BUFFER7);
2279#undef FROB
2280 UNBLOCK_INPUT;
2281}
2282
2283
2284#define CHECK_CUT_BUFFER(symbol) \
2285 do { CHECK_SYMBOL ((symbol)); \
2286 if (!EQ((symbol), QCUT_BUFFER0) && !EQ((symbol), QCUT_BUFFER1) \
2287 && !EQ((symbol), QCUT_BUFFER2) && !EQ((symbol), QCUT_BUFFER3) \
2288 && !EQ((symbol), QCUT_BUFFER4) && !EQ((symbol), QCUT_BUFFER5) \
2289 && !EQ((symbol), QCUT_BUFFER6) && !EQ((symbol), QCUT_BUFFER7)) \
2290 signal_error ("Doesn't name a cut buffer", (symbol)); \
2291 } while (0)
2292
2293DEFUN ("x-get-cut-buffer-internal", Fx_get_cut_buffer_internal,
2294 Sx_get_cut_buffer_internal, 1, 1, 0,
2295 doc: /* Returns the value of the named cut buffer (typically CUT_BUFFER0). */)
2296 (Lisp_Object buffer)
2297{
2298 Window window;
2299 Atom buffer_atom;
2300 unsigned char *data = NULL;
2301 int bytes;
2302 Atom type;
2303 int format;
2304 unsigned long size;
2305 Lisp_Object ret;
2306 Display *display;
2307 struct x_display_info *dpyinfo;
2308 struct frame *sf = SELECTED_FRAME ();
2309
2310 check_x ();
2311
2312 if (! FRAME_X_P (sf))
2313 return Qnil;
2314
2315 display = FRAME_X_DISPLAY (sf);
2316 dpyinfo = FRAME_X_DISPLAY_INFO (sf);
2317 window = RootWindow (display, 0); /* Cut buffers are on screen 0 */
2318 CHECK_CUT_BUFFER (buffer);
2319 buffer_atom = symbol_to_x_atom (dpyinfo, display, buffer);
2320
2321 x_get_window_property (display, window, buffer_atom, &data, &bytes,
2322 &type, &format, &size, 0);
2323
2324 if (!data || !format)
2325 {
2326 xfree (data);
2327 return Qnil;
2328 }
2329
2330 if (format != 8 || type != XA_STRING)
2331 signal_error ("Cut buffer doesn't contain 8-bit data",
2332 list2 (x_atom_to_symbol (display, type),
2333 make_number (format)));
2334
2335 ret = (bytes ? make_unibyte_string ((char *) data, bytes) : Qnil);
2336 /* Use xfree, not XFree, because x_get_window_property
2337 calls xmalloc itself. */
2338 xfree (data);
2339 return ret;
2340}
2341
2342
2343DEFUN ("x-store-cut-buffer-internal", Fx_store_cut_buffer_internal,
2344 Sx_store_cut_buffer_internal, 2, 2, 0,
2345 doc: /* Sets the value of the named cut buffer (typically CUT_BUFFER0). */)
2346 (Lisp_Object buffer, Lisp_Object string)
2347{
2348 Window window;
2349 Atom buffer_atom;
2350 unsigned char *data;
2351 int bytes;
2352 int bytes_remaining;
2353 int max_bytes;
2354 Display *display;
2355 struct frame *sf = SELECTED_FRAME ();
2356
2357 check_x ();
2358
2359 if (! FRAME_X_P (sf))
2360 return Qnil;
2361
2362 display = FRAME_X_DISPLAY (sf);
2363 window = RootWindow (display, 0); /* Cut buffers are on screen 0 */
2364
2365 max_bytes = SELECTION_QUANTUM (display);
2366 if (max_bytes > MAX_SELECTION_QUANTUM)
2367 max_bytes = MAX_SELECTION_QUANTUM;
2368
2369 CHECK_CUT_BUFFER (buffer);
2370 CHECK_STRING (string);
2371 buffer_atom = symbol_to_x_atom (FRAME_X_DISPLAY_INFO (sf),
2372 display, buffer);
2373 data = (unsigned char *) SDATA (string);
2374 bytes = SBYTES (string);
2375 bytes_remaining = bytes;
2376
2377 if (! FRAME_X_DISPLAY_INFO (sf)->cut_buffers_initialized)
2378 {
2379 initialize_cut_buffers (display, window);
2380 FRAME_X_DISPLAY_INFO (sf)->cut_buffers_initialized = 1;
2381 }
2382
2383 BLOCK_INPUT;
2384
2385 /* Don't mess up with an empty value. */
2386 if (!bytes_remaining)
2387 XChangeProperty (display, window, buffer_atom, XA_STRING, 8,
2388 PropModeReplace, data, 0);
2389
2390 while (bytes_remaining)
2391 {
2392 int chunk = (bytes_remaining < max_bytes
2393 ? bytes_remaining : max_bytes);
2394 XChangeProperty (display, window, buffer_atom, XA_STRING, 8,
2395 (bytes_remaining == bytes
2396 ? PropModeReplace
2397 : PropModeAppend),
2398 data, chunk);
2399 data += chunk;
2400 bytes_remaining -= chunk;
2401 }
2402 UNBLOCK_INPUT;
2403 return string;
2404}
2405
2406
2407DEFUN ("x-rotate-cut-buffers-internal", Fx_rotate_cut_buffers_internal,
2408 Sx_rotate_cut_buffers_internal, 1, 1, 0,
2409 doc: /* Rotate the values of the cut buffers by N steps.
2410Positive N means shift the values forward, negative means backward. */)
2411 (Lisp_Object n)
2412{
2413 Window window;
2414 Atom props[8];
2415 Display *display;
2416 struct frame *sf = SELECTED_FRAME ();
2417
2418 check_x ();
2419
2420 if (! FRAME_X_P (sf))
2421 return Qnil;
2422
2423 display = FRAME_X_DISPLAY (sf);
2424 window = RootWindow (display, 0); /* Cut buffers are on screen 0 */
2425 CHECK_NUMBER (n);
2426 if (XINT (n) == 0)
2427 return n;
2428 if (! FRAME_X_DISPLAY_INFO (sf)->cut_buffers_initialized)
2429 {
2430 initialize_cut_buffers (display, window);
2431 FRAME_X_DISPLAY_INFO (sf)->cut_buffers_initialized = 1;
2432 }
2433
2434 props[0] = XA_CUT_BUFFER0;
2435 props[1] = XA_CUT_BUFFER1;
2436 props[2] = XA_CUT_BUFFER2;
2437 props[3] = XA_CUT_BUFFER3;
2438 props[4] = XA_CUT_BUFFER4;
2439 props[5] = XA_CUT_BUFFER5;
2440 props[6] = XA_CUT_BUFFER6;
2441 props[7] = XA_CUT_BUFFER7;
2442 BLOCK_INPUT;
2443 XRotateWindowProperties (display, window, props, 8, XINT (n));
2444 UNBLOCK_INPUT;
2445 return n;
2446}
2447
2448#endif
2449
2450/*********************************************************************** 2224/***********************************************************************
2451 Drag and drop support 2225 Drag and drop support
2452***********************************************************************/ 2226***********************************************************************/
@@ -2850,12 +2624,6 @@ syms_of_xselect (void)
2850 defsubr (&Sx_selection_owner_p); 2624 defsubr (&Sx_selection_owner_p);
2851 defsubr (&Sx_selection_exists_p); 2625 defsubr (&Sx_selection_exists_p);
2852 2626
2853#ifdef CUT_BUFFER_SUPPORT
2854 defsubr (&Sx_get_cut_buffer_internal);
2855 defsubr (&Sx_store_cut_buffer_internal);
2856 defsubr (&Sx_rotate_cut_buffers_internal);
2857#endif
2858
2859 defsubr (&Sx_get_atom_name); 2627 defsubr (&Sx_get_atom_name);
2860 defsubr (&Sx_send_client_message); 2628 defsubr (&Sx_send_client_message);
2861 defsubr (&Sx_register_dnd_atom); 2629 defsubr (&Sx_register_dnd_atom);
@@ -2937,17 +2705,6 @@ A value of 0 means wait as long as necessary. This is initialized from the
2937 Qcompound_text_with_extensions = intern_c_string ("compound-text-with-extensions"); 2705 Qcompound_text_with_extensions = intern_c_string ("compound-text-with-extensions");
2938 staticpro (&Qcompound_text_with_extensions); 2706 staticpro (&Qcompound_text_with_extensions);
2939 2707
2940#ifdef CUT_BUFFER_SUPPORT
2941 QCUT_BUFFER0 = intern_c_string ("CUT_BUFFER0"); staticpro (&QCUT_BUFFER0);
2942 QCUT_BUFFER1 = intern_c_string ("CUT_BUFFER1"); staticpro (&QCUT_BUFFER1);
2943 QCUT_BUFFER2 = intern_c_string ("CUT_BUFFER2"); staticpro (&QCUT_BUFFER2);
2944 QCUT_BUFFER3 = intern_c_string ("CUT_BUFFER3"); staticpro (&QCUT_BUFFER3);
2945 QCUT_BUFFER4 = intern_c_string ("CUT_BUFFER4"); staticpro (&QCUT_BUFFER4);
2946 QCUT_BUFFER5 = intern_c_string ("CUT_BUFFER5"); staticpro (&QCUT_BUFFER5);
2947 QCUT_BUFFER6 = intern_c_string ("CUT_BUFFER6"); staticpro (&QCUT_BUFFER6);
2948 QCUT_BUFFER7 = intern_c_string ("CUT_BUFFER7"); staticpro (&QCUT_BUFFER7);
2949#endif
2950
2951 Qforeign_selection = intern_c_string ("foreign-selection"); 2708 Qforeign_selection = intern_c_string ("foreign-selection");
2952 staticpro (&Qforeign_selection); 2709 staticpro (&Qforeign_selection);
2953} 2710}
diff --git a/src/xterm.c b/src/xterm.c
index c049ce78913..2ebe8a80378 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -10124,8 +10124,6 @@ x_term_init (Lisp_Object display_name, char *xrm_option, char *resource_name)
10124 dpyinfo->Xatom_net_wm_name 10124 dpyinfo->Xatom_net_wm_name
10125 = XInternAtom (dpyinfo->display, "_NET_WM_NAME", False); 10125 = XInternAtom (dpyinfo->display, "_NET_WM_NAME", False);
10126 10126
10127 dpyinfo->cut_buffers_initialized = 0;
10128
10129 dpyinfo->x_dnd_atoms_size = 8; 10127 dpyinfo->x_dnd_atoms_size = 8;
10130 dpyinfo->x_dnd_atoms_length = 0; 10128 dpyinfo->x_dnd_atoms_length = 0;
10131 dpyinfo->x_dnd_atoms = xmalloc (sizeof (*dpyinfo->x_dnd_atoms) 10129 dpyinfo->x_dnd_atoms = xmalloc (sizeof (*dpyinfo->x_dnd_atoms)
diff --git a/src/xterm.h b/src/xterm.h
index 972bfb50dc3..d884945f985 100644
--- a/src/xterm.h
+++ b/src/xterm.h
@@ -299,8 +299,6 @@ struct x_display_info
299 /* Atom used in XEmbed client messages. */ 299 /* Atom used in XEmbed client messages. */
300 Atom Xatom_XEMBED; 300 Atom Xatom_XEMBED;
301 301
302 int cut_buffers_initialized; /* Whether we're sure they all exist */
303
304 /* The frame (if any) which has the X window that has keyboard focus. 302 /* The frame (if any) which has the X window that has keyboard focus.
305 Zero if none. This is examined by Ffocus_frame in xfns.c. Note 303 Zero if none. This is examined by Ffocus_frame in xfns.c. Note
306 that a mere EnterNotify event can set this; if you need to know the 304 that a mere EnterNotify event can set this; if you need to know the