In article <28B57B58.4...@ibma0.cs.uiuc.edu>, epst...@sunc4.cs.uiuc.edu (Milt Epstein) writes:
[woe about DELETE, Backspace keys in emacs deleted]
Well, what you need may be a nice patch posted here quite a while ago
for emacs 18.57 src/x11term.c. I don't have the patch on line,
neither the entire src tree (too huge!), so I am going to post
the entire x11term.c here. You simply replace the original x11term.c
by the one attached below, and then issue make :-)
The place where Mark Andreessen's patch applied is identified with
his last name. I thank him for this nice fix. Write him your
thank you notes.
Sincerely,
Chin Fang
Mechanical Engineering Department
Stanford University
fangc...@leland.stanford.edu
-------------------- patched emacs 18.57 x11term.c ------------------
/* X Communication module for terminals which understand the X protocol.
Copyright (C) 1988, 1990 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)
any later version.
GNU Emacs is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Emacs; see the file COPYING. If not, write to
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
/* Written by Yakim Martillo, mods and things by Robert Krawitz */
/* Redone for X11 by Robert French */
/* Thanks to Mark Biggers for all of the Window Manager support */
/*
* $Source: /mit/emacs/src/RCS/11xterm.c,v $
* $Author: rfrench $
* $Locker: $
* $Header: x11term.c,v 1.12 88/02/29 14:11:07 rfrench Exp $
*/
#ifndef lint
static char *rcsid_xterm_c = "$Header: x11term.c,v 1.12 88/02/29 14:11:07 rfrench Exp $";
#endif lint
/* On 4.3 this loses if it comes after x11term.h.
On hp-ux it loses if it comes after config.h. */
#include <signal.h>
#include <sys/ioctl.h>
/* Load sys/types.h if not already loaded.
In some systems loading it twice is suicidal. */
#ifndef makedev
#include <sys/types.h>
#endif
#include "config.h"
#ifdef HAVE_X_WINDOWS
/* Get FIONREAD, if it is available.
It would be logical to include <sys/ioctl.h> here,
but it was moved up above to avoid problems. */
#ifdef USG
#include <termio.h>
#include <fcntl.h>
#endif /* USG */
#include "lisp.h"
#undef NULL
/* Allow m- file to inhibit use of interrupt-driven input. */
#ifdef BROKEN_FIONREAD
#undef FIONREAD
#endif
/* We are unable to use interrupts if FIONREAD is not available,
so flush SIGIO so we won't try. */
#ifndef FIONREAD
#ifdef SIGIO
#undef SIGIO
#endif
#endif
/* This may include sys/types.h, and that somehow loses
if this is not done before the other system files.
However, perhaps the problem has been avoided by loading types.h above. */
#include "x11term.h"
#ifdef IRIS
#include <sys/sysmacros.h> /* for "minor" */
#include <sys/time.h>
#else
#ifdef UNIPLUS
#include <sys/time.h>
#else /* not IRIS, not UNIPLUS */
/* Use socket.h just to control whether to use time.h or sys/time.h.
This works like the code in process.c. */
#ifdef HAVE_SOCKETS
#include <sys/socket.h>
#endif
#ifdef HAVE_TIMEVAL
/* _h_BSDTYPES is checked because on ISC unix, socket.h includes
both time.h and sys/time.h, and the latter file is protected
from repeated inclusion. */
#if defined(USG) && !defined(_h_BSDTYPES)
#include <time.h>
#else /* _h_BSDTYPES or not USG */
#include <sys/time.h>
#endif /* _h_BSDTYPES or not USG */
#endif /* HAVE_TIMEVAL */
#endif /* not UNIPLUS */
#endif /* not IRIS */
#ifdef BAT68K
#include <sys/time.h> /* In addition to time.h. */
#endif
#ifdef AIX
#include <sys/time.h> /* In addition to time.h. */
static KeySym XMOD_Alt[] = { XK_Alt_L };
static KeySym XMOD_Shift[] = { XK_Shift_L };
static KeySym XMOD_ShiftAlt[] = { XK_Alt_L, XK_Shift_L };
static KeySym XMOD_CtrlAlt[] = { XK_Control_L, XK_Alt_L };
static KeySym XMOD_Ctrl[] = { XK_Control_L };
static KeySym XMOD_CtrlShift[] = { XK_Control_L, XK_Shift_L };
static KeySym XMOD_ShiftCtrlAlt[] = { XK_Control_L, XK_Alt_L, XK_Shift_L };
#endif
#include <fcntl.h>
#include <stdio.h>
#include <ctype.h>
#include <errno.h>
#ifdef BSD
#include <strings.h>
#endif
#include <sys/stat.h>
#include "dispextern.h"
#include "termhooks.h"
#include "termopts.h"
#include "termchar.h"
#include "sink11.h"
#include "sink11mask.h"
#define min(a,b) ((a)<(b) ? (a) : (b))
#define max(a,b) ((a)>(b) ? (a) : (b))
extern int errno;
#define sigunblockx(sig) sigblock (0)
#define sigblockx(sig) sigblock (1 << ((sig) - 1))
#define METABIT 0200
#define MINWIDTH 12 /* In pixels */
#define MINHEIGHT 5 /* In pixels */
#define MAXHEIGHT 300 /* In lines */
int pixelwidth,pixelheight;
char *progname;
XEvent *XXm_queue[XMOUSEBUFSIZE];
int XXm_queue_num, XXm_queue_in, XXm_queue_out;
char *XXcurrentfont;
XFontStruct *fontinfo;
Font XXfid;
int XXfontw, XXfonth, XXbase, XXisColor;
/* Nonzero means Emacs has explicit keyboard focus. */
int x_focus_flag;
Colormap XXColorMap;
char *default_window;
int configure_pending;
extern int initialized;
extern int screen_width, screen_height;
/* Function for init_keyboard to call with no args (if nonzero). */
extern void (*keyboard_init_hook) ();
extern char *alternate_display;
extern int xargc;
extern char **xargv;
int XXdebug;
int XXpid;
int WindowMapped;
char *XXidentity; /* Resource name of this invocation of Emacs */
static char *XXicon_name; /* user-supplied icon info */
static int XXicon_usebitmap; /* Use bitmap or not */
static char *XXheader; /* user-supplied window header info */
static int flexlines; /* last line affected by dellines or
* inslines functions */
int VisibleX, VisibleY; /* genuine location of cursor on screen
* if it is there */
/* Last cursor position specified by move_cursor.
During an update, this does not display a cursor on the screen;
But it controls the position that is output. */
static int local_cursor_hpos;
static int local_cursor_vpos;
static int SavedX, SavedY; /* Where the cursor was before update
* started */
int CursorExists; /* during updates cursor is turned off */
int CursorOutline; /* when the pointer is not in the Emacs
* widow the cursor should be drawn in
* outline form a la xterm */
static int InUpdate; /* many of functions here may be invoked
* even if no update in progress; when
* no update is in progress the action
* can be slightly different */
Display *XXdisplay;
int XXscreen;
Window XXwindow;
GC XXgc_norm,XXgc_rev,XXgc_curs,XXgc_temp;
XGCValues XXgcv;
Cursor EmacsCursor;
Pixmap SinkPixmap, SinkMaskPixmap;
char *fore_color; /* Variables to store color names */
char *back_color;
char *brdr_color;
char *curs_color;
char *mous_color;
unsigned long fore; /* Variables to store pixel values */
unsigned long back;
unsigned long brdr;
unsigned long curs;
char *desiredwindow;
int CurHL; /* Current Highlighting (ala mode line) */
int XXborder; /* Window border width */
int XXInternalBorder; /* Internal border width */
int updated[MAXHEIGHT];
static char *temp_font; /* needed because of loading hacks */
static char *temp_reverseVideo;
static char *temp_borderWidth;
static char *temp_internalBorder;
static char *temp_useBitmap;
struct _xdeftab
{
char *iname; /* instance name */
char *cname; /* class name (fake it) */
char **varp; /* variable to set */
};
static struct _xdeftab xDefaultsValueTable[]
= {
{ "reverseVideo", "ReverseVideo", &temp_reverseVideo },
{ "borderWidth", "BorderWidth", &temp_borderWidth },
{ "internalBorder","BorderWidth", &temp_internalBorder },
{ "bitmapIcon", "BitmapIcon", &temp_useBitmap },
{ "borderColor", "BorderColor", &brdr_color },
{ "background", "Background", &back_color },
{ "foreground", "Foreground", &fore_color },
{ "pointerColor", "Foreground", &mous_color },
{ "cursorColor", "Foreground", &curs_color },
{ "font", "Font", &temp_font },
{ "geometry", "Geometry", &desiredwindow },
{ "title", "Title", &XXheader },
{ "iconName", "Title", &XXicon_name },
{ NULL, NULL, NULL }
};
int (*handler)();
static void x_init_1 ();
char *rindex();
/* HLmode -- Changes the GX function for output strings. Could be used to
* change font. Check an XText library function call.
*/
HLmode (new)
int new;
{
extern Lisp_Object inverse_video;
CurHL = new;
}
/* External interface to control of standout mode.
Call this when about to modify line at position VPOS
and not change whether it is highlighted. */
XTreassert_line_highlight (highlight, vpos)
int highlight, vpos;
{
HLmode (highlight);
}
/* Call this when about to modify line at position VPOS
and change whether it is highlighted. */
XTchange_line_highlight (new_highlight, vpos, first_unused_hpos)
int new_highlight, vpos, first_unused_hpos;
{
HLmode (new_highlight);
XTmove_cursor (vpos, 0);
x_clear_end_of_line (0);
}
/* Used for starting or restarting (after suspension) the X window. Puts the
* cursor in a known place, update does not begin with this routine but only
* with a call to redisplay.
*/
XTset_terminal_modes ()
{
int stuffpending;
#ifdef XDEBUG
fprintf (stderr, "XTset_terminal_modes\n");
#endif
InUpdate = 0;
stuffpending = 0;
if (!initialized) {
CursorExists = 0;
CursorOutline = 1;
VisibleX = 0;
VisibleY = 0;
}
XTclear_screen ();
}
/* XTmove_cursor moves the cursor to the correct location and checks whether an
* update is in progress in order to toggle it on.
*/
XTmove_cursor (row, col)
register int row,
...
read more »