To: rms@prep
Cc: tower@prep
Subject: GNU Emacs under X Writeup for Manual
Date: 19 Dec 85 15:55:33 EST (Thu)
From: Linda B. Merims <lbm@ATHENA.MIT.EDU>


Here's something you can put in the V17 manual to describe GNU Emacs under
X.  I've added a couple of notes to you about things that didn't work
when I tried them.  It has no formatting commands in it.  I
don't know if we followed your naming conventions.  It is important
for us to distinguish between "gnuemacs" and "emacs" for the next
six months while we convert our 2000+ users over from CCA, so I mention
that at MIT's Project Athena, things are a little different for
a short while.

I didn't put in anything about X-specific variables.  I don't know
anything about them.  I'm also a bit colloquial in places, to make
my point better with novices (who, for example, understand "cursor" better
than "point".)  I also didn't document the -d display command option.
Nor are there any credits to, for example, Joachim Martillo.  Up to you.

Hope this does you good.

                              Linda Merims


----------------------------------------------------------------
GNU Emacs on X Window System Displays


GNU Emacs works with the X window system.  It starts
by "popping up" a new window on the screen.  This can be a bit
disconcerting if you're not used to it.  If you're on one of these
terminals, the easiest way to start up GNU Emacs is to type the same command
you would before, but to follow it with a &, as in:

emacs  paper.mss &

The "&" runs GNU Emacs in the "background," freeing your original
window for other uses.  (There are X-specific options to the Gnuemacs
commands that will be listed later.)

NOTE:  GNU Emacs may be invoked by 
different names at different sites.  It is sometimes known
as xemacs.  At MIT's Project Athena where GNU Emacs was first
adapted to X, the correct command is:  gnuemacs  until summer
1986, when it will become just:  emacs.

Soon, you will see a small black box in the upper left hand corner of your
screen that reads, "emacs: 10 x 10".  (This number represents
columns x rows.)  You'll also see a small outline of a window with
a cross in the upper left hand corner of it.  This is where the upper
left hand corner of your window will be.  You can move this cross with
the mouse to any spot on the screen.   You can then do one of three
things:

make an 80 column by 24 row emacs window -- click the left mouse button

make an 80 column by 65 row emacs window -- click the right mouse button
  (the length will actually be however many lines long your screen
   can hold.  80 by 66 is about the size of an 8 1/2 x 11 piece of paper.)

make any size emacs window you want -- hold down the middle mouse button
  and move the mouse to create a window of any size.  As you move the
  mouse, the numbers in the upper left hand corner of the screen and
  the rubber-band outline will expand or contract.  Just release the
  button when the window is the size you want.

Unless you make the window in any area that does not overlap any other
windows, you may have problems when you want to get back to a window
obscured by the GNU Emacs window.  You need to know how to use the X
window manager, xwm, to move and shuffle these windows around. For
more information on the window manager, you can type  man xwm, on
any Berkeley 4.3 Unix system with this user-contributed (/usr/new)
utility available.

Note that you cannot suspend (C-Z) a GNU emacs X window.



GNU Emacs and the X Mouse

When using GNU Emacs on an X terminal, you can take advantage of the
convenient, quick commands for moving point, setting the mark, and
cutting and pasting text.  You issue these commands by pressing
the mouse's buttons alone or in concert with the SHIFT, CTRL, or
SHIFT-CTRL keys as follows:

left     set mark ('x-mouse-set-mark) (RMS, this blinked cursor but didn't
                                       actually set anything...lbm)

middle   move the cursor (point) to where the mouse is.  This is
         like moving the cursor with C-F or C-N or the arrow keys,
         only immediate.  ('x-mouse-set-point)

right    move to the window where the mouse is.  Point is in the same
         place as it was the last time you were in the window.
         ('x-mouse-select)


SHIFT-left
         undefined

SHIFT-middle
         take the text between point and mark and put it into the
         X cut buffer.  The text does NOT disappear from the screen.
         It does NOT go into the emacs kill right.  Used for copying
         text.  Recall text with SHIFT-right below.  ('x-cut-text)

SHIFT-right
         paste text from the X cut buffer to before point. ('x-paste-text)


CTRL-left
         undefined

CTRL-middle
         take the text between point and mark and put it into the
         X cut buffer, AND the emacs kill ring.  Text is deleted
         from the screen.  Used for moving text.  Recall text with
         SHIFT-right above, or any emacs kill ring command. 
         ('x-cut-and-wipe-text)

CTRL-right
         divide current window in two.  ('x-mouse-select-and-split)


CTRL-SHIFT-middle
         return to one-window mode, keeping the window the mouse is
         in.   ('x-mouse-keep-one-window)(RMS, this didn't always work...lbm)



Emacs Command X Window Options

These command options have meaning to the X window system:

-r    use reverse video (white characters on black background)

-i    use GNU emacs's bitmap icon (a kitchen sink) if the emacs
      window is iconized instead of the xwm window manager default.

-font fontname
      use fontname instead of the default vtsingle

-b borderwidth
      make the window border borderwidth pixels wide.  Default is 1.

-w windowsize
      instead of relying on the mouse buttons to determine size and
      placement of the GNU emacs window, make it this size.  Size
      is specified as:
    
         =[WIDTH][xHEIGHT][{+-}XOFF[{+-}YOFF]]

      The []'s denote optional stuff, the {}'s surround
      alternatives.  WIDTH and HEIGHT are in number of
      characters, XOFF and YOFF are in pixels.  X and YOFF are
      the xy offsets from the upper left corner origin for the
      upper left corner of the window.


GNU Emacs will check in the .Xdefaults file for default values for
these variables.  (RMS, we're not sure what program name it's
going to be looking for...lbm)


GNU Emacs under X Variables

I don't know what these are.  Sorry.