aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKaroly Lorentey2006-02-28 17:35:08 +0000
committerKaroly Lorentey2006-02-28 17:35:08 +0000
commitbdf36482bbea390390ae7ab1461b14b807c4fb1f (patch)
treeb5233d2eecc5dc15e0d4590bb8b006978470c1f9 /src
parent769ca8d5851c58825954d69ffc9b6033db650204 (diff)
parent3ea32d7481523bbb0c54b90606687dcba5c5a405 (diff)
downloademacs-bdf36482bbea390390ae7ab1461b14b807c4fb1f.tar.gz
emacs-bdf36482bbea390390ae7ab1461b14b807c4fb1f.zip
Merged from emacs@sv.gnu.org
Patches applied: * emacs@sv.gnu.org/emacs--devo--0--patch-120 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-121 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-122 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-123 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-124 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-125 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-126 Merge from gnus--rel--5.10 * emacs@sv.gnu.org/emacs--devo--0--patch-127 Update from CVS * emacs@sv.gnu.org/gnus--rel--5.10--patch-40 Merge from emacs--devo--0 * emacs@sv.gnu.org/gnus--rel--5.10--patch-41 Update from CVS * emacs@sv.gnu.org/gnus--rel--5.10--patch-42 Update from CVS git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-523
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog82
-rw-r--r--src/buffer.c5
-rw-r--r--src/eval.c4
-rw-r--r--src/gtkutil.c18
-rw-r--r--src/lisp.h9
-rw-r--r--src/lread.c87
-rw-r--r--src/process.c8
-rw-r--r--src/w32.c2
-rw-r--r--src/xfns.c16
-rw-r--r--src/xselect.c35
-rw-r--r--src/xterm.c102
-rw-r--r--src/xterm.h8
12 files changed, 242 insertions, 134 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index d8e0b6fb4e1..79db6d09d0b 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,85 @@
12006-02-26 Chong Yidong <cyd@stupidchicken.com>
2
3 * xterm.h, xterm.c (x_uncatch_errors): Delete unneccessary
4 argument.
5
6 * xterm.c: (x_load_font, x_term_init, XTmouse_position)
7 (handle_one_xevent, x_connection_closed, x_list_fonts): No arg for
8 x_uncatch_errors.
9
10 * xselect.c (x_own_selection, x_decline_selection_request)
11 (x_reply_selection_request, x_get_foreign_selection)
12 (Fx_get_atom_name, Fx_send_client_event): Likewise.
13
14 * xfns.c (x_real_positions, x_set_mouse_color, Fx_focus_frame):
15 Likewise.
16
172006-02-26 Luc Teirlinck <teirllm@auburn.edu>
18
19 * lread.c: Declare Vload_file_rep_suffixes instead of
20 deleted variable default_suffixes.
21 (Fget_load_suffixes): New function.
22 (Fload): Use Fget_load_suffixes and Vload_file_rep_suffixes.
23 No longer use deleted variable default_suffixes. Update docstring.
24 (syms_of_lread): defsubr Sget_load_suffixes.
25 Expand `load-suffixes' docstring.
26 Delete default_suffixes and DEFVAR_LISP the new variable
27 `load-file-rep-suffixes'.
28
29 * w32.c (check_windows_init_file): Use Fget_load_suffixes instead
30 of Vload_suffixes.
31
32 * lisp.h: EXFUN Fget_load_suffixes.
33 Extern Vload_file_rep_suffixes.
34
35 * eval.c (specpdl_ptr): Remove volatile qualifier for consistency
36 with lisp.h.
37
382006-02-26 Stefan Monnier <monnier@iro.umontreal.ca>
39
40 * lisp.h (struct specbinding, specpdl_ptr): Remove the volatile
41 qualifier which was trying to avoid the bug that was fixed by
42 yesterday's changes to xterm.c.
43
442006-02-25 Chong Yidong <cyd@stupidchicken.com>
45
46 * xterm.h (x_catch_errors) Return value changed to void.
47 (x_uncatch_errors): Delete unused count argument.
48
49 * xterm.c (x_catch_errors): Don't use record_unwind_protect, since
50 it can be called in a signal handler.
51 (x_catch_errors_unwind): Function deleted.
52 (x_uncatch_errors): Deallocate last x_error_message_stack struct.
53 (x_check_errors): Call x_uncatch_errors before signalling error.
54
55 (x_load_font, x_term_init, XTmouse_position, handle_one_xevent)
56 (x_connection_closed, x_list_fonts): Use new versions of
57 x_catch_errors and x_uncatch_errors.
58
59 * xselect.c (x_own_selection, x_decline_selection_request)
60 (x_reply_selection_request, x_get_foreign_selection)
61 (Fx_get_atom_name, Fx_send_client_event): Likewise.
62
63 * xfns.c (x_real_positions, x_set_mouse_color, Fx_focus_frame):
64 Likewise.
65
66 * eval.c (record_unwind_protect): Add an assertion.
67
682006-02-25 Stefan Monnier <monnier@iro.umontreal.ca>
69
70 * process.c (Fmake_network_process): Init the process's mark.
71
722006-02-25 Kim F. Storm <storm@cua.dk>
73
74 * buffer.c (modify_overlay): Force redisplay if we modify an
75 overlay at the end of the buffer.
76
772006-02-24 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
78
79 * gtkutil.c (xg_get_image_for_pixmap): If x_find_image_file returns
80 nil the image file has been removed, in that case use the (cached)
81 pixmap.
82
12006-02-24 Kenichi Handa <handa@m17n.org> 832006-02-24 Kenichi Handa <handa@m17n.org>
2 84
3 * fileio.c (Finsert_file_contents): When a text is replaced 85 * fileio.c (Finsert_file_contents): When a text is replaced
diff --git a/src/buffer.c b/src/buffer.c
index e1caaac5f89..baa977ab853 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -3679,6 +3679,10 @@ modify_overlay (buf, start, end)
3679 /* If multiple windows show this buffer, we must do other windows. */ 3679 /* If multiple windows show this buffer, we must do other windows. */
3680 else if (buffer_shared > 1) 3680 else if (buffer_shared > 1)
3681 windows_or_buffers_changed = 1; 3681 windows_or_buffers_changed = 1;
3682 /* If we modify an overlay at the end of the buffer, we cannot
3683 be sure that window end is still valid. */
3684 else if (end >= ZV && start <= ZV)
3685 windows_or_buffers_changed = 1;
3682 3686
3683 ++BUF_OVERLAY_MODIFF (buf); 3687 ++BUF_OVERLAY_MODIFF (buf);
3684} 3688}
@@ -4120,6 +4124,7 @@ DEFUN ("overlay-put", Foverlay_put, Soverlay_put, 3, 3, 0,
4120 == OVERLAY_POSITION (OVERLAY_END (overlay)))) 4124 == OVERLAY_POSITION (OVERLAY_END (overlay))))
4121 Fdelete_overlay (overlay); 4125 Fdelete_overlay (overlay);
4122 } 4126 }
4127
4123 return value; 4128 return value;
4124} 4129}
4125 4130
diff --git a/src/eval.c b/src/eval.c
index eff284820f0..a84948981f4 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -117,7 +117,7 @@ struct specbinding *specpdl;
117 117
118/* Pointer to first unused element in specpdl. */ 118/* Pointer to first unused element in specpdl. */
119 119
120volatile struct specbinding *specpdl_ptr; 120struct specbinding *specpdl_ptr;
121 121
122/* Maximum size allowed for specpdl allocation */ 122/* Maximum size allowed for specpdl allocation */
123 123
@@ -3199,6 +3199,8 @@ record_unwind_protect (function, arg)
3199 Lisp_Object (*function) P_ ((Lisp_Object)); 3199 Lisp_Object (*function) P_ ((Lisp_Object));
3200 Lisp_Object arg; 3200 Lisp_Object arg;
3201{ 3201{
3202 eassert (!handling_signal);
3203
3202 if (specpdl_ptr == specpdl + specpdl_size) 3204 if (specpdl_ptr == specpdl + specpdl_size)
3203 grow_specpdl (); 3205 grow_specpdl ();
3204 specpdl_ptr->func = function; 3206 specpdl_ptr->func = function;
diff --git a/src/gtkutil.c b/src/gtkutil.c
index 203eab257f3..b8d37df2214 100644
--- a/src/gtkutil.c
+++ b/src/gtkutil.c
@@ -327,6 +327,7 @@ xg_get_image_for_pixmap (f, img, widget, old_widget)
327 look good in all cases. */ 327 look good in all cases. */
328 Lisp_Object specified_file = Qnil; 328 Lisp_Object specified_file = Qnil;
329 Lisp_Object tail; 329 Lisp_Object tail;
330 Lisp_Object file;
330 extern Lisp_Object QCfile; 331 extern Lisp_Object QCfile;
331 332
332 for (tail = XCDR (img->spec); 333 for (tail = XCDR (img->spec);
@@ -335,23 +336,18 @@ xg_get_image_for_pixmap (f, img, widget, old_widget)
335 if (EQ (XCAR (tail), QCfile)) 336 if (EQ (XCAR (tail), QCfile))
336 specified_file = XCAR (XCDR (tail)); 337 specified_file = XCAR (XCDR (tail));
337 338
338 if (STRINGP (specified_file)) 339 /* We already loaded the image once before calling this
339 { 340 function, so this only fails if the image file has been removed.
340 Lisp_Object file = Qnil; 341 In that case, use the pixmap already loaded. */
341 struct gcpro gcpro1;
342 GCPRO1 (file);
343
344 file = x_find_image_file (specified_file);
345 /* We already loaded the image once before calling this
346 function, so this should not fail. */
347 xassert (STRINGP (file) != 0);
348 342
343 if (STRINGP (specified_file)
344 && STRINGP (file = x_find_image_file (specified_file)))
345 {
349 if (! old_widget) 346 if (! old_widget)
350 old_widget = GTK_IMAGE (gtk_image_new_from_file (SSDATA (file))); 347 old_widget = GTK_IMAGE (gtk_image_new_from_file (SSDATA (file)));
351 else 348 else
352 gtk_image_set_from_file (old_widget, SSDATA (file)); 349 gtk_image_set_from_file (old_widget, SSDATA (file));
353 350
354 UNGCPRO;
355 return GTK_WIDGET (old_widget); 351 return GTK_WIDGET (old_widget);
356 } 352 }
357 353
diff --git a/src/lisp.h b/src/lisp.h
index 63c643604d1..4cca3a60cad 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -1744,13 +1744,13 @@ typedef Lisp_Object (*specbinding_func) P_ ((Lisp_Object));
1744 1744
1745struct specbinding 1745struct specbinding
1746 { 1746 {
1747 volatile Lisp_Object symbol, old_value; 1747 Lisp_Object symbol, old_value;
1748 volatile specbinding_func func; 1748 specbinding_func func;
1749 Lisp_Object unused; /* Dividing by 16 is faster than by 12 */ 1749 Lisp_Object unused; /* Dividing by 16 is faster than by 12 */
1750 }; 1750 };
1751 1751
1752extern struct specbinding *specpdl; 1752extern struct specbinding *specpdl;
1753extern volatile struct specbinding *specpdl_ptr; 1753extern struct specbinding *specpdl_ptr;
1754extern int specpdl_size; 1754extern int specpdl_size;
1755 1755
1756extern EMACS_INT max_specpdl_size; 1756extern EMACS_INT max_specpdl_size;
@@ -2603,6 +2603,7 @@ EXFUN (Fread_from_string, 3);
2603EXFUN (Fintern, 2); 2603EXFUN (Fintern, 2);
2604EXFUN (Fintern_soft, 2); 2604EXFUN (Fintern_soft, 2);
2605EXFUN (Fload, 5); 2605EXFUN (Fload, 5);
2606EXFUN (Fget_load_suffixes, 0);
2606EXFUN (Fget_file_char, 0); 2607EXFUN (Fget_file_char, 0);
2607EXFUN (Fread_char, 2); 2608EXFUN (Fread_char, 2);
2608EXFUN (Fread_event, 2); 2609EXFUN (Fread_event, 2);
@@ -2614,7 +2615,7 @@ extern Lisp_Object oblookup P_ ((Lisp_Object, const char *, int, int));
2614#define LOADHIST_ATTACH(x) \ 2615#define LOADHIST_ATTACH(x) \
2615 if (initialized) Vcurrent_load_list = Fcons (x, Vcurrent_load_list) 2616 if (initialized) Vcurrent_load_list = Fcons (x, Vcurrent_load_list)
2616extern Lisp_Object Vcurrent_load_list; 2617extern Lisp_Object Vcurrent_load_list;
2617extern Lisp_Object Vload_history, Vload_suffixes; 2618extern Lisp_Object Vload_history, Vload_suffixes, Vload_file_rep_suffixes;
2618extern int openp P_ ((Lisp_Object, Lisp_Object, Lisp_Object, 2619extern int openp P_ ((Lisp_Object, Lisp_Object, Lisp_Object,
2619 Lisp_Object *, Lisp_Object)); 2620 Lisp_Object *, Lisp_Object));
2620extern int isfloat_string P_ ((char *)); 2621extern int isfloat_string P_ ((char *));
diff --git a/src/lread.c b/src/lread.c
index a23278b63ab..d0442d38fda 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -100,7 +100,7 @@ int load_in_progress;
100Lisp_Object Vsource_directory; 100Lisp_Object Vsource_directory;
101 101
102/* Search path and suffixes for files to be loaded. */ 102/* Search path and suffixes for files to be loaded. */
103Lisp_Object Vload_path, Vload_suffixes, default_suffixes; 103Lisp_Object Vload_path, Vload_suffixes, Vload_file_rep_suffixes;
104 104
105/* File name of user's init file. */ 105/* File name of user's init file. */
106Lisp_Object Vuser_init_file; 106Lisp_Object Vuser_init_file;
@@ -655,28 +655,64 @@ load_error_handler (data)
655 return Qnil; 655 return Qnil;
656} 656}
657 657
658DEFUN ("get-load-suffixes", Fget_load_suffixes, Sget_load_suffixes, 0, 0, 0,
659 doc: /* Return the suffixes that `load' should try if a suffix is \
660required.
661This uses the variables `load-suffixes' and `load-file-rep-suffixes'. */)
662 ()
663{
664 Lisp_Object lst = Qnil, suffixes = Vload_suffixes, suffix, ext;
665 while (CONSP (suffixes))
666 {
667 Lisp_Object exts = Vload_file_rep_suffixes;
668 suffix = XCAR (suffixes);
669 suffixes = XCDR (suffixes);
670 while (CONSP (exts))
671 {
672 ext = XCAR (exts);
673 exts = XCDR (exts);
674 lst = Fcons (concat2 (suffix, ext), lst);
675 }
676 }
677 return Fnreverse (lst);
678}
679
658DEFUN ("load", Fload, Sload, 1, 5, 0, 680DEFUN ("load", Fload, Sload, 1, 5, 0,
659 doc: /* Execute a file of Lisp code named FILE. 681 doc: /* Execute a file of Lisp code named FILE.
660First try FILE with `.elc' appended, then try with `.el', 682First try FILE with `.elc' appended, then try with `.el',
661 then try FILE unmodified (the exact suffixes are determined by 683then try FILE unmodified (the exact suffixes in the exact order are
662`load-suffixes'). Environment variable references in FILE 684determined by `load-suffixes'). Environment variable references in
663 are replaced with their values by calling `substitute-in-file-name'. 685FILE are replaced with their values by calling `substitute-in-file-name'.
664This function searches the directories in `load-path'. 686This function searches the directories in `load-path'.
687
665If optional second arg NOERROR is non-nil, 688If optional second arg NOERROR is non-nil,
666 report no error if FILE doesn't exist. 689report no error if FILE doesn't exist.
667Print messages at start and end of loading unless 690Print messages at start and end of loading unless
668 optional third arg NOMESSAGE is non-nil. 691optional third arg NOMESSAGE is non-nil.
669If optional fourth arg NOSUFFIX is non-nil, don't try adding 692If optional fourth arg NOSUFFIX is non-nil, don't try adding
670 suffixes `.elc' or `.el' to the specified name FILE. 693suffixes `.elc' or `.el' to the specified name FILE.
671If optional fifth arg MUST-SUFFIX is non-nil, insist on 694If optional fifth arg MUST-SUFFIX is non-nil, insist on
672 the suffix `.elc' or `.el'; don't accept just FILE unless 695the suffix `.elc' or `.el'; don't accept just FILE unless
673 it ends in one of those suffixes or includes a directory name. 696it ends in one of those suffixes or includes a directory name.
697
698If this function fails to find a file, it may look for different
699representations of that file before trying another file.
700It does so by adding the non-empty suffixes in `load-file-rep-suffixes'
701to the file name. Emacs uses this feature mainly to find compressed
702versions of files when Auto Compression mode is enabled.
703
704The exact suffixes that this function tries out, in the exact order,
705are given by the value of the variable `load-file-rep-suffixes' if
706NOSUFFIX is non-nil and by the return value of the function
707`get-load-suffixes' if MUST-SUFFIX is non-nil. If both NOSUFFIX and
708MUST-SUFFIX are nil, this function first tries out the latter suffixes
709and then the former.
674 710
675Loading a file records its definitions, and its `provide' and 711Loading a file records its definitions, and its `provide' and
676`require' calls, in an element of `load-history' whose 712`require' calls, in an element of `load-history' whose
677car is the file name loaded. See `load-history'. 713car is the file name loaded. See `load-history'.
678 714
679Return t if file exists. */) 715Return t if the file exists and loads successfully. */)
680 (file, noerror, nomessage, nosuffix, must_suffix) 716 (file, noerror, nomessage, nosuffix, must_suffix)
681 Lisp_Object file, noerror, nomessage, nosuffix, must_suffix; 717 Lisp_Object file, noerror, nomessage, nosuffix, must_suffix;
682{ 718{
@@ -751,9 +787,9 @@ Return t if file exists. */)
751 787
752 fd = openp (Vload_path, file, 788 fd = openp (Vload_path, file,
753 (!NILP (nosuffix) ? Qnil 789 (!NILP (nosuffix) ? Qnil
754 : !NILP (must_suffix) ? Vload_suffixes 790 : !NILP (must_suffix) ? Fget_load_suffixes ()
755 : Fappend (2, (tmp[0] = Vload_suffixes, 791 : Fappend (2, (tmp[0] = Fget_load_suffixes (),
756 tmp[1] = default_suffixes, 792 tmp[1] = Vload_file_rep_suffixes,
757 tmp))), 793 tmp))),
758 &found, Qnil); 794 &found, Qnil);
759 UNGCPRO; 795 UNGCPRO;
@@ -1111,7 +1147,7 @@ openp (path, str, suffixes, storeptr, predicate)
1111 fn = (char *) alloca (fn_size = 100 + want_size); 1147 fn = (char *) alloca (fn_size = 100 + want_size);
1112 1148
1113 /* Loop over suffixes. */ 1149 /* Loop over suffixes. */
1114 for (tail = NILP (suffixes) ? default_suffixes : suffixes; 1150 for (tail = NILP (suffixes) ? Fcons (build_string (""), Qnil) : suffixes;
1115 CONSP (tail); tail = XCDR (tail)) 1151 CONSP (tail); tail = XCDR (tail))
1116 { 1152 {
1117 int lsuffix = SBYTES (XCAR (tail)); 1153 int lsuffix = SBYTES (XCAR (tail));
@@ -3842,6 +3878,7 @@ syms_of_lread ()
3842 defsubr (&Sintern); 3878 defsubr (&Sintern);
3843 defsubr (&Sintern_soft); 3879 defsubr (&Sintern_soft);
3844 defsubr (&Sunintern); 3880 defsubr (&Sunintern);
3881 defsubr (&Sget_load_suffixes);
3845 defsubr (&Sload); 3882 defsubr (&Sload);
3846 defsubr (&Seval_buffer); 3883 defsubr (&Seval_buffer);
3847 defsubr (&Seval_region); 3884 defsubr (&Seval_region);
@@ -3903,13 +3940,27 @@ Initialized based on EMACSLOADPATH environment variable, if any,
3903otherwise to default specified by file `epaths.h' when Emacs was built. */); 3940otherwise to default specified by file `epaths.h' when Emacs was built. */);
3904 3941
3905 DEFVAR_LISP ("load-suffixes", &Vload_suffixes, 3942 DEFVAR_LISP ("load-suffixes", &Vload_suffixes,
3906 doc: /* *List of suffixes to try for files to load. 3943 doc: /* List of suffixes for (compiled or source) Emacs Lisp files.
3907This list should not include the empty string. */); 3944This list should not include the empty string.
3945`load' and related functions try to append these suffixes, in order,
3946to the specified file name if a Lisp suffix is allowed or required. */);
3908 Vload_suffixes = Fcons (build_string (".elc"), 3947 Vload_suffixes = Fcons (build_string (".elc"),
3909 Fcons (build_string (".el"), Qnil)); 3948 Fcons (build_string (".el"), Qnil));
3949 DEFVAR_LISP ("load-file-rep-suffixes", &Vload_file_rep_suffixes,
3950 doc: /* List of suffixes that indicate representations of \
3951the same file.
3952This list should normally start with the empty string.
3953
3954Enabling Auto Compression mode appends the suffixes in
3955`jka-compr-load-suffixes' to this list and disabling Auto Compression
3956mode removes them again. `load' and related functions use this list to
3957determine whether they should look for compressed versions of a file
3958and, if so, which suffixes they should try to append to the file name
3959in order to do so. However, if you want to customize which suffixes
3960the loading functions recognize as compression suffixes, you should
3961customize `jka-compr-load-suffixes' rather than the present variable. */);
3910 /* We don't use empty_string because it's not initialized yet. */ 3962 /* We don't use empty_string because it's not initialized yet. */
3911 default_suffixes = Fcons (build_string (""), Qnil); 3963 Vload_file_rep_suffixes = Fcons (build_string (""), Qnil);
3912 staticpro (&default_suffixes);
3913 3964
3914 DEFVAR_BOOL ("load-in-progress", &load_in_progress, 3965 DEFVAR_BOOL ("load-in-progress", &load_in_progress,
3915 doc: /* Non-nil iff inside of `load'. */); 3966 doc: /* Non-nil iff inside of `load'. */);
diff --git a/src/process.c b/src/process.c
index c58beaea45a..99f27733918 100644
--- a/src/process.c
+++ b/src/process.c
@@ -1582,7 +1582,7 @@ usage: (start-process NAME BUFFER PROGRAM &rest PROGRAM-ARGS) */)
1582#endif 1582#endif
1583 1583
1584 /* Make the process marker point into the process buffer (if any). */ 1584 /* Make the process marker point into the process buffer (if any). */
1585 if (!NILP (buffer)) 1585 if (BUFFERP (buffer))
1586 set_marker_both (XPROCESS (proc)->mark, buffer, 1586 set_marker_both (XPROCESS (proc)->mark, buffer,
1587 BUF_ZV (XBUFFER (buffer)), 1587 BUF_ZV (XBUFFER (buffer)),
1588 BUF_ZV_BYTE (XBUFFER (buffer))); 1588 BUF_ZV_BYTE (XBUFFER (buffer)));
@@ -3360,6 +3360,12 @@ usage: (make-network-process &rest ARGS) */)
3360 if (is_server && socktype == SOCK_STREAM) 3360 if (is_server && socktype == SOCK_STREAM)
3361 p->status = Qlisten; 3361 p->status = Qlisten;
3362 3362
3363 /* Make the process marker point into the process buffer (if any). */
3364 if (BUFFERP (buffer))
3365 set_marker_both (p->mark, buffer,
3366 BUF_ZV (XBUFFER (buffer)),
3367 BUF_ZV_BYTE (XBUFFER (buffer)));
3368
3363#ifdef NON_BLOCKING_CONNECT 3369#ifdef NON_BLOCKING_CONNECT
3364 if (is_non_blocking_client) 3370 if (is_non_blocking_client)
3365 { 3371 {
diff --git a/src/w32.c b/src/w32.c
index 799a3f6ad9b..71799befdbb 100644
--- a/src/w32.c
+++ b/src/w32.c
@@ -3888,7 +3888,7 @@ check_windows_init_file ()
3888 objs[1] = decode_env_path (0, (getenv ("EMACSLOADPATH"))); 3888 objs[1] = decode_env_path (0, (getenv ("EMACSLOADPATH")));
3889 full_load_path = Fappend (2, objs); 3889 full_load_path = Fappend (2, objs);
3890 init_file = build_string ("term/w32-win"); 3890 init_file = build_string ("term/w32-win");
3891 fd = openp (full_load_path, init_file, Vload_suffixes, NULL, Qnil); 3891 fd = openp (full_load_path, init_file, Fget_load_suffixes (), NULL, Qnil);
3892 if (fd < 0) 3892 if (fd < 0)
3893 { 3893 {
3894 Lisp_Object load_path_print = Fprin1_to_string (full_load_path, Qnil); 3894 Lisp_Object load_path_print = Fprin1_to_string (full_load_path, Qnil);
diff --git a/src/xfns.c b/src/xfns.c
index b9b1a8fe3fc..3616b4a7100 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -588,11 +588,9 @@ x_real_positions (f, xptr, yptr)
588 int had_errors = 0; 588 int had_errors = 0;
589 Window win = f->output_data.x->parent_desc; 589 Window win = f->output_data.x->parent_desc;
590 590
591 int count;
592
593 BLOCK_INPUT; 591 BLOCK_INPUT;
594 592
595 count = x_catch_errors (FRAME_X_DISPLAY (f)); 593 x_catch_errors (FRAME_X_DISPLAY (f));
596 594
597 if (win == FRAME_X_DISPLAY_INFO (f)->root_window) 595 if (win == FRAME_X_DISPLAY_INFO (f)->root_window)
598 win = FRAME_OUTER_WINDOW (f); 596 win = FRAME_OUTER_WINDOW (f);
@@ -679,7 +677,7 @@ x_real_positions (f, xptr, yptr)
679 had_errors = x_had_errors_p (FRAME_X_DISPLAY (f)); 677 had_errors = x_had_errors_p (FRAME_X_DISPLAY (f));
680 } 678 }
681 679
682 x_uncatch_errors (FRAME_X_DISPLAY (f), count); 680 x_uncatch_errors ();
683 681
684 UNBLOCK_INPUT; 682 UNBLOCK_INPUT;
685 683
@@ -957,7 +955,6 @@ x_set_mouse_color (f, arg, oldval)
957 Display *dpy = FRAME_X_DISPLAY (f); 955 Display *dpy = FRAME_X_DISPLAY (f);
958 Cursor cursor, nontext_cursor, mode_cursor, hand_cursor; 956 Cursor cursor, nontext_cursor, mode_cursor, hand_cursor;
959 Cursor hourglass_cursor, horizontal_drag_cursor; 957 Cursor hourglass_cursor, horizontal_drag_cursor;
960 int count;
961 unsigned long pixel = x_decode_color (f, arg, BLACK_PIX_DEFAULT (f)); 958 unsigned long pixel = x_decode_color (f, arg, BLACK_PIX_DEFAULT (f));
962 unsigned long mask_color = x->background_pixel; 959 unsigned long mask_color = x->background_pixel;
963 960
@@ -974,7 +971,7 @@ x_set_mouse_color (f, arg, oldval)
974 BLOCK_INPUT; 971 BLOCK_INPUT;
975 972
976 /* It's not okay to crash if the user selects a screwy cursor. */ 973 /* It's not okay to crash if the user selects a screwy cursor. */
977 count = x_catch_errors (dpy); 974 x_catch_errors (dpy);
978 975
979 if (!NILP (Vx_pointer_shape)) 976 if (!NILP (Vx_pointer_shape))
980 { 977 {
@@ -1035,7 +1032,7 @@ x_set_mouse_color (f, arg, oldval)
1035 1032
1036 /* Check and report errors with the above calls. */ 1033 /* Check and report errors with the above calls. */
1037 x_check_errors (dpy, "can't set cursor shape: %s"); 1034 x_check_errors (dpy, "can't set cursor shape: %s");
1038 x_uncatch_errors (dpy, count); 1035 x_uncatch_errors ();
1039 1036
1040 { 1037 {
1041 XColor fore_color, back_color; 1038 XColor fore_color, back_color;
@@ -3458,13 +3455,12 @@ FRAME nil means use the selected frame. */)
3458{ 3455{
3459 struct frame *f = check_x_frame (frame); 3456 struct frame *f = check_x_frame (frame);
3460 Display *dpy = FRAME_X_DISPLAY (f); 3457 Display *dpy = FRAME_X_DISPLAY (f);
3461 int count;
3462 3458
3463 BLOCK_INPUT; 3459 BLOCK_INPUT;
3464 count = x_catch_errors (dpy); 3460 x_catch_errors (dpy);
3465 XSetInputFocus (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), 3461 XSetInputFocus (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
3466 RevertToParent, CurrentTime); 3462 RevertToParent, CurrentTime);
3467 x_uncatch_errors (dpy, count); 3463 x_uncatch_errors ();
3468 UNBLOCK_INPUT; 3464 UNBLOCK_INPUT;
3469 3465
3470 return Qnil; 3466 return Qnil;
diff --git a/src/xselect.c b/src/xselect.c
index 71232ee87ba..8c82a4b85d3 100644
--- a/src/xselect.c
+++ b/src/xselect.c
@@ -402,7 +402,6 @@ x_own_selection (selection_name, selection_value)
402 Time time = last_event_timestamp; 402 Time time = last_event_timestamp;
403 Atom selection_atom; 403 Atom selection_atom;
404 struct x_display_info *dpyinfo; 404 struct x_display_info *dpyinfo;
405 int count;
406 405
407 if (! FRAME_X_P (sf)) 406 if (! FRAME_X_P (sf))
408 return; 407 return;
@@ -415,10 +414,10 @@ x_own_selection (selection_name, selection_value)
415 selection_atom = symbol_to_x_atom (dpyinfo, display, selection_name); 414 selection_atom = symbol_to_x_atom (dpyinfo, display, selection_name);
416 415
417 BLOCK_INPUT; 416 BLOCK_INPUT;
418 count = x_catch_errors (display); 417 x_catch_errors (display);
419 XSetSelectionOwner (display, selection_atom, selecting_window, time); 418 XSetSelectionOwner (display, selection_atom, selecting_window, time);
420 x_check_errors (display, "Can't set selection: %s"); 419 x_check_errors (display, "Can't set selection: %s");
421 x_uncatch_errors (display, count); 420 x_uncatch_errors ();
422 UNBLOCK_INPUT; 421 UNBLOCK_INPUT;
423 422
424 /* Now update the local cache */ 423 /* Now update the local cache */
@@ -579,7 +578,6 @@ x_decline_selection_request (event)
579 struct input_event *event; 578 struct input_event *event;
580{ 579{
581 XSelectionEvent reply; 580 XSelectionEvent reply;
582 int count;
583 581
584 reply.type = SelectionNotify; 582 reply.type = SelectionNotify;
585 reply.display = SELECTION_EVENT_DISPLAY (event); 583 reply.display = SELECTION_EVENT_DISPLAY (event);
@@ -592,10 +590,10 @@ x_decline_selection_request (event)
592 /* The reason for the error may be that the receiver has 590 /* The reason for the error may be that the receiver has
593 died in the meantime. Handle that case. */ 591 died in the meantime. Handle that case. */
594 BLOCK_INPUT; 592 BLOCK_INPUT;
595 count = x_catch_errors (reply.display); 593 x_catch_errors (reply.display);
596 XSendEvent (reply.display, reply.requestor, False, 0L, (XEvent *) &reply); 594 XSendEvent (reply.display, reply.requestor, False, 0L, (XEvent *) &reply);
597 XFlush (reply.display); 595 XFlush (reply.display);
598 x_uncatch_errors (reply.display, count); 596 x_uncatch_errors ();
599 UNBLOCK_INPUT; 597 UNBLOCK_INPUT;
600} 598}
601 599
@@ -698,7 +696,7 @@ x_reply_selection_request (event, format, data, size, type)
698 int format_bytes = format/8; 696 int format_bytes = format/8;
699 int max_bytes = SELECTION_QUANTUM (display); 697 int max_bytes = SELECTION_QUANTUM (display);
700 struct x_display_info *dpyinfo = x_display_info_for_display (display); 698 struct x_display_info *dpyinfo = x_display_info_for_display (display);
701 int count; 699 int count = SPECPDL_INDEX ();
702 700
703 if (max_bytes > MAX_SELECTION_QUANTUM) 701 if (max_bytes > MAX_SELECTION_QUANTUM)
704 max_bytes = MAX_SELECTION_QUANTUM; 702 max_bytes = MAX_SELECTION_QUANTUM;
@@ -715,7 +713,7 @@ x_reply_selection_request (event, format, data, size, type)
715 713
716 /* #### XChangeProperty can generate BadAlloc, and we must handle it! */ 714 /* #### XChangeProperty can generate BadAlloc, and we must handle it! */
717 BLOCK_INPUT; 715 BLOCK_INPUT;
718 count = x_catch_errors (display); 716 x_catch_errors (display);
719 717
720#ifdef TRACE_SELECTION 718#ifdef TRACE_SELECTION
721 { 719 {
@@ -868,7 +866,9 @@ x_reply_selection_request (event, format, data, size, type)
868 UNBLOCK to enter the event loop and get possible errors delivered, 866 UNBLOCK to enter the event loop and get possible errors delivered,
869 and then BLOCK again because x_uncatch_errors requires it. */ 867 and then BLOCK again because x_uncatch_errors requires it. */
870 BLOCK_INPUT; 868 BLOCK_INPUT;
871 x_uncatch_errors (display, count); 869
870 unbind_to (count, Qnil);
871 x_uncatch_errors ();
872 UNBLOCK_INPUT; 872 UNBLOCK_INPUT;
873} 873}
874 874
@@ -1409,7 +1409,7 @@ x_get_foreign_selection (selection_symbol, target_type, time_stamp)
1409 1409
1410 BLOCK_INPUT; 1410 BLOCK_INPUT;
1411 1411
1412 count = x_catch_errors (display); 1412 x_catch_errors (display);
1413 1413
1414 TRACE2 ("Get selection %s, type %s", 1414 TRACE2 ("Get selection %s, type %s",
1415 XGetAtomName (display, type_atom), 1415 XGetAtomName (display, type_atom),
@@ -1426,6 +1426,8 @@ x_get_foreign_selection (selection_symbol, target_type, time_stamp)
1426 1426
1427 frame = some_frame_on_display (dpyinfo); 1427 frame = some_frame_on_display (dpyinfo);
1428 1428
1429 count = SPECPDL_INDEX ();
1430
1429 /* If the display no longer has frames, we can't expect 1431 /* If the display no longer has frames, we can't expect
1430 to get many more selection requests from it, so don't 1432 to get many more selection requests from it, so don't
1431 bother trying to queue them. */ 1433 bother trying to queue them. */
@@ -1447,8 +1449,9 @@ x_get_foreign_selection (selection_symbol, target_type, time_stamp)
1447 TRACE1 (" Got event = %d", !NILP (XCAR (reading_selection_reply))); 1449 TRACE1 (" Got event = %d", !NILP (XCAR (reading_selection_reply)));
1448 1450
1449 BLOCK_INPUT; 1451 BLOCK_INPUT;
1452 unbind_to (count, Qnil);
1450 x_check_errors (display, "Cannot get selection: %s"); 1453 x_check_errors (display, "Cannot get selection: %s");
1451 x_uncatch_errors (display, count); 1454 x_uncatch_errors ();
1452 UNBLOCK_INPUT; 1455 UNBLOCK_INPUT;
1453 1456
1454 if (NILP (XCAR (reading_selection_reply))) 1457 if (NILP (XCAR (reading_selection_reply)))
@@ -2682,7 +2685,6 @@ If the value is 0 or the atom is not known, return the empty string. */)
2682 struct frame *f = check_x_frame (frame); 2685 struct frame *f = check_x_frame (frame);
2683 char *name = 0; 2686 char *name = 0;
2684 Lisp_Object ret = Qnil; 2687 Lisp_Object ret = Qnil;
2685 int count;
2686 Display *dpy = FRAME_X_DISPLAY (f); 2688 Display *dpy = FRAME_X_DISPLAY (f);
2687 Atom atom; 2689 Atom atom;
2688 2690
@@ -2696,14 +2698,14 @@ If the value is 0 or the atom is not known, return the empty string. */)
2696 error ("Wrong type, value must be number or cons"); 2698 error ("Wrong type, value must be number or cons");
2697 2699
2698 BLOCK_INPUT; 2700 BLOCK_INPUT;
2699 count = x_catch_errors (dpy); 2701 x_catch_errors (dpy);
2700 2702
2701 name = atom ? XGetAtomName (dpy, atom) : ""; 2703 name = atom ? XGetAtomName (dpy, atom) : "";
2702 2704
2703 if (! x_had_errors_p (dpy)) 2705 if (! x_had_errors_p (dpy))
2704 ret = make_string (name, strlen (name)); 2706 ret = make_string (name, strlen (name));
2705 2707
2706 x_uncatch_errors (dpy, count); 2708 x_uncatch_errors ();
2707 2709
2708 if (atom && name) XFree (name); 2710 if (atom && name) XFree (name);
2709 if (NILP (ret)) ret = make_string ("", 0); 2711 if (NILP (ret)) ret = make_string ("", 0);
@@ -2803,7 +2805,6 @@ are ignored. */)
2803 Lisp_Object cons; 2805 Lisp_Object cons;
2804 int size; 2806 int size;
2805 struct frame *f = check_x_frame (from); 2807 struct frame *f = check_x_frame (from);
2806 int count;
2807 int to_root; 2808 int to_root;
2808 2809
2809 CHECK_STRING (message_type); 2810 CHECK_STRING (message_type);
@@ -2873,14 +2874,14 @@ are ignored. */)
2873 the destination window. But if we are sending to the root window, 2874 the destination window. But if we are sending to the root window,
2874 there is no such client. Then we set the event mask to 0xffff. The 2875 there is no such client. Then we set the event mask to 0xffff. The
2875 event then goes to clients selecting for events on the root window. */ 2876 event then goes to clients selecting for events on the root window. */
2876 count = x_catch_errors (dpyinfo->display); 2877 x_catch_errors (dpyinfo->display);
2877 { 2878 {
2878 int propagate = to_root ? False : True; 2879 int propagate = to_root ? False : True;
2879 unsigned mask = to_root ? 0xffff : 0; 2880 unsigned mask = to_root ? 0xffff : 0;
2880 XSendEvent (dpyinfo->display, wdest, propagate, mask, &event); 2881 XSendEvent (dpyinfo->display, wdest, propagate, mask, &event);
2881 XFlush (dpyinfo->display); 2882 XFlush (dpyinfo->display);
2882 } 2883 }
2883 x_uncatch_errors (dpyinfo->display, count); 2884 x_uncatch_errors ();
2884 UNBLOCK_INPUT; 2885 UNBLOCK_INPUT;
2885 2886
2886 return Qnil; 2887 return Qnil;
diff --git a/src/xterm.c b/src/xterm.c
index 1b1dbdda552..0d19cf029b5 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -327,8 +327,8 @@ static void x_update_window_end P_ ((struct window *, int, int));
327void x_delete_display P_ ((struct x_display_info *)); 327void x_delete_display P_ ((struct x_display_info *));
328 328
329static int x_io_error_quitter P_ ((Display *)); 329static int x_io_error_quitter P_ ((Display *));
330int x_catch_errors P_ ((Display *)); 330void x_catch_errors P_ ((Display *));
331void x_uncatch_errors P_ ((Display *, int)); 331void x_uncatch_errors P_ ((void));
332void x_lower_frame P_ ((struct frame *)); 332void x_lower_frame P_ ((struct frame *));
333void x_scroll_bar_clear P_ ((struct frame *)); 333void x_scroll_bar_clear P_ ((struct frame *));
334int x_had_errors_p P_ ((Display *)); 334int x_had_errors_p P_ ((Display *));
@@ -3726,7 +3726,6 @@ XTmouse_position (fp, insist, bar_window, part, x, y, time)
3726 Window win, child; 3726 Window win, child;
3727 int win_x, win_y; 3727 int win_x, win_y;
3728 int parent_x = 0, parent_y = 0; 3728 int parent_x = 0, parent_y = 0;
3729 int count;
3730 3729
3731 win = root; 3730 win = root;
3732 3731
@@ -3734,7 +3733,7 @@ XTmouse_position (fp, insist, bar_window, part, x, y, time)
3734 structure is changing at the same time this function 3733 structure is changing at the same time this function
3735 is running. So at least we must not crash from them. */ 3734 is running. So at least we must not crash from them. */
3736 3735
3737 count = x_catch_errors (FRAME_X_DISPLAY (*fp)); 3736 x_catch_errors (FRAME_X_DISPLAY (*fp));
3738 3737
3739 if (FRAME_X_DISPLAY_INFO (*fp)->grabbed && last_mouse_frame 3738 if (FRAME_X_DISPLAY_INFO (*fp)->grabbed && last_mouse_frame
3740 && FRAME_LIVE_P (last_mouse_frame)) 3739 && FRAME_LIVE_P (last_mouse_frame))
@@ -3803,7 +3802,7 @@ XTmouse_position (fp, insist, bar_window, part, x, y, time)
3803 if (x_had_errors_p (FRAME_X_DISPLAY (*fp))) 3802 if (x_had_errors_p (FRAME_X_DISPLAY (*fp)))
3804 f1 = 0; 3803 f1 = 0;
3805 3804
3806 x_uncatch_errors (FRAME_X_DISPLAY (*fp), count); 3805 x_uncatch_errors ();
3807 3806
3808 /* If not, is it one of our scroll bars? */ 3807 /* If not, is it one of our scroll bars? */
3809 if (! f1) 3808 if (! f1)
@@ -5726,7 +5725,7 @@ handle_one_xevent (dpyinfo, eventp, finish, hold_quit)
5726 Display *d = event.xclient.display; 5725 Display *d = event.xclient.display;
5727 /* Catch and ignore errors, in case window has been 5726 /* Catch and ignore errors, in case window has been
5728 iconified by a window manager such as GWM. */ 5727 iconified by a window manager such as GWM. */
5729 int count = x_catch_errors (d); 5728 x_catch_errors (d);
5730 XSetInputFocus (d, event.xclient.window, 5729 XSetInputFocus (d, event.xclient.window,
5731 /* The ICCCM says this is 5730 /* The ICCCM says this is
5732 the only valid choice. */ 5731 the only valid choice. */
@@ -5735,7 +5734,7 @@ handle_one_xevent (dpyinfo, eventp, finish, hold_quit)
5735 /* This is needed to detect the error 5734 /* This is needed to detect the error
5736 if there is an error. */ 5735 if there is an error. */
5737 XSync (d, False); 5736 XSync (d, False);
5738 x_uncatch_errors (d, count); 5737 x_uncatch_errors ();
5739 } 5738 }
5740 /* Not certain about handling scroll bars here */ 5739 /* Not certain about handling scroll bars here */
5741#endif /* 0 */ 5740#endif /* 0 */
@@ -7483,7 +7482,11 @@ x_text_icon (f, icon_name)
7483#define X_ERROR_MESSAGE_SIZE 200 7482#define X_ERROR_MESSAGE_SIZE 200
7484 7483
7485/* If non-nil, this should be a string. 7484/* If non-nil, this should be a string.
7486 It means catch X errors and store the error message in this string. */ 7485 It means catch X errors and store the error message in this string.
7486
7487 The reason we use a stack is that x_catch_error/x_uncatch_error can
7488 be called from a signal handler.
7489*/
7487 7490
7488struct x_error_message_stack { 7491struct x_error_message_stack {
7489 char string[X_ERROR_MESSAGE_SIZE]; 7492 char string[X_ERROR_MESSAGE_SIZE];
@@ -7520,20 +7523,12 @@ x_error_catcher (display, error)
7520 Calling x_uncatch_errors resumes the normal error handling. */ 7523 Calling x_uncatch_errors resumes the normal error handling. */
7521 7524
7522void x_check_errors (); 7525void x_check_errors ();
7523static Lisp_Object x_catch_errors_unwind ();
7524 7526
7525int 7527void
7526x_catch_errors (dpy) 7528x_catch_errors (dpy)
7527 Display *dpy; 7529 Display *dpy;
7528{ 7530{
7529 int count = SPECPDL_INDEX ();
7530 struct x_error_message_stack *data = xmalloc (sizeof (*data)); 7531 struct x_error_message_stack *data = xmalloc (sizeof (*data));
7531 Lisp_Object dummy;
7532#ifdef ENABLE_CHECKING
7533 dummy = make_number ((EMACS_INT)dpy + (EMACS_INT)x_error_message);
7534#else
7535 dummy = Qnil;
7536#endif
7537 7532
7538 /* Make sure any errors from previous requests have been dealt with. */ 7533 /* Make sure any errors from previous requests have been dealt with. */
7539 XSync (dpy, False); 7534 XSync (dpy, False);
@@ -7542,43 +7537,28 @@ x_catch_errors (dpy)
7542 data->string[0] = 0; 7537 data->string[0] = 0;
7543 data->prev = x_error_message; 7538 data->prev = x_error_message;
7544 x_error_message = data; 7539 x_error_message = data;
7545
7546 record_unwind_protect (x_catch_errors_unwind, dummy);
7547
7548 return count;
7549} 7540}
7550 7541
7551/* Unbind the binding that we made to check for X errors. */ 7542/* Undo the last x_catch_errors call.
7543 DPY should be the display that was passed to x_catch_errors. */
7552 7544
7553static Lisp_Object 7545void
7554x_catch_errors_unwind (dummy) 7546x_uncatch_errors ()
7555 Lisp_Object dummy;
7556{ 7547{
7557 Display *dpy;
7558 struct x_error_message_stack *tmp; 7548 struct x_error_message_stack *tmp;
7559 7549
7560 if (!x_error_message)
7561 abort ();
7562
7563 dpy = x_error_message->dpy;
7564
7565 /* The display may have been closed before this function is called. 7550 /* The display may have been closed before this function is called.
7566 Check if it is still open before calling XSync. */ 7551 Check if it is still open before calling XSync. */
7567 if (x_display_info_for_display (dpy) != 0) 7552 if (x_display_info_for_display (x_error_message->dpy) != 0)
7568 { 7553 {
7569 BLOCK_INPUT; 7554 BLOCK_INPUT;
7570 XSync (dpy, False); 7555 XSync (x_error_message->dpy, False);
7571 UNBLOCK_INPUT; 7556 UNBLOCK_INPUT;
7572 } 7557 }
7573 7558
7574 tmp = x_error_message; 7559 tmp = x_error_message;
7575 x_error_message = x_error_message->prev; 7560 x_error_message = x_error_message->prev;
7576 free (tmp); 7561 xfree (tmp);
7577
7578 eassert (EQ (dummy,
7579 make_number ((EMACS_INT)dpy + (EMACS_INT)x_error_message)));
7580
7581 return Qnil;
7582} 7562}
7583 7563
7584/* If any X protocol errors have arrived since the last call to 7564/* If any X protocol errors have arrived since the last call to
@@ -7594,7 +7574,12 @@ x_check_errors (dpy, format)
7594 XSync (dpy, False); 7574 XSync (dpy, False);
7595 7575
7596 if (x_error_message->string[0]) 7576 if (x_error_message->string[0])
7597 error (format, x_error_message->string); 7577 {
7578 char string[X_ERROR_MESSAGE_SIZE];
7579 bcopy (x_error_message->string, string, X_ERROR_MESSAGE_SIZE);
7580 x_uncatch_errors ();
7581 error (format, string);
7582 }
7598} 7583}
7599 7584
7600/* Nonzero if we had any X protocol errors 7585/* Nonzero if we had any X protocol errors
@@ -7619,19 +7604,6 @@ x_clear_errors (dpy)
7619 x_error_message->string[0] = 0; 7604 x_error_message->string[0] = 0;
7620} 7605}
7621 7606
7622/* Stop catching X protocol errors and let them make Emacs die.
7623 DPY should be the display that was passed to x_catch_errors.
7624 COUNT should be the value that was returned by
7625 the corresponding call to x_catch_errors. */
7626
7627void
7628x_uncatch_errors (dpy, count)
7629 Display *dpy;
7630 int count;
7631{
7632 unbind_to (count, Qnil);
7633}
7634
7635#if 0 7607#if 0
7636static unsigned int x_wire_count; 7608static unsigned int x_wire_count;
7637x_trace_wire () 7609x_trace_wire ()
@@ -7688,7 +7660,6 @@ x_connection_closed (dpy, error_message)
7688{ 7660{
7689 struct x_display_info *dpyinfo = x_display_info_for_display (dpy); 7661 struct x_display_info *dpyinfo = x_display_info_for_display (dpy);
7690 Lisp_Object frame, tail; 7662 Lisp_Object frame, tail;
7691 int count;
7692 int index = SPECPDL_INDEX (); 7663 int index = SPECPDL_INDEX ();
7693 7664
7694 error_msg = (char *) alloca (strlen (error_message) + 1); 7665 error_msg = (char *) alloca (strlen (error_message) + 1);
@@ -7699,7 +7670,7 @@ x_connection_closed (dpy, error_message)
7699 below. Otherwise, we might end up with printing ``can't find per 7670 below. Otherwise, we might end up with printing ``can't find per
7700 display information'' in the recursive call instead of printing 7671 display information'' in the recursive call instead of printing
7701 the original message here. */ 7672 the original message here. */
7702 count = x_catch_errors (dpy); 7673 x_catch_errors (dpy);
7703 7674
7704 /* Inhibit redisplay while frames are being deleted. */ 7675 /* Inhibit redisplay while frames are being deleted. */
7705 specbind (Qinhibit_redisplay, Qt); 7676 specbind (Qinhibit_redisplay, Qt);
@@ -7785,7 +7756,7 @@ x_connection_closed (dpy, error_message)
7785 x_delete_display (dpyinfo); 7756 x_delete_display (dpyinfo);
7786 } 7757 }
7787 7758
7788 x_uncatch_errors (dpy, count); 7759 x_uncatch_errors ();
7789 7760
7790 if (terminal_list == 0) 7761 if (terminal_list == 0)
7791 { 7762 {
@@ -9393,7 +9364,6 @@ x_list_fonts (f, pattern, size, maxnames)
9393 = f ? FRAME_X_DISPLAY_INFO (f) : x_display_list; 9364 = f ? FRAME_X_DISPLAY_INFO (f) : x_display_list;
9394 Display *dpy = dpyinfo->display; 9365 Display *dpy = dpyinfo->display;
9395 int try_XLoadQueryFont = 0; 9366 int try_XLoadQueryFont = 0;
9396 int count;
9397 int allow_auto_scaled_font = 0; 9367 int allow_auto_scaled_font = 0;
9398 9368
9399 if (size < 0) 9369 if (size < 0)
@@ -9433,7 +9403,7 @@ x_list_fonts (f, pattern, size, maxnames)
9433 /* At first, put PATTERN in the cache. */ 9403 /* At first, put PATTERN in the cache. */
9434 9404
9435 BLOCK_INPUT; 9405 BLOCK_INPUT;
9436 count = x_catch_errors (dpy); 9406 x_catch_errors (dpy);
9437 9407
9438 if (try_XLoadQueryFont) 9408 if (try_XLoadQueryFont)
9439 { 9409 {
@@ -9514,7 +9484,7 @@ x_list_fonts (f, pattern, size, maxnames)
9514 } 9484 }
9515 } 9485 }
9516 9486
9517 x_uncatch_errors (dpy, count); 9487 x_uncatch_errors ();
9518 UNBLOCK_INPUT; 9488 UNBLOCK_INPUT;
9519 9489
9520 if (names) 9490 if (names)
@@ -9605,7 +9575,7 @@ x_list_fonts (f, pattern, size, maxnames)
9605 XFontStruct *thisinfo; 9575 XFontStruct *thisinfo;
9606 9576
9607 BLOCK_INPUT; 9577 BLOCK_INPUT;
9608 count = x_catch_errors (dpy); 9578 x_catch_errors (dpy);
9609 thisinfo = XLoadQueryFont (dpy, 9579 thisinfo = XLoadQueryFont (dpy,
9610 SDATA (XCAR (tem))); 9580 SDATA (XCAR (tem)));
9611 if (x_had_errors_p (dpy)) 9581 if (x_had_errors_p (dpy))
@@ -9615,7 +9585,7 @@ x_list_fonts (f, pattern, size, maxnames)
9615 thisinfo = NULL; 9585 thisinfo = NULL;
9616 x_clear_errors (dpy); 9586 x_clear_errors (dpy);
9617 } 9587 }
9618 x_uncatch_errors (dpy, count); 9588 x_uncatch_errors ();
9619 UNBLOCK_INPUT; 9589 UNBLOCK_INPUT;
9620 9590
9621 if (thisinfo) 9591 if (thisinfo)
@@ -9771,7 +9741,6 @@ x_load_font (f, fontname, size)
9771{ 9741{
9772 struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); 9742 struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f);
9773 Lisp_Object font_names; 9743 Lisp_Object font_names;
9774 int count;
9775 9744
9776 /* Get a list of all the fonts that match this name. Once we 9745 /* Get a list of all the fonts that match this name. Once we
9777 have a list of matching fonts, we compare them against the fonts 9746 have a list of matching fonts, we compare them against the fonts
@@ -9810,7 +9779,7 @@ x_load_font (f, fontname, size)
9810 fontname = (char *) SDATA (XCAR (font_names)); 9779 fontname = (char *) SDATA (XCAR (font_names));
9811 9780
9812 BLOCK_INPUT; 9781 BLOCK_INPUT;
9813 count = x_catch_errors (FRAME_X_DISPLAY (f)); 9782 x_catch_errors (FRAME_X_DISPLAY (f));
9814 font = (XFontStruct *) XLoadQueryFont (FRAME_X_DISPLAY (f), fontname); 9783 font = (XFontStruct *) XLoadQueryFont (FRAME_X_DISPLAY (f), fontname);
9815 if (x_had_errors_p (FRAME_X_DISPLAY (f))) 9784 if (x_had_errors_p (FRAME_X_DISPLAY (f)))
9816 { 9785 {
@@ -9819,7 +9788,7 @@ x_load_font (f, fontname, size)
9819 font = NULL; 9788 font = NULL;
9820 x_clear_errors (FRAME_X_DISPLAY (f)); 9789 x_clear_errors (FRAME_X_DISPLAY (f));
9821 } 9790 }
9822 x_uncatch_errors (FRAME_X_DISPLAY (f), count); 9791 x_uncatch_errors ();
9823 UNBLOCK_INPUT; 9792 UNBLOCK_INPUT;
9824 if (!font) 9793 if (!font)
9825 return NULL; 9794 return NULL;
@@ -10612,7 +10581,6 @@ x_term_init (display_name, xrm_option, resource_name)
10612 Display *dpy = dpyinfo->display; 10581 Display *dpy = dpyinfo->display;
10613 XrmValue d, fr, to; 10582 XrmValue d, fr, to;
10614 Font font; 10583 Font font;
10615 int count;
10616 10584
10617 d.addr = (XPointer)&dpy; 10585 d.addr = (XPointer)&dpy;
10618 d.size = sizeof (Display *); 10586 d.size = sizeof (Display *);
@@ -10620,12 +10588,12 @@ x_term_init (display_name, xrm_option, resource_name)
10620 fr.size = sizeof (XtDefaultFont); 10588 fr.size = sizeof (XtDefaultFont);
10621 to.size = sizeof (Font *); 10589 to.size = sizeof (Font *);
10622 to.addr = (XPointer)&font; 10590 to.addr = (XPointer)&font;
10623 count = x_catch_errors (dpy); 10591 x_catch_errors (dpy);
10624 if (!XtCallConverter (dpy, XtCvtStringToFont, &d, 1, &fr, &to, NULL)) 10592 if (!XtCallConverter (dpy, XtCvtStringToFont, &d, 1, &fr, &to, NULL))
10625 abort (); 10593 abort ();
10626 if (x_had_errors_p (dpy) || !XQueryFont (dpy, font)) 10594 if (x_had_errors_p (dpy) || !XQueryFont (dpy, font))
10627 XrmPutLineResource (&xrdb, "Emacs.dialog.*.font: 9x15"); 10595 XrmPutLineResource (&xrdb, "Emacs.dialog.*.font: 9x15");
10628 x_uncatch_errors (dpy, count); 10596 x_uncatch_errors ();
10629 } 10597 }
10630#endif 10598#endif
10631#endif 10599#endif
diff --git a/src/xterm.h b/src/xterm.h
index 106317979f1..b581c0c0159 100644
--- a/src/xterm.h
+++ b/src/xterm.h
@@ -958,9 +958,9 @@ void x_delete_display P_ ((struct x_display_info *));
958void x_make_frame_visible P_ ((struct frame *)); 958void x_make_frame_visible P_ ((struct frame *));
959void x_iconify_frame P_ ((struct frame *)); 959void x_iconify_frame P_ ((struct frame *));
960void x_wm_set_size_hint P_ ((struct frame *, long, int)); 960void x_wm_set_size_hint P_ ((struct frame *, long, int));
961int x_catch_errors P_ ((Display *)); 961void x_catch_errors P_ ((Display *));
962int x_had_errors_p P_ ((Display *)); 962int x_had_errors_p P_ ((Display *));
963void x_uncatch_errors P_ ((Display *, int)); 963void x_uncatch_errors P_ ((void));
964void x_check_errors P_ ((Display *, char *)); 964void x_check_errors P_ ((Display *, char *));
965int x_text_icon P_ ((struct frame *, char *)); 965int x_text_icon P_ ((struct frame *, char *));
966int x_bitmap_icon P_ ((struct frame *, Lisp_Object)); 966int x_bitmap_icon P_ ((struct frame *, Lisp_Object));
@@ -974,10 +974,10 @@ extern void cancel_mouse_face P_ ((struct frame *));
974extern void x_scroll_bar_clear P_ ((struct frame *)); 974extern void x_scroll_bar_clear P_ ((struct frame *));
975extern int x_text_icon P_ ((struct frame *, char *)); 975extern int x_text_icon P_ ((struct frame *, char *));
976extern int x_bitmap_icon P_ ((struct frame *, Lisp_Object)); 976extern int x_bitmap_icon P_ ((struct frame *, Lisp_Object));
977extern int x_catch_errors P_ ((Display *)); 977extern void x_catch_errors P_ ((Display *));
978extern void x_check_errors P_ ((Display *, char *)); 978extern void x_check_errors P_ ((Display *, char *));
979extern int x_had_errors_p P_ ((Display *)); 979extern int x_had_errors_p P_ ((Display *));
980extern void x_uncatch_errors P_ ((Display *, int)); 980extern void x_uncatch_errors P_ ((void));
981extern void x_set_window_size P_ ((struct frame *, int, int, int)); 981extern void x_set_window_size P_ ((struct frame *, int, int, int));
982extern void x_set_mouse_position P_ ((struct frame *, int, int)); 982extern void x_set_mouse_position P_ ((struct frame *, int, int));
983extern void x_set_mouse_pixel_position P_ ((struct frame *, int, int)); 983extern void x_set_mouse_pixel_position P_ ((struct frame *, int, int));