Path: utzoo!utgpu!water!watmath!clyde!att!rutgers!ucsd!ucbvax!decwrl!sun!pitstop!sundc!seismo!uunet!mcvax!enea!zyx!arndt
From: arndt@zyx.SE (Arndt Jonasson)
Newsgroups: comp.emacs
Subject: Re: Gnu-emacs on the hp9000
Keywords: X
Message-ID: <2643@zyx.SE>
Date: 25 Jun 88 18:21:37 GMT
References: <135@spike.UUCP> <18267@cornell.UUCP>
Reply-To: arndt@zyx.SE (Arndt Jonasson)
Organization: ZYX Sweden AB, Stockholm, Sweden
Lines: 63

In article <18267@cornell.UUCP> deb@svax.cs.cornell.edu (David Baraff) writes:
>
>I'm having the following problem with gnuemacs 18.50, running under
>HPUX on an 825 (and a 325). I'm running gnuemacs under X10, and such that
>gnuemacs is NOT running in an xterm, rather it is doing the display
>itself (i.e. talking to the X server).
>
>[Describing problem with Emacs not exiting when the X session is
>terminated].

We have the same configuration, except we have 18.49.

The relevant file is xterm.c, in which there is a piece of code
designed to make Emacs get a SIGPIPE or an X error when the X server
disappears, thus causing Emacs to exit. Curiously enough, that code is
#ifndef HPUX. Just remove the #ifndef-#endif pair and remake Emacs.
You'll probably need to add the option +Ns2000 when compiling xterm.c,
in order not to get a symbol table overflow. We have run Emacs in this
way for some time now with no ill effects.

Before I discovered the above commented-out code, I added some code of
my own, and here is what the end of the function XTread_socket looks
like in our Emacs. If ill effects should in fact arise, use this code
instead, changing the #if 0 to #if 1.

#if 0
  /* AOJ 880406: if select returns true but XPending doesn't, it means that
     there is an EOF condition; in other words, that X has died.
     Act as if there had been a hangup. */
  {
     int d = dispno ();
     int mask = 1 << d;

     if (select (d+1, &mask, (long *) 0, (long *) 0,
		 (struct timeval *) 0) != 0
	 && !XPending ())
	kill (getpid (), SIGHUP);
  }
#endif
  if (count < 0)
    count = 0;
#ifndef HPUX
  if (CursorExists)
    xfixscreen ();
#endif
  UNBLOCK_INPUT ();
  return count;
}


A note to the developers: please always include a small comment saying
why this and that system was #ifdef'ed away; it makes the work easier
for others.


A question of my own: does anybody know why the screen doesn't always
get updated when using Gnu Emacs in the way described above on an
HP9000/800, though it does on an HP9000/300? For instance performing a
Meta-command and keeping the Meta-key pressed sometimes results in the
screen not being updated.
-- 
Arndt Jonasson, ZYX Sweden AB, Styrmansgatan 6, 114 54 Stockholm, Sweden
email address:	 arndt@zyx.SE	or	!mcvax!enea!zyx!arndt