[net.emacs] Bogus transient windows in Unipress Emacs

chongo@amdahl.UUCP (Landon Curt Noll) (10/14/86)

***FLAME ON***
In Unipress 2.10, they use a Bogus system of transient/typeout windows.  For
example you do an:  apropos "buf"  and they throw up this 'More' mode like
window that you must page through or recursive edit.  Try to invoke any
non-More-mode key and it deletes the help buffer.  So much for trying to
be a modeless editor!

What ever happened to the old days of plopping a help buffer on your screen
and allowing you to play with it?  Why can't they just leave the information
around and allow me to edit/scan/delete it in my own time and my own way?  
Why didn't the Unipress folks allow you to disable this BOGUS mode?
***FLAME OFF***

I looked for a simple or semi-simple way to yank this garbage and didn't find
a way offhand.  Many packages in Unipress use the 'use-transient-window', 
'use-typeout-window' and 'edit-in-transient-window' garbage.  Any clues as
to how I can disable this bogusness?

chongo <Unipress 2.x sold me on GNU emacs> /\oo/\
-- 
	    [people at Amdahl Corp never say things like this]

phr@ernie.Berkeley.EDU (Paul Rubin) (10/16/86)

In article <1407@Diamond.BBN.COM> mlandau@Diamond.BBN.COM (Matt Landau) writes:
>It's true that Unipress 2.xx moved help information into a transient window,
>making it act like almost all other Emacses in existence.  I, for one, got
>really tired of that stupid help buffer sucking up half the screen all the
>time.  Note, however, that the help buffer in Unipress 2.x is called "Help",
>and you can use it like any other buffer.  So if you want to look at the 
>help again, use your favorite "make buffer visible" function on it.

I first saw the technique of popping up a new buffer to display help,
etc. in Gosling Emacs.  The file etc/DIFF in the GNU Emacs
distribution (which describes differences between GNU Emacs and PDP-10
Emacs) says this about it:

  ** There is no concept of "typeout" in GNU Emacs.

  Any time that a command wants to display some output,
  it creates a buffer (usually with a name surrounded by asterisks)
  and displays it in a window.

  This provides some advantages:
   you can edit some more while looking at the output;
   you can copy parts of the output into other buffers.

  It also has a disadvantage that you must type a command
  in order to make the output disappear.
  You can use C-x 1 to get rid of all windows except the
  selected one.  To be more selective, you can switch to
  the window you want to get rid of and then type C-x 0
  (delete-window).

  You also need to type a command to scroll the other
  window if not all the output fits in it.  Meta-Control-v
  will usually do the job.

bader@spice.cs.cmu.edu (Miles Bader) (10/16/86)

Just type ^R and it will become a real buffer; exit the recursive edit to go
back to ``more mode.''  This shows how flexible emacs is-- these Twenex
style typeout windows were implemented using the normal windowing system in
emacs.  I like them much better than the normal type of pop-up help window,
as most of the things for which they are used really *are* transient, and I
don't want the information staying on my screen.

In my opinion, Unipress has done a pretty good job of fixing bugs and making
GosMacs more consistent and usable.  The only thing I don't like is what
they've done to the mail packages (and my complaints are simply cosmetic).

					-Miles

gallaher@topaz.RUTGERS.EDU (Mike Gallaher) (10/16/86)

Many people complained about the permanent pop-up help window in early Gosling
Emacs, mostly because it suddenly obliterated their carefully crafted window
setup (which was not easy to reconstruct way back then).  I hated those windows
myself.  Unipress Emacs V2.10 displays help buffers in transient typeout
windows that go away when you are done looking at them, restoring the screen to
its previous state.  Almost everyone finds this more appealing (chongo's is the
first dissenting opinion I've heard), so it didn't occur to me to make
accessible an option to turn it off.  It isn't hard to do so, so I will.  For
now (set-help-typeout-hook "nothing") will disable it for the internally
generated help output, though some other commands will still use typeout
windows.  (chongo, what is it that typeout windows make inconvenient for you to
do?)

This style of typeout window is not really like that of ITS Emacs, whose help
typeout was not easily accessible as buffer text.  In V2.10, a typeout window
is just a transient window that looks at some buffer into which some command
has generated its output.  Such buffers do not go away when the typeout window
does, unless the command explicitly deletes them.  You can edit the buffer
anytime, just as you can any other buffer.  The internally generated help
messages (e.g., from typing '?' to visit-file or use-old-buffer) stay in the
buffer "Help".  You can always type ^R at a typeout window to recursively edit
its contents; type ^_-b to see its name.  You might want to rename the buffer
or copy its contents to another buffer if you want to be sure it will not go
away.  To see the name of the buffer without having to edit it, add %b to the
typeout-more-prompt and typeout-end-prompt variables.

edit-in-transient-window has nothing to do with typeout windows; it enters a
recursive edit in a transient window for quickly editing short bits of text, as
is done by edit-variable and edit-word-description.  (You can see the
documentation of these functions via ^_-d.)

manheime@nbs-amrf.UUCP (Ken Manheimer) (10/17/86)

>							    I, for one, got
> really tired of that stupid help buffer sucking up half the screen all the
> time.  Note, however, that the help buffer in Unipress 2.x is called "Help",
> and you can use it like any other buffer.  So if you want to look at the 
> help again, use your favorite "make buffer visible" function on it.
> -- 
>  Matt Landau      	 		BBN Laboratories, Inc.

I also am bugged by the way that pop-up windows operate in Gosmacs,
and went so far (when i had no alternatives) to run with
'pop-up-windows' 0, and use a refinement of split-window which
turns out to be much like the suite of functions bound to ^X-4 in
Gnu Emacs.  For instance, with pop-ups disabled (preventing them
from frequently disrupting my precious window-layout) the help window
*doesn't* show up when you do, say, an apropos (or completion
happens), so i could do a '^X-2-h', which produces the help window
in the second half of the current window (instead of superceding
one of my other windows).

Gnu Emacs' strategy of preserving a history of previously
superceded windows for easy recovery is the best answer i've
encountered, so that i don't hesitate to pop-up windows when using
it, knowing that i can recover displaced ones very easily.  One
further refinement i've developed is a 'preserve-excurse' function,
bound to ^X-' (with marginally mnemonic connotations as "quote-
environment"), that just does a recursive-edit within a
save-excursion so that i can go off, do arbitrary and incidental
things (sounds like fun, hmm?), and then pop back to the layout i
was working within.

In case anyone is interested, here are the functions i'm talking
about; first the mlisp refinement on split-current-window, called
'split-and', then the mlisp version of 'preserve-excurse', then the
elisp version of 'preserve-excurse'.  (In looking at split-and for
the first time in a while it strikes me i should have made the ^X-2
a prefix for a suite of functions, like Gnu-emacs ^X-4, but this
is good enough, i guess.)

Cheers!
Ken Manheimer.

(defun    
    ; this helper necessary for 'split-and'; it's true when the named buffer
    ; already exists.  This is necessary because use-old-buffer always will
    ; do completion, so plain (use-old-buffer "mai") can succeed with, eg, the 
    ; buffer "main", even when/though a buffer called "mai" doesn't exist.
    (buffer-exists q-buff
	(setq q-buff (arg 1 "Buffer: "))
	(save-window-excursion
	    (& (! (error-occurred (use-old-buffer q-buff)))
	       (= q-buff (current-buffer-name))))
	)
    (split-and suffix tobuf was-pop-ups
; This function is intended to provide an alternative to pop-up-windows.  It
; provides a refinement of the split-current-window functionality, and I
; suggest binding it to ^X2.
; I can't stand the way windows are mis-juggled with pop-up-windows engaged
; (in particular, the way help windows are left around and visit-files
; occlude an incidental buffer if more than two are on the screen), so I use 
; this function to put those behaviors at my discretion.  I find this scheme 
; *much* more convenient.
	(message
 "split-and: {`o'ld-`b'uffer, `s'ame; & `t'iny, `v'isit, `h'elp buffer, `!'}")
	(setq suffix (get-tty-character))
	(if (= suffix 111) 	; o
	    ; pop to an established buffer in the other half of current window:
	    (progn (setq tobuf (get-tty-buffer "(extant) Buffer: "))
		   (split-current-window)
		   (switch-to-buffer tobuf))
	    (= suffix 98)	; b
	    ; pop to an arbitrary buffer in the other half of current window:
	    (progn (setq tobuf (arg 1 "Buffer: "))
		   (split-current-window)
		   (switch-to-buffer tobuf))
	    (= suffix 115)	; s
	    ; split the current buffer in current window:
	    (split-current-window)
	    (= suffix 116)	; t
	    ; split the current buffer, tiny/large, in current window:
	    (progn  (split-current-window)
		    (previous-window)
		    (while (! (error-occurred (shrink-window))))
		    (enlarge-window))
	    (= suffix 118)	; v
	    ; Visit a file in other half of current window:
	    (progn (setq tobuf (arg 1 "File: "))
		   (split-current-window)
		   (if (buffer-exists tobuf)
		       (switch-to-buffer tobuf)
		       (visit-file tobuf)))
	    (= suffix 104)	; h
	    ; Expose the help window in other half of current window:
	    (progn (split-current-window)
		   (switch-to-buffer "Help"))
	    (= suffix 33)	; !
	    ; Execute cmd and expose results in other half of current window:
	    ; (Sorta silly finagling to prompt for command)
	    (progn (setq was-pop-ups pop-up-windows)
		   (setq pop-up-windows 1)
		   (pop-to-buffer "Command execution")
		   (setq needs-checkpointing 0)
		   (previous-window)
		   (setq pop-up-windows was-pop-ups)
		   (push-back-string "\^X!"))
	    (= suffix 112)	; p
	    ; Pop to shell in other half of current window
	    (progn (split-current-window)
		   (shell))
	    ; No such suffix:
	    (error-message "Aborted.")
	)
    ; Simple but useful:
    (preserve-excurse (save-window-excursion
			  (message "`^C' will resume pending window state")
			  (recursive-edit)))
)

Elisp code:
(defun preserve-excurse ()
  "Embark on a recursive edit within a save-window-excursion"
  (interactive)
  (save-window-excursion (recursive-edit)))

barmar@mit-eddie.MIT.EDU@ndmce.uucp (Barry Margolin) (10/17/86)

The original poster has things backwards.  Gosling invented the use of
permanent buffers for transient information.  It sounds as if Unipress
finally excised it.  Stallman's original EMACS for ITS and TOPS-20 did
not have it, neither did Multics Emacs nor Lisp Machine Zwei.  In the
Unix world, CCA EMACS doesn't have it either.  So, it seems as if
Unipress opted for compatibility.

Zwei, however, has a feature that solves the problem you have.  There is
a command (Execute Command To Buffer, I think it's called) which
redirects transient output to a buffer.
-- 
    Barry Margolin
    ARPA: barmar@MIT-Multics
    UUCP: ..!genrad!mit-eddie!barmar

mlandau@Diamond.BBN.COM@ndmce.uucp (Matt Landau) (10/18/86)

It's true that Unipress 2.xx moved help information into a transient window,
making it act like almost all other Emacses in existence.  I, for one, got
really tired of that stupid help buffer sucking up half the screen all the
time.  Note, however, that the help buffer in Unipress 2.x is called "Help",
and you can use it like any other buffer.  So if you want to look at the 
help again, use your favorite "make buffer visible" function on it.
-- 
 Matt Landau      	 		BBN Laboratories, Inc.
    mlandau@diamond.bbn.com		10 Moulton Street, Cambridge MA 02238
 ...seismo!diamond.bbn.com!mlandau      (617) 497-2429

 "Go away, or Cerebus is going to strip-mine your face."