aboutsummaryrefslogtreecommitdiffstats
path: root/src/xselect.c
diff options
context:
space:
mode:
authorKaroly Lorentey2006-07-29 09:59:12 +0000
committerKaroly Lorentey2006-07-29 09:59:12 +0000
commit251bc578cc636223d618d06cf2a2bb7d07db9cce (patch)
tree58e1c6b0a35bb4a77e6cb77876e4bc6a9d3f2ab2 /src/xselect.c
parent99715bbc447eb633e45ffa23b87284771ce3ac74 (diff)
parent0ed0527cb02180a50f6744086ce3a487740c73e4 (diff)
downloademacs-251bc578cc636223d618d06cf2a2bb7d07db9cce.tar.gz
emacs-251bc578cc636223d618d06cf2a2bb7d07db9cce.zip
Merged from emacs@sv.gnu.org
Patches applied: * emacs@sv.gnu.org/emacs--devo--0--patch-351 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-352 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-353 Merge from gnus--rel--5.10 * emacs@sv.gnu.org/emacs--devo--0--patch-354 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-355 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-356 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-357 Merge from gnus--rel--5.10 * emacs@sv.gnu.org/emacs--devo--0--patch-358 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-359 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-360 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-361 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-362 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-363 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-364 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-365 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-366 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-367 Merge from gnus--rel--5.10 * emacs@sv.gnu.org/emacs--devo--0--patch-368 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-369 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-370 Update from CVS * emacs@sv.gnu.org/gnus--rel--5.10--patch-115 Update from CVS * emacs@sv.gnu.org/gnus--rel--5.10--patch-116 Update from CVS * emacs@sv.gnu.org/gnus--rel--5.10--patch-117 Update from CVS * emacs@sv.gnu.org/gnus--rel--5.10--patch-118 Merge from emacs--devo--0 * emacs@sv.gnu.org/gnus--rel--5.10--patch-119 Update from CVS * emacs@sv.gnu.org/gnus--rel--5.10--patch-120 Update from CVS git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-573
Diffstat (limited to 'src/xselect.c')
-rw-r--r--src/xselect.c82
1 files changed, 30 insertions, 52 deletions
diff --git a/src/xselect.c b/src/xselect.c
index 5e6ffd806f0..211d207bac4 100644
--- a/src/xselect.c
+++ b/src/xselect.c
@@ -562,11 +562,9 @@ x_get_local_selection (selection_symbol, target_type, local_request)
562 && INTEGERP (XCAR (XCDR (check))) 562 && INTEGERP (XCAR (XCDR (check)))
563 && NILP (XCDR (XCDR (check)))))) 563 && NILP (XCDR (XCDR (check))))))
564 return value; 564 return value;
565 else 565
566 return 566 signal_error ("Invalid data returned by selection-conversion function",
567 Fsignal (Qerror, 567 list2 (handler_fn, value));
568 Fcons (build_string ("invalid data returned by selection-conversion function"),
569 Fcons (handler_fn, Fcons (value, Qnil))));
570} 568}
571 569
572/* Subroutines of x_reply_selection_request. */ 570/* Subroutines of x_reply_selection_request. */
@@ -1356,8 +1354,7 @@ copy_multiple_data (obj)
1356 CHECK_VECTOR (vec2); 1354 CHECK_VECTOR (vec2);
1357 if (XVECTOR (vec2)->size != 2) 1355 if (XVECTOR (vec2)->size != 2)
1358 /* ??? Confusing error message */ 1356 /* ??? Confusing error message */
1359 Fsignal (Qerror, Fcons (build_string ("vectors must be of length 2"), 1357 signal_error ("Vectors must be of length 2", vec2);
1360 Fcons (vec2, Qnil)));
1361 XVECTOR (vec)->contents [i] = Fmake_vector (2, Qnil); 1358 XVECTOR (vec)->contents [i] = Fmake_vector (2, Qnil);
1362 XVECTOR (XVECTOR (vec)->contents [i])->contents [0] 1359 XVECTOR (XVECTOR (vec)->contents [i])->contents [0]
1363 = XVECTOR (vec2)->contents [0]; 1360 = XVECTOR (vec2)->contents [0];
@@ -1734,19 +1731,15 @@ x_get_window_property_as_lisp_data (display, window, property, target_type,
1734 there_is_a_selection_owner 1731 there_is_a_selection_owner
1735 = XGetSelectionOwner (display, selection_atom); 1732 = XGetSelectionOwner (display, selection_atom);
1736 UNBLOCK_INPUT; 1733 UNBLOCK_INPUT;
1737 Fsignal (Qerror, 1734 if (there_is_a_selection_owner)
1738 there_is_a_selection_owner 1735 signal_error ("Selection owner couldn't convert",
1739 ? Fcons (build_string ("selection owner couldn't convert"), 1736 actual_type
1740 actual_type 1737 ? list2 (target_type,
1741 ? Fcons (target_type, 1738 x_atom_to_symbol (display, actual_type))
1742 Fcons (x_atom_to_symbol (display, 1739 : target_type);
1743 actual_type), 1740 else
1744 Qnil)) 1741 signal_error ("No selection",
1745 : Fcons (target_type, Qnil)) 1742 x_atom_to_symbol (display, selection_atom));
1746 : Fcons (build_string ("no selection"),
1747 Fcons (x_atom_to_symbol (display,
1748 selection_atom),
1749 Qnil)));
1750 } 1743 }
1751 1744
1752 if (actual_type == dpyinfo->Xatom_INCR) 1745 if (actual_type == dpyinfo->Xatom_INCR)
@@ -1946,10 +1939,7 @@ lisp_data_to_selection_data (display, obj,
1946 { 1939 {
1947 if (SCHARS (obj) < SBYTES (obj)) 1940 if (SCHARS (obj) < SBYTES (obj))
1948 /* OBJ is a multibyte string containing a non-ASCII char. */ 1941 /* OBJ is a multibyte string containing a non-ASCII char. */
1949 Fsignal (Qerror, /* Qselection_error */ 1942 signal_error ("Non-ASCII string must be encoded in advance", obj);
1950 Fcons (build_string
1951 ("Non-ASCII string must be encoded in advance"),
1952 Fcons (obj, Qnil)));
1953 if (NILP (type)) 1943 if (NILP (type))
1954 type = QSTRING; 1944 type = QSTRING;
1955 *format_ret = 8; 1945 *format_ret = 8;
@@ -2010,10 +2000,7 @@ lisp_data_to_selection_data (display, obj,
2010 (*(Atom **) data_ret) [i] 2000 (*(Atom **) data_ret) [i]
2011 = symbol_to_x_atom (dpyinfo, display, XVECTOR (obj)->contents [i]); 2001 = symbol_to_x_atom (dpyinfo, display, XVECTOR (obj)->contents [i]);
2012 else 2002 else
2013 Fsignal (Qerror, /* Qselection_error */ 2003 signal_error ("All elements of selection vector must have same type", obj);
2014 Fcons (build_string
2015 ("all elements of selection vector must have same type"),
2016 Fcons (obj, Qnil)));
2017 } 2004 }
2018#if 0 /* #### MULTIPLE doesn't work yet */ 2005#if 0 /* #### MULTIPLE doesn't work yet */
2019 else if (VECTORP (XVECTOR (obj)->contents [0])) 2006 else if (VECTORP (XVECTOR (obj)->contents [0]))
@@ -2029,10 +2016,9 @@ lisp_data_to_selection_data (display, obj,
2029 { 2016 {
2030 Lisp_Object pair = XVECTOR (obj)->contents [i]; 2017 Lisp_Object pair = XVECTOR (obj)->contents [i];
2031 if (XVECTOR (pair)->size != 2) 2018 if (XVECTOR (pair)->size != 2)
2032 Fsignal (Qerror, 2019 signal_error (
2033 Fcons (build_string 2020 "Elements of the vector must be vectors of exactly two elements",
2034 ("elements of the vector must be vectors of exactly two elements"), 2021 pair);
2035 Fcons (pair, Qnil)));
2036 2022
2037 (*(Atom **) data_ret) [i * 2] 2023 (*(Atom **) data_ret) [i * 2]
2038 = symbol_to_x_atom (dpyinfo, display, 2024 = symbol_to_x_atom (dpyinfo, display,
@@ -2042,10 +2028,8 @@ lisp_data_to_selection_data (display, obj,
2042 XVECTOR (pair)->contents [1]); 2028 XVECTOR (pair)->contents [1]);
2043 } 2029 }
2044 else 2030 else
2045 Fsignal (Qerror, 2031 signal_error ("All elements of the vector must be of the same type",
2046 Fcons (build_string 2032 obj);
2047 ("all elements of the vector must be of the same type"),
2048 Fcons (obj, Qnil)));
2049 2033
2050 } 2034 }
2051#endif 2035#endif
@@ -2060,10 +2044,9 @@ lisp_data_to_selection_data (display, obj,
2060 if (CONSP (XVECTOR (obj)->contents [i])) 2044 if (CONSP (XVECTOR (obj)->contents [i]))
2061 *format_ret = 32; 2045 *format_ret = 32;
2062 else if (!INTEGERP (XVECTOR (obj)->contents [i])) 2046 else if (!INTEGERP (XVECTOR (obj)->contents [i]))
2063 Fsignal (Qerror, /* Qselection_error */ 2047 signal_error (/* Qselection_error */
2064 Fcons (build_string 2048 "Elements of selection vector must be integers or conses of integers",
2065 ("elements of selection vector must be integers or conses of integers"), 2049 obj);
2066 Fcons (obj, Qnil)));
2067 2050
2068 /* Use sizeof(long) even if it is more than 32 bits. See comment 2051 /* Use sizeof(long) even if it is more than 32 bits. See comment
2069 in x_get_window_property and x_fill_property_data. */ 2052 in x_get_window_property and x_fill_property_data. */
@@ -2080,9 +2063,7 @@ lisp_data_to_selection_data (display, obj,
2080 } 2063 }
2081 } 2064 }
2082 else 2065 else
2083 Fsignal (Qerror, /* Qselection_error */ 2066 signal_error (/* Qselection_error */ "Unrecognized selection data", obj);
2084 Fcons (build_string ("unrecognized selection data"),
2085 Fcons (obj, Qnil)));
2086 2067
2087 *type_ret = symbol_to_x_atom (dpyinfo, display, type); 2068 *type_ret = symbol_to_x_atom (dpyinfo, display, type);
2088} 2069}
@@ -2371,15 +2352,13 @@ initialize_cut_buffers (display, window)
2371 2352
2372 2353
2373#define CHECK_CUT_BUFFER(symbol) \ 2354#define CHECK_CUT_BUFFER(symbol) \
2374 { CHECK_SYMBOL ((symbol)); \ 2355 do { CHECK_SYMBOL ((symbol)); \
2375 if (!EQ((symbol), QCUT_BUFFER0) && !EQ((symbol), QCUT_BUFFER1) \ 2356 if (!EQ((symbol), QCUT_BUFFER0) && !EQ((symbol), QCUT_BUFFER1) \
2376 && !EQ((symbol), QCUT_BUFFER2) && !EQ((symbol), QCUT_BUFFER3) \ 2357 && !EQ((symbol), QCUT_BUFFER2) && !EQ((symbol), QCUT_BUFFER3) \
2377 && !EQ((symbol), QCUT_BUFFER4) && !EQ((symbol), QCUT_BUFFER5) \ 2358 && !EQ((symbol), QCUT_BUFFER4) && !EQ((symbol), QCUT_BUFFER5) \
2378 && !EQ((symbol), QCUT_BUFFER6) && !EQ((symbol), QCUT_BUFFER7)) \ 2359 && !EQ((symbol), QCUT_BUFFER6) && !EQ((symbol), QCUT_BUFFER7)) \
2379 Fsignal (Qerror, \ 2360 signal_error ("Doesn't name a cut buffer", (symbol)); \
2380 Fcons (build_string ("doesn't name a cut buffer"), \ 2361 } while (0)
2381 Fcons ((symbol), Qnil))); \
2382 }
2383 2362
2384DEFUN ("x-get-cut-buffer-internal", Fx_get_cut_buffer_internal, 2363DEFUN ("x-get-cut-buffer-internal", Fx_get_cut_buffer_internal,
2385 Sx_get_cut_buffer_internal, 1, 1, 0, 2364 Sx_get_cut_buffer_internal, 1, 1, 0,
@@ -2416,10 +2395,9 @@ DEFUN ("x-get-cut-buffer-internal", Fx_get_cut_buffer_internal,
2416 return Qnil; 2395 return Qnil;
2417 2396
2418 if (format != 8 || type != XA_STRING) 2397 if (format != 8 || type != XA_STRING)
2419 Fsignal (Qerror, 2398 signal_error ("Cut buffer doesn't contain 8-bit data",
2420 Fcons (build_string ("cut buffer doesn't contain 8-bit data"), 2399 list2 (x_atom_to_symbol (display, type),
2421 Fcons (x_atom_to_symbol (display, type), 2400 make_number (format)));
2422 Fcons (make_number (format), Qnil))));
2423 2401
2424 ret = (bytes ? make_unibyte_string ((char *) data, bytes) : Qnil); 2402 ret = (bytes ? make_unibyte_string ((char *) data, bytes) : Qnil);
2425 /* Use xfree, not XFree, because x_get_window_property 2403 /* Use xfree, not XFree, because x_get_window_property