aboutsummaryrefslogtreecommitdiffstats
path: root/src/xterm.c
diff options
context:
space:
mode:
authorJoakim Verona2012-09-10 16:03:53 +0200
committerJoakim Verona2012-09-10 16:03:53 +0200
commitb035a30e5cd2f34fedc04c253eeb5a11afed8145 (patch)
treeb9350cce389602f4967bdc1beed745929155ad5d /src/xterm.c
parent4a37733c693d59a9b83a3fb2d0c7f9461d149f60 (diff)
parenta31a4cdacb196cc96dcb9bd229edb1d635e01344 (diff)
downloademacs-b035a30e5cd2f34fedc04c253eeb5a11afed8145.tar.gz
emacs-b035a30e5cd2f34fedc04c253eeb5a11afed8145.zip
upstream
Diffstat (limited to 'src/xterm.c')
-rw-r--r--src/xterm.c50
1 files changed, 28 insertions, 22 deletions
diff --git a/src/xterm.c b/src/xterm.c
index 23cc72305ba..4ce87142c1a 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -21,7 +21,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
21/* Xt features made by Fred Pierresteguy. */ 21/* Xt features made by Fred Pierresteguy. */
22 22
23#include <config.h> 23#include <config.h>
24#include <signal.h>
25#include <stdio.h> 24#include <stdio.h>
26#include <setjmp.h> 25#include <setjmp.h>
27 26
@@ -29,9 +28,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
29 28
30#include "lisp.h" 29#include "lisp.h"
31#include "blockinput.h" 30#include "blockinput.h"
32
33/* Need syssignal.h for various externs and definitions that may be required
34 by some configurations for calls to signal later in this source file. */
35#include "syssignal.h" 31#include "syssignal.h"
36 32
37/* This may include sys/types.h, and that somehow loses 33/* This may include sys/types.h, and that somehow loses
@@ -1470,7 +1466,7 @@ x_frame_of_widget (Widget widget)
1470 && f->output_data.x->widget == widget) 1466 && f->output_data.x->widget == widget)
1471 return f; 1467 return f;
1472 1468
1473 abort (); 1469 emacs_abort ();
1474} 1470}
1475 1471
1476/* Allocate a color which is lighter or darker than *PIXEL by FACTOR 1472/* Allocate a color which is lighter or darker than *PIXEL by FACTOR
@@ -2699,7 +2695,7 @@ x_draw_underwave (struct glyph_string *s)
2699 y2 += dy; 2695 y2 += dy;
2700 2696
2701 if (INT_MAX - dx < xmax) 2697 if (INT_MAX - dx < xmax)
2702 abort (); 2698 emacs_abort ();
2703 2699
2704 while (x1 <= xmax) 2700 while (x1 <= xmax)
2705 { 2701 {
@@ -2814,7 +2810,7 @@ x_draw_glyph_string (struct glyph_string *s)
2814 break; 2810 break;
2815 2811
2816 default: 2812 default:
2817 abort (); 2813 emacs_abort ();
2818 } 2814 }
2819 2815
2820 if (!s->for_overlaps) 2816 if (!s->for_overlaps)
@@ -3014,7 +3010,7 @@ x_shift_glyphs_for_insert (struct frame *f, int x, int y, int width, int height,
3014static void 3010static void
3015x_delete_glyphs (struct frame *f, register int n) 3011x_delete_glyphs (struct frame *f, register int n)
3016{ 3012{
3017 abort (); 3013 emacs_abort ();
3018} 3014}
3019 3015
3020 3016
@@ -3287,7 +3283,7 @@ XTset_terminal_window (struct frame *f, int n)
3287static void 3283static void
3288x_ins_del_lines (struct frame *f, int vpos, int n) 3284x_ins_del_lines (struct frame *f, int vpos, int n)
3289{ 3285{
3290 abort (); 3286 emacs_abort ();
3291} 3287}
3292 3288
3293 3289
@@ -4124,7 +4120,7 @@ x_window_to_scroll_bar (Display *display, Window window_id)
4124 frame = XCAR (tail); 4120 frame = XCAR (tail);
4125 /* All elements of Vframe_list should be frames. */ 4121 /* All elements of Vframe_list should be frames. */
4126 if (! FRAMEP (frame)) 4122 if (! FRAMEP (frame))
4127 abort (); 4123 emacs_abort ();
4128 4124
4129 if (! FRAME_X_P (XFRAME (frame))) 4125 if (! FRAME_X_P (XFRAME (frame)))
4130 continue; 4126 continue;
@@ -5443,7 +5439,7 @@ XTredeem_scroll_bar (struct window *window)
5443 5439
5444 /* We can't redeem this window's scroll bar if it doesn't have one. */ 5440 /* We can't redeem this window's scroll bar if it doesn't have one. */
5445 if (NILP (window->vertical_scroll_bar)) 5441 if (NILP (window->vertical_scroll_bar))
5446 abort (); 5442 emacs_abort ();
5447 5443
5448 bar = XSCROLL_BAR (window->vertical_scroll_bar); 5444 bar = XSCROLL_BAR (window->vertical_scroll_bar);
5449 5445
@@ -5462,7 +5458,7 @@ XTredeem_scroll_bar (struct window *window)
5462 else 5458 else
5463 /* If its prev pointer is nil, it must be at the front of 5459 /* If its prev pointer is nil, it must be at the front of
5464 one or the other! */ 5460 one or the other! */
5465 abort (); 5461 emacs_abort ();
5466 } 5462 }
5467 else 5463 else
5468 XSCROLL_BAR (bar->prev)->next = bar->next; 5464 XSCROLL_BAR (bar->prev)->next = bar->next;
@@ -5560,7 +5556,7 @@ static void
5560x_scroll_bar_handle_click (struct scroll_bar *bar, XEvent *event, struct input_event *emacs_event) 5556x_scroll_bar_handle_click (struct scroll_bar *bar, XEvent *event, struct input_event *emacs_event)
5561{ 5557{
5562 if (! WINDOWP (bar->window)) 5558 if (! WINDOWP (bar->window))
5563 abort (); 5559 emacs_abort ();
5564 5560
5565 emacs_event->kind = SCROLL_BAR_CLICK_EVENT; 5561 emacs_event->kind = SCROLL_BAR_CLICK_EVENT;
5566 emacs_event->code = event->xbutton.button - Button1; 5562 emacs_event->code = event->xbutton.button - Button1;
@@ -6466,7 +6462,7 @@ handle_one_xevent (struct x_display_info *dpyinfo, XEvent *eventptr,
6466 } 6462 }
6467 else if (status_return != XLookupKeySym 6463 else if (status_return != XLookupKeySym
6468 && status_return != XLookupBoth) 6464 && status_return != XLookupBoth)
6469 abort (); 6465 emacs_abort ();
6470 } 6466 }
6471 else 6467 else
6472 nbytes = XLookupString (&event.xkey, (char *) copy_bufptr, 6468 nbytes = XLookupString (&event.xkey, (char *) copy_bufptr,
@@ -7510,7 +7506,7 @@ x_draw_window_cursor (struct window *w, struct glyph_row *glyph_row, int x, int
7510 break; 7506 break;
7511 7507
7512 default: 7508 default:
7513 abort (); 7509 emacs_abort ();
7514 } 7510 }
7515 } 7511 }
7516 7512
@@ -7780,7 +7776,9 @@ x_connection_signal (int signalnum) /* If we don't have an argument, */
7780#ifdef USG 7776#ifdef USG
7781 /* USG systems forget handlers when they are used; 7777 /* USG systems forget handlers when they are used;
7782 must reestablish each time */ 7778 must reestablish each time */
7783 signal (signalnum, x_connection_signal); 7779 struct sigaction action;
7780 emacs_sigaction_init (&action, x_connection_signal);
7781 sigaction (signalnum, &action, 0);
7784#endif /* USG */ 7782#endif /* USG */
7785} 7783}
7786 7784
@@ -7863,7 +7861,7 @@ When compiled with GTK, Emacs cannot recover from X disconnects.\n\
7863This is a GTK bug: https://bugzilla.gnome.org/show_bug.cgi?id=85715\n\ 7861This is a GTK bug: https://bugzilla.gnome.org/show_bug.cgi?id=85715\n\
7864For details, see etc/PROBLEMS.\n", 7862For details, see etc/PROBLEMS.\n",
7865 error_msg); 7863 error_msg);
7866 abort (); 7864 emacs_abort ();
7867#endif /* USE_GTK */ 7865#endif /* USE_GTK */
7868 7866
7869 /* Indicate that this display is dead. */ 7867 /* Indicate that this display is dead. */
@@ -7873,7 +7871,7 @@ For details, see etc/PROBLEMS.\n",
7873 dpyinfo->terminal->reference_count--; 7871 dpyinfo->terminal->reference_count--;
7874 if (dpyinfo->reference_count != 0) 7872 if (dpyinfo->reference_count != 0)
7875 /* We have just closed all frames on this display. */ 7873 /* We have just closed all frames on this display. */
7876 abort (); 7874 emacs_abort ();
7877 7875
7878 { 7876 {
7879 Lisp_Object tmp; 7877 Lisp_Object tmp;
@@ -7890,10 +7888,15 @@ For details, see etc/PROBLEMS.\n",
7890 } 7888 }
7891 7889
7892 /* Ordinary stack unwind doesn't deal with these. */ 7890 /* Ordinary stack unwind doesn't deal with these. */
7891 {
7892 sigset_t unblocked;
7893 sigemptyset (&unblocked);
7893#ifdef SIGIO 7894#ifdef SIGIO
7894 sigunblock (sigmask (SIGIO)); 7895 sigaddset (&unblocked, SIGIO);
7895#endif 7896#endif
7896 sigunblock (sigmask (SIGALRM)); 7897 sigaddset (&unblocked, SIGALRM);
7898 pthread_sigmask (SIG_UNBLOCK, &unblocked, 0);
7899 }
7897 TOTALLY_UNBLOCK_INPUT; 7900 TOTALLY_UNBLOCK_INPUT;
7898 7901
7899 unbind_to (idx, Qnil); 7902 unbind_to (idx, Qnil);
@@ -10454,7 +10457,7 @@ x_term_init (Lisp_Object display_name, char *xrm_option, char *resource_name)
10454 to.addr = (XPointer)&font; 10457 to.addr = (XPointer)&font;
10455 x_catch_errors (dpy); 10458 x_catch_errors (dpy);
10456 if (!XtCallConverter (dpy, XtCvtStringToFont, &d, 1, &fr, &to, NULL)) 10459 if (!XtCallConverter (dpy, XtCvtStringToFont, &d, 1, &fr, &to, NULL))
10457 abort (); 10460 emacs_abort ();
10458 if (x_had_errors_p (dpy) || !XQueryFont (dpy, font)) 10461 if (x_had_errors_p (dpy) || !XQueryFont (dpy, font))
10459 XrmPutLineResource (&xrdb, "Emacs.dialog.*.font: 9x15"); 10462 XrmPutLineResource (&xrdb, "Emacs.dialog.*.font: 9x15");
10460 x_uncatch_errors (); 10463 x_uncatch_errors ();
@@ -10777,6 +10780,8 @@ x_create_terminal (struct x_display_info *dpyinfo)
10777void 10780void
10778x_initialize (void) 10781x_initialize (void)
10779{ 10782{
10783 struct sigaction action;
10784
10780 baud_rate = 19200; 10785 baud_rate = 19200;
10781 10786
10782 x_noop_count = 0; 10787 x_noop_count = 0;
@@ -10823,7 +10828,8 @@ x_initialize (void)
10823 XSetErrorHandler (x_error_handler); 10828 XSetErrorHandler (x_error_handler);
10824 XSetIOErrorHandler (x_io_error_quitter); 10829 XSetIOErrorHandler (x_io_error_quitter);
10825 10830
10826 signal (SIGPIPE, x_connection_signal); 10831 emacs_sigaction_init (&action, x_connection_signal);
10832 sigaction (SIGPIPE, &action, 0);
10827} 10833}
10828 10834
10829 10835