diff options
author | Karoly Lorentey <lorentey@elte.hu> | 2006-07-29 09:59:12 +0000 |
---|---|---|
committer | Karoly Lorentey <lorentey@elte.hu> | 2006-07-29 09:59:12 +0000 |
commit | 251bc578cc636223d618d06cf2a2bb7d07db9cce (patch) | |
tree | 58e1c6b0a35bb4a77e6cb77876e4bc6a9d3f2ab2 /src/xselect.c | |
parent | 99715bbc447eb633e45ffa23b87284771ce3ac74 (diff) | |
parent | 0ed0527cb02180a50f6744086ce3a487740c73e4 (diff) | |
download | emacs-251bc578cc636223d618d06cf2a2bb7d07db9cce.tar.gz |
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.c | 82 |
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) && INTEGERP (XCAR (XCDR (check))) && NILP (XCDR (XCDR (check)))))) return value; - else - return - Fsignal (Qerror, - Fcons (build_string ("invalid data returned by selection-conversion function"), - Fcons (handler_fn, Fcons (value, Qnil)))); + + signal_error ("Invalid data returned by selection-conversion function", + list2 (handler_fn, value)); } /* Subroutines of x_reply_selection_request. */ @@ -1356,8 +1354,7 @@ copy_multiple_data (obj) CHECK_VECTOR (vec2); if (XVECTOR (vec2)->size != 2) /* ??? Confusing error message */ - Fsignal (Qerror, Fcons (build_string ("vectors must be of length 2"), - Fcons (vec2, Qnil))); + signal_error ("Vectors must be of length 2", vec2); XVECTOR (vec)->contents [i] = Fmake_vector (2, Qnil); XVECTOR (XVECTOR (vec)->contents [i])->contents [0] = XVECTOR (vec2)->contents [0]; @@ -1734,19 +1731,15 @@ x_get_window_property_as_lisp_data (display, window, property, target_type, there_is_a_selection_owner = XGetSelectionOwner (display, selection_atom); UNBLOCK_INPUT; - Fsignal (Qerror, - there_is_a_selection_owner - ? Fcons (build_string ("selection owner couldn't convert"), - actual_type - ? Fcons (target_type, - Fcons (x_atom_to_symbol (display, - actual_type), - Qnil)) - : Fcons (target_type, Qnil)) - : Fcons (build_string ("no selection"), - Fcons (x_atom_to_symbol (display, - selection_atom), - Qnil))); + if (there_is_a_selection_owner) + signal_error ("Selection owner couldn't convert", + actual_type + ? list2 (target_type, + x_atom_to_symbol (display, actual_type)) + : target_type); + else + signal_error ("No selection", + x_atom_to_symbol (display, selection_atom)); } if (actual_type == dpyinfo->Xatom_INCR) @@ -1946,10 +1939,7 @@ lisp_data_to_selection_data (display, obj, { if (SCHARS (obj) < SBYTES (obj)) /* OBJ is a multibyte string containing a non-ASCII char. */ - Fsignal (Qerror, /* Qselection_error */ - Fcons (build_string - ("Non-ASCII string must be encoded in advance"), - Fcons (obj, Qnil))); + signal_error ("Non-ASCII string must be encoded in advance", obj); if (NILP (type)) type = QSTRING; *format_ret = 8; @@ -2010,10 +2000,7 @@ lisp_data_to_selection_data (display, obj, (*(Atom **) data_ret) [i] = symbol_to_x_atom (dpyinfo, display, XVECTOR (obj)->contents [i]); else - Fsignal (Qerror, /* Qselection_error */ - Fcons (build_string - ("all elements of selection vector must have same type"), - Fcons (obj, Qnil))); + signal_error ("All elements of selection vector must have same type", obj); } #if 0 /* #### MULTIPLE doesn't work yet */ else if (VECTORP (XVECTOR (obj)->contents [0])) @@ -2029,10 +2016,9 @@ lisp_data_to_selection_data (display, obj, { Lisp_Object pair = XVECTOR (obj)->contents [i]; if (XVECTOR (pair)->size != 2) - Fsignal (Qerror, - Fcons (build_string - ("elements of the vector must be vectors of exactly two elements"), - Fcons (pair, Qnil))); + signal_error ( + "Elements of the vector must be vectors of exactly two elements", + pair); (*(Atom **) data_ret) [i * 2] = symbol_to_x_atom (dpyinfo, display, @@ -2042,10 +2028,8 @@ lisp_data_to_selection_data (display, obj, XVECTOR (pair)->contents [1]); } else - Fsignal (Qerror, - Fcons (build_string - ("all elements of the vector must be of the same type"), - Fcons (obj, Qnil))); + signal_error ("All elements of the vector must be of the same type", + obj); } #endif @@ -2060,10 +2044,9 @@ lisp_data_to_selection_data (display, obj, if (CONSP (XVECTOR (obj)->contents [i])) *format_ret = 32; else if (!INTEGERP (XVECTOR (obj)->contents [i])) - Fsignal (Qerror, /* Qselection_error */ - Fcons (build_string - ("elements of selection vector must be integers or conses of integers"), - Fcons (obj, Qnil))); + signal_error (/* Qselection_error */ + "Elements of selection vector must be integers or conses of integers", + obj); /* Use sizeof(long) even if it is more than 32 bits. See comment in x_get_window_property and x_fill_property_data. */ @@ -2080,9 +2063,7 @@ lisp_data_to_selection_data (display, obj, } } else - Fsignal (Qerror, /* Qselection_error */ - Fcons (build_string ("unrecognized selection data"), - Fcons (obj, Qnil))); + signal_error (/* Qselection_error */ "Unrecognized selection data", obj); *type_ret = symbol_to_x_atom (dpyinfo, display, type); } @@ -2371,15 +2352,13 @@ initialize_cut_buffers (display, window) #define CHECK_CUT_BUFFER(symbol) \ - { CHECK_SYMBOL ((symbol)); \ + do { CHECK_SYMBOL ((symbol)); \ if (!EQ((symbol), QCUT_BUFFER0) && !EQ((symbol), QCUT_BUFFER1) \ && !EQ((symbol), QCUT_BUFFER2) && !EQ((symbol), QCUT_BUFFER3) \ && !EQ((symbol), QCUT_BUFFER4) && !EQ((symbol), QCUT_BUFFER5) \ && !EQ((symbol), QCUT_BUFFER6) && !EQ((symbol), QCUT_BUFFER7)) \ - Fsignal (Qerror, \ - Fcons (build_string ("doesn't name a cut buffer"), \ - Fcons ((symbol), Qnil))); \ - } + signal_error ("Doesn't name a cut buffer", (symbol)); \ + } while (0) DEFUN ("x-get-cut-buffer-internal", Fx_get_cut_buffer_internal, Sx_get_cut_buffer_internal, 1, 1, 0, @@ -2416,10 +2395,9 @@ DEFUN ("x-get-cut-buffer-internal", Fx_get_cut_buffer_internal, return Qnil; if (format != 8 || type != XA_STRING) - Fsignal (Qerror, - Fcons (build_string ("cut buffer doesn't contain 8-bit data"), - Fcons (x_atom_to_symbol (display, type), - Fcons (make_number (format), Qnil)))); + signal_error ("Cut buffer doesn't contain 8-bit data", + list2 (x_atom_to_symbol (display, type), + make_number (format))); ret = (bytes ? make_unibyte_string ((char *) data, bytes) : Qnil); /* Use xfree, not XFree, because x_get_window_property |