[comp.emacs] Mode line problem

cfj@zeus.hf.intel.com (cfj) (02/15/89)

I'm running GNU emacs 18.51 and have a stupid annoying problem which I
haven't been able to figure out by scanning the sources.  When emacs comes
up it prints the mode line is standout mode (reverse video on a wyse 50)
and when I exit emacs, it does not turn off the standout mode.  All
subsequent lines to the terminal are also in reverse video until I
manually turn it off.  I'm running System V release 3.2 on a 386.  Could
someone give me a hint on where in either the C or mocklisp source
I need to modify so that emacs does this correctly.  It also does it
when I do an escape to csh.

Thanks,

Charles Johnson
Intel Corp.
Hillsboro, OR
cfj@cfj.hf.intel.com

biesack@godel.dg.com (Dave Biesack) (02/21/89)

In article <341@zeus.hf.intel.com> cfj@zeus.hf.intel.com (cfj) writes:
> 
> I'm running GNU emacs 18.51 and have a stupid annoying problem which I
> haven't been able to figure out by scanning the sources.  When emacs comes
> up it prints the mode line is standout mode (reverse video on a wyse 50)
> and when I exit emacs, it does not turn off the standout mode.  All
> subsequent lines to the terminal are also in reverse video until I
> manually turn it off.  I'm running System V release 3.2 on a 386.  Could
> someone give me a hint on where in either the C or mocklisp source
> I need to modify so that emacs does this correctly.  It also does it
> when I do an escape to csh.
> 

I had similar problems running Emacs on a vt200 emulation terminal.
You have two options (that I can think of right now):

1) define `kill-emacs-hook' and `suspend-resume-hook' which are called
from suspend-emacs/kill-emacs. You will probably have to put a "wrapper"
around kill-emacs to add a kill-emacs-hook for 18.51; it is there in
18.52 (although the doc does not say so). Do something like:

(defvar old-kill-emacs (symbol-function 'kill-emacs))
(defun kill-emacs (arg)
"Exit the Emacs job and kill it.  ARG means no query.
If emacs is running noninteractively and ARG is an integer,
return ARG as the exit program code. before exitting, if kill-emacs-hook
is bound, it is called with run-hooks."
  (interactive "P")
  (and (boundp 'kill-emacs-hook) (run-hooks 'kill-emacs-hook))
  (funcall old-kill-emacs arg))


Your hook function can use send-string-to-terminal on the wyse-50 to
clear the screen and/or turn off inverse video. You can probably improve
this so that if the hook function(s) return non-nil, emacs is not killed
(analogous to how suspend-emacs runs its hooks)

2) put (setq mode-line-inverse-video nil) in your .emacs file.
   I do this because I don't like the inverse video to begin with.

> Thanks,
> 
> Charles Johnson
> Intel Corp.
> Hillsboro, OR
> cfj@cfj.hf.intel.com
> 


djb
David J. Biesack  			Data General
{seismo, ...}!mcnc!rti!dg-rtp!biesack	Research Triangle Park, NC
biesack@dg-rtp.dg.com			(919) 248-5989

mac@ardent.com (Michael McNamara) (02/21/89)

[ cfj@intel & biesack@godel.UUCP describe problems with screen staying
  in reverse video after exit/suspending Gnu-emacs ]

	You might have a problem with yout /etc/termcap or terminfo
description of you terminal.  The wyse50 in particular is ill
described in many vendors distributed terminal databases.  And
Gnu-emacs uses more of the info in termcap/terminfo than any other
program.

	Try changing sg#1 to sg#0 in /etc/termcap (or whatever that is
called in terminfo).

	-mac
--
Michael McNamara 
  mac@ardent.com