[net.emacs] A handy new variable

israel.umcp-cs@UDel-TCP (03/04/83)

From:      Bruce Israel <israel.umcp-cs@UDel-TCP>

Lately I've noticed a problem that comes up with naive Emacs users.  They
are running 'emacs' or 'teache' (a local program which calls up emacs on an
emacs tutorial buffer) and they got a help window popped up on their screen
from doing something or other.  These users haven't learned how to get rid
of the extra window yet, and they are confused by this extra window (not to
mention that the tutorial is usually configured for a large enough screen).
To fix this problem I've added a new variable called 'remove-help-window'.
If this variable is set, then when the user is done with the help window
(i.e.  finished and executed the command he was typing) the help window will
be automatically removed and the screen restored to its original setup.
This variable defaults to '1' since its intended for naive users, though I
prefer this sort of action myself.  The only time that this action really
isn't desired is when you want to use the help buffer while editing, or
search through it, but that situation doesn't come up that much and when it
does it is easy enough to create the Help buffer and then to pop it back up
afterwards.  The way that its done is a real kludge and there should be a
better way to do it (James???), but it works. 

The following code goes into minibuf.c.

**** up near the top in the declarations goes:

extern PopUpWindows;
int RemoveHelpWindow;		/* if true, then the help window will be
				   removed on exit of any command completion
				   routines.  13-Jan-83 BNI */

**** In the function getword(table,s), at the beginning (the end of the
**** declarations and the beginning of the statements)

    int     oldpop;		/* old value of pop-up-windows */

    oldpop = PopUpWindows;
    if (RemoveHelpWindow) PopUpWindows = 0;

**** before the final return statement of getword goes:

    PopUpWindows = oldpop;

**** In the function InitMiniBuf at the end of the file goes:

    RemoveHelpWindow = 1;
    DefIntVar ("remove-help-window", &RemoveHelpWindow);

**** In addition in the file window.c, the declaration of PopUpWindows
**** must be changed from a static to an int so that getword can use it.

~ Bruce ~