diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/bytecode.c | 7 | ||||
| -rw-r--r-- | src/callint.c | 7 | ||||
| -rw-r--r-- | src/callproc.c | 3 | ||||
| -rw-r--r-- | src/editfns.c | 6 | ||||
| -rw-r--r-- | src/fileio.c | 8 | ||||
| -rw-r--r-- | src/floatfns.c | 12 | ||||
| -rw-r--r-- | src/lisp.h | 14 | ||||
| -rw-r--r-- | src/lread.c | 20 | ||||
| -rw-r--r-- | src/print.c | 12 | ||||
| -rw-r--r-- | src/process.c | 10 | ||||
| -rw-r--r-- | src/ralloc.c | 1 | ||||
| -rw-r--r-- | src/s/hpux.h | 5 | ||||
| -rw-r--r-- | src/search.c | 65 | ||||
| -rw-r--r-- | src/sysdep.c | 44 | ||||
| -rw-r--r-- | src/systty.h | 46 | ||||
| -rw-r--r-- | src/term.c | 7 | ||||
| -rw-r--r-- | src/xfns.c | 7 | ||||
| -rw-r--r-- | src/xterm.c | 34 |
18 files changed, 188 insertions, 120 deletions
diff --git a/src/bytecode.c b/src/bytecode.c index acde450299c..5ab689f1925 100644 --- a/src/bytecode.c +++ b/src/bytecode.c @@ -1,11 +1,11 @@ /* Execution of byte code produced by bytecomp.el. - Copyright (C) 1985, 1986, 1987, 1988 Free Software Foundation, Inc. + Copyright (C) 1985, 1986, 1987, 1988, 1992 Free Software Foundation, Inc. This file is part of GNU Emacs. GNU Emacs is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 1, or (at your option) +the Free Software Foundation; either version 2, or (at your option) any later version. GNU Emacs is distributed in the hope that it will be useful, @@ -1077,8 +1077,7 @@ If the third argument is incorrect, Emacs may crash.") break; case Bnumberp: - TOP = (XTYPE (TOP) == Lisp_Int || XTYPE (TOP) == Lisp_Float - ? Qt : Qnil); + TOP = (NUMBERP (TOP) ? Qt : Qnil); break; case Bintegerp: diff --git a/src/callint.c b/src/callint.c index ffee0785095..0075ef721dc 100644 --- a/src/callint.c +++ b/src/callint.c @@ -408,12 +408,7 @@ Otherwise, this is done only if an arg is read using the minibuffer.") case 'n': /* Read number from minibuffer. */ do args[i] = Fread_minibuffer (build_string (prompt), Qnil); -#ifdef LISP_FLOAT_TYPE - while (XTYPE (args[i]) != Lisp_Int - && XTYPE (args[i]) != Lisp_Float); -#else - while (XTYPE (args[i]) != Lisp_Int); -#endif + while (! NUMBERP (args[i])); visargs[i] = last_minibuf_string; break; diff --git a/src/callproc.c b/src/callproc.c index d22393a2635..68b447d401d 100644 --- a/src/callproc.c +++ b/src/callproc.c @@ -200,7 +200,7 @@ If you quit, the process is killed with SIGKILL.") env = environ; #if 0 /* Some systems don't have sigblock. */ - mask = sigblock (sigmask (SIGCHLD)); + EMACS_SIGBLOCK (sigmask (SIGCHLD), mask); #endif /* Record that we're about to create a synchronous process. */ @@ -511,6 +511,7 @@ This function consults the variable ``process-environment'' for its value.") callable from C. */ char * egetenv (var) + char *var; { char *value; int valuelen; diff --git a/src/editfns.c b/src/editfns.c index d0db0837591..0ef059aa055 100644 --- a/src/editfns.c +++ b/src/editfns.c @@ -1094,20 +1094,24 @@ Use %% to put a single % into the output.") /* Would get MPV otherwise, since Lisp_Int's `point' to low memory. */ else if (XTYPE (args[n]) == Lisp_Int && *format != 's') { +#ifdef LISP_FLOAT_TYPE /* The following loop issumes the Lisp type indicates the proper way to pass the argument. So make sure we have a flonum if the argument should be a double. */ if (*format == 'e' || *format == 'f' || *format == 'g') args[n] = Ffloat (args[n]); +#endif total += 10; } +#ifdef LISP_FLOAT_TYPE else if (XTYPE (args[n]) == Lisp_Float && *format != 's') { if (! (*format == 'e' || *format == 'f' || *format == 'g')) args[n] = Ftruncate (args[n]); total += 20; } +#endif else { /* Anything but a string, convert to a string using princ. */ @@ -1131,6 +1135,7 @@ Use %% to put a single % into the output.") /* We checked above that the corresponding format effector isn't %s, which would cause MPV. */ strings[n] = (unsigned char *) XINT (args[n]); +#ifdef LISP_FLOAT_TYPE else if (XTYPE (args[n]) == Lisp_Float) { union { double d; int half[2]; } u; @@ -1139,6 +1144,7 @@ Use %% to put a single % into the output.") strings[n++] = (unsigned char *) u.half[0]; strings[n] = (unsigned char *) u.half[1]; } +#endif else strings[n] = XSTRING (args[n])->data; } diff --git a/src/fileio.c b/src/fileio.c index ea7f8c6250f..f977ee0c623 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -1,11 +1,11 @@ /* File IO for GNU Emacs. - Copyright (C) 1985, 1986, 1987, 1988 Free Software Foundation, Inc. + Copyright (C) 1985, 1986, 1987, 1988, 1992 Free Software Foundation, Inc. This file is part of GNU Emacs. GNU Emacs is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 1, or (at your option) +the Free Software Foundation; either version 2, or (at your option) any later version. GNU Emacs is distributed in the hope that it will be useful, @@ -411,7 +411,7 @@ directory_file_name (src, dst) /* Process as Unix format: just remove any final slash. But leave "/" unchanged; do not change it to "". */ strcpy (dst, src); - if (dst[slen - 1] == '/' && slen > 1) + if (slen > 1 && dst[slen - 1] == '/') dst[slen - 1] = 0; return 1; } @@ -2478,7 +2478,7 @@ Auto-saving writes the buffer into a file\n\ so that your editing is not lost if the system crashes.\n\ This file is not the file you visited; that changes only when you save.\n\n\ Non-nil first argument means do not print any message if successful.\n\ -Non-nil second argumet means save only current buffer.") +Non-nil second argument means save only current buffer.") (nomsg) Lisp_Object nomsg; { diff --git a/src/floatfns.c b/src/floatfns.c index 12f14ffef72..ed94c9ebafe 100644 --- a/src/floatfns.c +++ b/src/floatfns.c @@ -1,11 +1,11 @@ /* Primitive operations on floating point for GNU Emacs Lisp interpreter. - Copyright (C) 1988 Free Software Foundation, Inc. + Copyright (C) 1988, 1992 Free Software Foundation, Inc. This file is part of GNU Emacs. GNU Emacs is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 1, or (at your option) +the Free Software Foundation; either version 2, or (at your option) any later version. GNU Emacs is distributed in the hope that it will be useful, @@ -42,7 +42,7 @@ extern int errno; #define sinh(x) ((exp(x)-exp(-x))*0.5) #endif /* VMS */ -static float_error (); +static SIGTYPE float_error (); /* Nonzero while executing in floating point. This tells float_error what to do. */ @@ -60,8 +60,8 @@ static Lisp_Object float_error_arg; Handle errors which may result in signals or may set errno. */ #define IN_FLOAT(D, NUM) \ -(in_float = 1, errno = 0, float_error_arg = NUM, (D), \ - (errno == ERANGE || errno == EDOM ? float_error () : 0), \ +(in_float = 1, errno = 0, float_error_arg = NUM, (D), \ + (errno == ERANGE || errno == EDOM ? float_error () : (SIGTYPE) 0), \ in_float = 0) /* Extract a Lisp number as a `double', or signal an error. */ @@ -498,7 +498,7 @@ Rounds the value toward zero.") return num; } -static +static SIGTYPE float_error (signo) int signo; { diff --git a/src/lisp.h b/src/lisp.h index 1e5d4bf9365..c7dd07058eb 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -1,11 +1,11 @@ /* Fundamental definitions for GNU Emacs Lisp interpreter. - Copyright (C) 1985, 1986, 1987 Free Software Foundation, Inc. + Copyright (C) 1985, 1986, 1987, 1992 Free Software Foundation, Inc. This file is part of GNU Emacs. GNU Emacs is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 1, or (at your option) +the Free Software Foundation; either version 2, or (at your option) any later version. GNU Emacs is distributed in the hope that it will be useful, @@ -506,15 +506,19 @@ typedef unsigned char UCHAR; /* Data type checking */ -#ifdef NULL -#undef NULL -#endif #define NILP(x) (XFASTINT (x) == XFASTINT (Qnil)) +#ifdef LISP_FLOAT_TYPE +#define NUMBERP(x) (XTYPE (x) == Lisp_Int || XTYPE (x) == Lisp_Float) +#else +#define NUMBERP(x) (XTYPE (x) == Lisp_Int) +#endif + /* #define LISTP(x) (XTYPE ((x)) == Lisp_Cons)*/ #define CONSP(x) (XTYPE ((x)) == Lisp_Cons) #define EQ(x, y) (XFASTINT (x) == XFASTINT (y)) + #define CHECK_LIST(x, i) \ { if ((XTYPE ((x)) != Lisp_Cons) && !NILP (x)) x = wrong_type_argument (Qlistp, (x)); } diff --git a/src/lread.c b/src/lread.c index 78d578758b0..c3157c8d618 100644 --- a/src/lread.c +++ b/src/lread.c @@ -1448,14 +1448,15 @@ init_lread () uses ../lisp, instead of the path of the installed elisp libraries. However, if it appears that Vload_path was changed from the default before dumping, don't override that value. */ - { - Lisp_Object normal_path; - - normal_path = decode_env_path ("", normal); + if (initialized) + { + Lisp_Object dump_path; - if ( - if (initialized - || EQ (Vload_path, initial_path)) + dump_path = decode_env_path ("", PATH_DUMPLOADSEARCH); + if (! NILP (Fequal (dump_path, Vload_path))) + Vload_path = decode_env_path ("", normal); + } + else Vload_path = decode_env_path ("", normal); #endif @@ -1487,11 +1488,6 @@ init_lread () Vvalues = Qnil; - if (initialized) - initial_path = Qnil; - else - initial_path = Vload_path; - load_in_progress = 0; } diff --git a/src/print.c b/src/print.c index b65db9aedc6..8ab40735e38 100644 --- a/src/print.c +++ b/src/print.c @@ -1,11 +1,11 @@ /* Lisp object printing and output streams. - Copyright (C) 1985, 1986, 1988 Free Software Foundation, Inc. + Copyright (C) 1985, 1986, 1988, 1992 Free Software Foundation, Inc. This file is part of GNU Emacs. GNU Emacs is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 1, or (at your option) +the Free Software Foundation; either version 2, or (at your option) any later version. GNU Emacs is distributed in the hope that it will be useful, @@ -566,12 +566,12 @@ Output stream is STREAM, or value of `standard-output' (which see).") for the convenience of the debugger. */ Lisp_Object Qexternal_debugging_output; -DEFUN ("external-debugging-output", - Fexternal_debugging_output, Sexternal_debugging_output, - 1, 1, 0, "Write CHARACTER to stderr.\n\ +DEFUN ("external-debugging-output", Fexternal_debugging_output, Sexternal_debugging_output, 1, 1, 0, + "Write CHARACTER to stderr.\n\ You can call print while debugging emacs, and pass it this function\n\ to make it write to the debugging output.\n") - (Lisp_Object character) + (character) + Lisp_Object character; { CHECK_NUMBER (character, 0); putc (XINT (character), stderr); diff --git a/src/process.c b/src/process.c index 1bdc27be91b..442cae6d159 100644 --- a/src/process.c +++ b/src/process.c @@ -403,7 +403,7 @@ status_message (status) } #ifdef HAVE_PTYS -static pty_process; +static int pty_process; /* Open an available pty, returning a file descriptor. Return -1 on failure. @@ -1803,6 +1803,7 @@ wait_reading_process_input (time_limit, microsecs, read_kbd, do_display) if (read_kbd && detect_input_pending ()) break; +#ifdef SIGIO /* If we think we have keyboard input waiting, but didn't get SIGIO go read it. This can happen with X on BSD after logging out. In that case, there really is no input and no SIGIO, @@ -1813,6 +1814,7 @@ wait_reading_process_input (time_limit, microsecs, read_kbd, do_display) */ if (read_kbd && interrupt_input && (FD_ISSET (fileno (stdin), &Available))) kill (0, SIGIO); +#endif #ifdef vipc /* Check for connection from other process */ @@ -2106,12 +2108,14 @@ send_process (proc, buf, len) while (len > 0) { int this = len; + SIGTYPE (*old_sigpipe)(); + /* Don't send more than 500 bytes at a time. */ if (this > 500) this = 500; - signal (SIGPIPE, send_process_trap); + old_sigpipe = signal (SIGPIPE, send_process_trap); rv = write (XFASTINT (XPROCESS (proc)->outfd), buf, this); - signal (SIGPIPE, SIG_DFL); + signal (SIGPIPE, old_sigpipe); if (rv < 0) { if (0 diff --git a/src/ralloc.c b/src/ralloc.c index fe22ae4ffe1..927c2dd5477 100644 --- a/src/ralloc.c +++ b/src/ralloc.c @@ -27,6 +27,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "lisp.h" /* Needed for VALBITS. */ #undef NULL #include "mem_limits.h" +#include "getpagesize.h" #define NIL ((POINTER) 0) diff --git a/src/s/hpux.h b/src/s/hpux.h index 33de0875602..e146501004c 100644 --- a/src/s/hpux.h +++ b/src/s/hpux.h @@ -228,6 +228,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ #define HAVE_GETTIMEOFDAY #define HAVE_VFORK #define HAVE_PERROR /* Delete this line for version 6. */ +#define HAVE_RENAME /* The following maps shared exec file to demand loaded exec. Don't do this as demand loaded exec is broken in hpux. */ @@ -253,8 +254,8 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ /* This is how to get the device name of the tty end of a pty. */ #define PTY_TTY_NAME_SPRINTF \ - sprintf (ptyname, "/dev/pty/tty%c%x", c, i); + sprintf (pty_name, "/dev/pty/tty%c%x", c, i); /* This is how to get the device name of the control end of a pty. */ #define PTY_NAME_SPRINTF \ - sprintf (ptyname, "/dev/ptym/pty%c%x", c, i); + sprintf (pty_name, "/dev/ptym/pty%c%x", c, i); diff --git a/src/search.c b/src/search.c index cad14a47560..46ff1ec7e77 100644 --- a/src/search.c +++ b/src/search.c @@ -23,6 +23,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "syntax.h" #include "buffer.h" #include "commands.h" + #include <sys/types.h> #include "regex.h" @@ -39,9 +40,14 @@ char search_fastmap[0400]; Lisp_Object last_regexp; -/* Every call to re_match, etc., must pass &search_regs as the regs argument - unless you can show it is unnecessary (i.e., if re_match is certainly going - to be called again before region-around-match can be called). */ +/* Every call to re_match, etc., must pass &search_regs as the regs + argument unless you can show it is unnecessary (i.e., if re_match + is certainly going to be called again before region-around-match + can be called). + + Since the registers are now dynamically allocated, we need to make + sure not to refer to the Nth register before checking that it has + been allocated. */ static struct re_registers search_regs; @@ -147,7 +153,7 @@ DEFUN ("looking-at", Flooking_at, Slooking_at, 1, 1, 0, matcher_overflow (); val = (0 <= i ? Qt : Qnil); - for (i = 0; i < RE_NREGS; i++) + for (i = 0; i < search_regs.num_regs; i++) if (search_regs.start[i] >= 0) { search_regs.start[i] += BEGV; @@ -489,7 +495,7 @@ search_buffer (string, pos, lim, n, RE, trt, inverse_trt) /* generality of an RE search is */ /* really needed. */ /* first item is "exact match" */ - && *(searchbuf.buffer) == RE_EXACTN_VALUE + && *(searchbuf.buffer) == (char) RE_EXACTN_VALUE && searchbuf.buffer[1] + 2 == searchbuf.used) /*first is ONLY item */ { RE = 0; /* can do straight (non RE) search */ @@ -542,7 +548,7 @@ search_buffer (string, pos, lim, n, RE, trt, inverse_trt) if (val >= 0) { j = BEGV; - for (i = 0; i < RE_NREGS; i++) + for (i = 0; i < search_regs.num_regs; i++) if (search_regs.start[i] >= 0) { search_regs.start[i] += j; @@ -569,7 +575,7 @@ search_buffer (string, pos, lim, n, RE, trt, inverse_trt) if (val >= 0) { j = BEGV; - for (i = 0; i < RE_NREGS; i++) + for (i = 0; i < search_regs.num_regs; i++) if (search_regs.start[i] >= 0) { search_regs.start[i] += j; @@ -996,6 +1002,10 @@ Leaves point at end of replacement text.") case_action = nochange; /* We tried an initialization */ /* but some C compilers blew it */ + + if (search_regs.num_regs <= 0) + error ("replace-match called before any match found"); + if (search_regs.start[0] < BEGV || search_regs.start[0] > search_regs.end[0] || search_regs.end[0] > ZV) @@ -1068,7 +1078,7 @@ Leaves point at end of replacement text.") Finsert_buffer_substring (Fcurrent_buffer (), make_number (search_regs.start[0]), make_number (search_regs.end[0])); - else if (c >= '1' && c <= RE_NREGS + '0') + else if (c >= '1' && c <= search_regs.num_regs + '0') { if (search_regs.start[c - '0'] >= 1) Finsert_buffer_substring (Fcurrent_buffer (), @@ -1103,9 +1113,10 @@ match_limit (num, beginningp) CHECK_NUMBER (num, 0); n = XINT (num); - if (n < 0 || n >= RE_NREGS) - args_out_of_range (num, make_number (RE_NREGS)); - if (search_regs.start[n] < 0) + if (n < 0 || n >= search_regs.num_regs) + args_out_of_range (num, make_number (search_regs.num_regs)); + if (search_regs.num_regs <= 0 + || search_regs.start[n] < 0) return Qnil; return (make_number ((beginningp) ? search_regs.start[n] : search_regs.end[n])); @@ -1141,11 +1152,14 @@ if the last match was on a buffer; integers or nil if a string was matched.\n\ Use `store-match-data' to reinstate the data in this list.") () { - Lisp_Object data[2 * RE_NREGS]; + Lisp_Object *data; int i, len; + data = (Lisp_Object *) alloca ((2 * search_regs.num_regs) + * sizeof (Lisp_Object)); + len = -1; - for (i = 0; i < RE_NREGS; i++) + for (i = 0; i < search_regs.num_regs; i++) { int start = search_regs.start[i]; if (start >= 0) @@ -1184,7 +1198,30 @@ LIST should have been created by calling `match-data' previously.") if (!CONSP (list) && !NILP (list)) list = wrong_type_argument (Qconsp, list, 0); - for (i = 0; i < RE_NREGS; i++) + /* Allocate registers if they don't already exist. */ + { + int length = Flength (list) / 2; + + if (length > search_regs.num_regs) + { + if (search_regs.start) + search_regs.start = + (regoff_t *) realloc (search_regs.start, + length * sizeof (regoff_t)); + else + search_regs.start = (regoff_t *) malloc (length * sizeof (regoff_t)); + if (search_regs.end) + search_regs.end = + (regoff_t *) realloc (search_regs.end, + length * sizeof (regoff_t)); + else + search_regs.end = (regoff_t *) malloc (length * sizeof (regoff_t)); + + search_regs.num_regs = length; + } + } + + for (i = 0; i < search_regs.num_regs; i++) { marker = Fcar (list); if (NILP (marker)) diff --git a/src/sysdep.c b/src/sysdep.c index 1483898478d..03614f98cce 100644 --- a/src/sysdep.c +++ b/src/sysdep.c @@ -110,19 +110,6 @@ extern char *sys_errlist[]; #endif /* not 4.1 */ #endif /* BSD */ -#ifdef AIX -/* Get files for keyboard remapping */ -#define HFNKEYS 2 -#include <sys/hft.h> -#include <sys/devinfo.h> -#endif - -/* Get rid of LLITOUT in 4.1, since it is said to stimulate kernel bugs. */ -#ifdef BSD4_1 -#undef LLITOUT -#define LLITOUT 0 -#endif /* 4.1 */ - #ifdef BROKEN_TIOCGWINSZ #undef TIOCGWINSZ #endif @@ -144,31 +131,6 @@ extern char *sys_errlist[]; #endif /* TIOCGWINSZ */ #endif /* USG */ -#ifdef NEED_BSDTTY -#include <sys/bsdtty.h> -#endif - -#if defined (HPUX) && defined (HAVE_PTYS) -#include <sys/ptyio.h> -#endif - -#ifdef AIX -#include <sys/pty.h> -#include <unistd.h> -#endif /* AIX */ - -#ifdef SYSV_PTYS -#include <sys/tty.h> -#include <sys/pty.h> -#endif - -/* saka@pfu.fujitsu.co.JP writes: - FASYNC defined in this file. But, FASYNC don't working. - so no problem, because unrequest_sigio only need. */ -#if defined (pfa) -#include <sys/file.h> -#endif - extern int quit_char; #include "screen.h" @@ -2348,6 +2310,8 @@ getwd (pathname) * that files be of same type (regular->regular, dir->dir, etc). */ +#ifndef HAVE_RENAME + rename (from, to) char *from; char *to; @@ -2362,9 +2326,11 @@ rename (from, to) return (-1); } +#endif + /* Set priority value to PRIO. */ -void +int setpriority (which, who, prio) int which, who, prio; { diff --git a/src/systty.h b/src/systty.h index 07f12eb33d1..4bbf021595d 100644 --- a/src/systty.h +++ b/src/systty.h @@ -33,6 +33,44 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ #endif /* not HAVE_TERMIOS */ #endif /* not HAVE_TERMIO */ +#ifdef AIX +/* Get files for keyboard remapping */ +#define HFNKEYS 2 +#include <sys/hft.h> +#include <sys/devinfo.h> +#endif + +/* Get rid of LLITOUT in 4.1, since it is said to stimulate kernel bugs. */ +#ifdef BSD4_1 +#undef LLITOUT +#define LLITOUT 0 +#endif /* 4.1 */ + +#ifdef NEED_BSDTTY +#include <sys/bsdtty.h> +#endif + +#if defined (HPUX) && defined (HAVE_PTYS) +#include <sys/ptyio.h> +#endif + +#ifdef AIX +#include <sys/pty.h> +#include <unistd.h> +#endif /* AIX */ + +#ifdef SYSV_PTYS +#include <sys/tty.h> +#include <sys/pty.h> +#endif + +/* saka@pfu.fujitsu.co.JP writes: + FASYNC defined in this file. But, FASYNC don't working. + so no problem, because unrequest_sigio only need. */ +#if defined (pfa) +#include <sys/file.h> +#endif + /* Special cases - inhibiting the use of certain features. */ @@ -184,6 +222,13 @@ struct emacs_tty { (tcsetattr ((fd), (waitp) ? TCSAFLUSH : TCSADRAIN, &(p)->main) != -1) #else +#ifdef HAVE_TERMIO + +#define EMACS_GET_TTY_1(fd, p) (ioctl ((fd), TCGETA, &(p)->main) != -1) +#define EMACS_SET_TTY_1(fd, p, waitp) \ + (ioctl ((fd), (waitp) ? TCSETAW : TCSETAF, &(p)->main) != -1) + +#else #ifdef VMS /* These definitions will really only work in sysdep.c, because of their @@ -203,6 +248,7 @@ struct emacs_tty { #endif #endif +#endif #ifdef TIOCGLTC struct ltchars ltchars; diff --git a/src/term.c b/src/term.c index c23723217e5..e9f7ddbcd18 100644 --- a/src/term.c +++ b/src/term.c @@ -1,11 +1,11 @@ /* terminal control module for terminals described by TERMCAP - Copyright (C) 1985, 1986, 1987 Free Software Foundation, Inc. + Copyright (C) 1985, 1986, 1987, 1992 Free Software Foundation, Inc. This file is part of GNU Emacs. GNU Emacs is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 1, or (at your option) +the Free Software Foundation; either version 2, or (at your option) any later version. GNU Emacs is distributed in the hope that it will be useful, @@ -465,6 +465,7 @@ change_line_highlight (new_highlight, vpos, first_unused_hpos) /* Move to absolute position, specified origin 0 */ cursor_to (row, col) + int row, col; { if (! SCREEN_IS_TERMCAP ((updating_screen ? updating_screen @@ -488,6 +489,7 @@ cursor_to (row, col) /* Similar but don't take any account of the wasted characters. */ raw_cursor_to (row, col) + int row, col; { if (! SCREEN_IS_TERMCAP ((updating_screen ? updating_screen : selected_screen))) { @@ -1393,6 +1395,7 @@ It may be necessary to do `unsetenv TERMCAP' as well.\n", /* VARARGS 1 */ fatal (str, arg1, arg2) + char *str, *arg1, *arg2; { fprintf (stderr, "emacs: "); fprintf (stderr, str, arg1, arg2); diff --git a/src/xfns.c b/src/xfns.c index 4f3a7ff9e2b..d3943a5f779 100644 --- a/src/xfns.c +++ b/src/xfns.c @@ -1,11 +1,11 @@ /* Functions for the X window system. - Copyright (C) 1989 Free Software Foundation. + Copyright (C) 1989, 1992 Free Software Foundation. This file is part of GNU Emacs. GNU Emacs is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 1, or (at your option) +the Free Software Foundation; either version 2, or (at your option) any later version. GNU Emacs is distributed in the hope that it will be useful, @@ -3950,7 +3950,8 @@ also be depressed for NEWSTRING to appear.") register Lisp_Object newstring; { char *rawstring; - register KeySym keysym, modifier_list[16]; + register KeySym keysym; + KeySym modifier_list[16]; CHECK_STRING (x_keysym, 1); CHECK_STRING (newstring, 3); diff --git a/src/xterm.c b/src/xterm.c index 05ad3bc588d..1df1c7d36ba 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -1,11 +1,11 @@ /* X Communication module for terminals which understand the X protocol. - Copyright (C) 1989 Free Software Foundation, Inc. + Copyright (C) 1989, 1992 Free Software Foundation, Inc. This file is part of GNU Emacs. GNU Emacs is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 1, or (at your option) +the Free Software Foundation; either version 2, or (at your option) any later version. GNU Emacs is distributed in the hope that it will be useful, @@ -258,8 +258,8 @@ static void dumpqueue (); #endif void dumpborder (); -static XTcursor_to (); -static XTclear_end_of_line (); +static int XTcursor_to (); +static int XTclear_end_of_line (); /* These hooks are called by update_screen at the beginning and end of a screen update. We record in `updating_screen' the identity @@ -361,7 +361,7 @@ XTreset_terminal_modes () where display update commands will take effect. This does not affect the place where the cursor-box is displayed. */ -static +static int XTcursor_to (row, col) register int row, col; { @@ -582,7 +582,7 @@ XTwrite_glyphs (start, len) to column FIRST_UNUSED (exclusive). The idea is that everything from FIRST_UNUSED onward is already erased. */ -static +static int XTclear_end_of_line (first_unused) register int first_unused; { @@ -2775,6 +2775,19 @@ x_text_icon (s, icon_name) return 0; } +/* Handling X errors. */ + +/* A handler for SIGPIPE, when it occurs on the X server's connection. + This basically does an orderly shutdown of Emacs. */ +static SIGTYPE +x_death_handler () +{ + if (_Xdebug) + abort (); + else + Fkill_emacs (make_number (70)); +} + static char *x_proto_requests[] = { "CreateWindow", @@ -2961,14 +2974,9 @@ x_error_handler (disp, event) } UNBLOCK_INPUT; - if (_Xdebug) - abort (); - else - Fkill_emacs (make_number (70)); + x_death_handler (); } -/* Initialize communication with the X window server. */ - #if 0 static unsigned int x_wire_count; x_trace_wire () @@ -3740,7 +3748,7 @@ x_term_init (display_name) signal (SIGWINCH, SIG_DFL); #endif /* SIGWINCH */ - signal (SIGPIPE, x_error_handler); + signal (SIGPIPE, x_death_handler); } void |
