home *** CD-ROM | disk | FTP | other *** search
/ Geek Gadgets 1 / ADE-1.bin / ade-dist / emacs-18.59-src.tgz / emacs-18.59-src.tar / fsf / emacs18 / etc / XDOC < prev    next >
Text File  |  1996-09-28  |  18KB  |  461 lines

  1. BABYL OPTIONS:
  2. Version: 5
  3. Labels:
  4. Note:   This is the header of an rmail file.
  5. Note:   If you are seeing it in rmail,
  6. Note:    it means the file has no messages in it.
  7. 
  8. 1,,
  9. Received: from ATHENA (ATHENA.MIT.EDU) by prep; Thu, 19 Dec 85 23:09:34 est
  10. Received: from PARIS (PARIS.MIT.EDU) by ATHENA (4.12/4.7)
  11.     id AA02786; Thu, 19 Dec 85 23:07:35 est
  12. From: martillo@ATHENA.MIT.EDU (Yakim Martillo)
  13. Received: by PARIS (5.15/4.7)
  14.     id AA24170; Thu, 19 Dec 85 23:07:36 EST
  15. Date: Thu, 19 Dec 85 23:07:36 EST
  16. Message-Id: <8512200407.AA24170@PARIS>
  17. To: rms@prep
  18. Cc: lbm
  19. Subject: Gnu Emacs + X documentation
  20.  
  21. *** EOOH ***
  22. From: martillo@ATHENA.MIT.EDU (Yakim Martillo)
  23. Date: Thu, 19 Dec 85 23:07:36 EST
  24. To: rms@prep
  25. Cc: lbm
  26. Subject: Gnu Emacs + X documentation
  27.  
  28.  
  29. This is the start of my X documentation.
  30.  
  31. I have not finished the last five sections yet.  Please give me some
  32. suggestions.
  33.  
  34. Joachim
  35.  
  36.  
  37. Special Terminal Interfaces
  38.  
  39. Some terminals provide special capabilities which can be more
  40. effectively used via specially written C functions rather than normal
  41. termcap processing.  To ease the use of these capabilities and aid the
  42. integration of these C functions, special terminal hooks are provided.
  43.  
  44. The hooks are all externed in the source header file termhooks.h.
  45. To determine the arguments, the interested user who wishes to develop
  46. a special terminal interface should consult term.c.
  47. For proper functioning of the user defined C termhook functions, the
  48. user should make certain that the terminal characteristics as externed
  49. in termchar.h are properly set.  
  50.  
  51. Examples of how to use the termhooks can be found in xterm.c which
  52. contains the Gnu Emacs to X interface.
  53.  
  54. Gnu Emacs to X Interface
  55.  
  56. The termhooks feature has enough power that termhooks need not be
  57. restricted merely to the employment of special terminal capabilities.
  58. Termhooks can be used to interface Gnu Emacs to special graphics
  59. devices or window systems.  Gnu Emacs interfaces with not a great deal
  60. of difficulty to the MIT/Project Athena X Window system.  With not too
  61. much effort, a competent hacker should be able to interface Gnu Emacs
  62. to the Sun, Apollo, or Blit Window systems.
  63.  
  64. What is X?
  65.  
  66. X is a network transparent window system developed at MIT by Bob
  67. Scheiffler, Jim Gettys, Tony della Fera, Ron Newman and others.  X is
  68. a descendent of the Stanford V kernal system and Gosling's rectangle
  69. management system.  X has a standard protocol for communication with
  70. an X server which talks to the high resolution graphics device driver.
  71. The X developers have supplied a library libX.a which provides library
  72. routines to handle typical graphics/window system commands.  X is
  73. network transparent in that a process running on a machine which wants
  74. to make use of a high resolution graphics device will establish a
  75. network connection to the X server which talks to the driver for that
  76. device.  The process will be a client of the X server.  Since LAN's
  77. typically can move data at megabit rates, running a window system in
  78. this fashion has many advantages.  For more information about X,
  79. hackers are directed to "Xlib - C Language X Interface Version (?)"
  80. written by Jim Gettys (DEC/MIT) and Ron Newman (MIT).
  81.  
  82. New Functionality of Gnu Emacs + X
  83.  
  84. Gnu Emacs running as a client of X provides very rapid line insertion
  85. and deletion because bit blit commands are sent to the server and the
  86. driver simply tells the device to move the pixels on the screen
  87. directly.  In fact, Gnu Emacs running under the xterm terminal
  88. emulator can also cause bit blts to take place but bit blits via the
  89. terminal emulator are rather slow because of escape sequence parsing
  90. overhead in the terminal emulator and because of context switching
  91. overhead as the bits take a merry trip through the pty interfaces and
  92. drivers. 
  93.  
  94. Gnu Emacs runs in its own X window and therefore no information is
  95. lost from the xterm session from which the user invoked Gnu Emacs.
  96. Gnu Emacs should probably be run in background from the parent X
  97. session because then the user may continue to do more work in the
  98. parent xterm session.  As Gnu Emacs should be run in background, the
  99. lisp form 
  100.               (put 'suspend-emacs 'disabled t)
  101. is passed to the Gnu Emacs lisp interpreter when Gnu Emacs is invoked
  102. from an xterm terminal emulator.  Should the user accidently type the
  103. key sequence for suspend-emacs (initially C-z or C-XC-z), he will be
  104. queried whether he truly wishes to suspend emacs.  Unless the user is
  105. confident he should reply n (= no).
  106.  
  107. If the user has an X window manager running, the user can resize the
  108. Gnu Emacs window using the usual mouse sequences which have been
  109. grabbed by the window manager.  Gnu Emacs then automatically resizes
  110. itself and updates the display.  
  111.  
  112. By using the mouse window manager commands, the user can cause
  113. formerly obscured sections of the Gnu Emacs window to be uncovered.
  114. These sections have to be repainted.  Since Gnu Emacs creates the Gnu
  115. Emacs window by its lonesome, Gnu Emacs must repaint these sections of
  116. the window all by itself.  If Gnu Emacs is chugging away on some
  117. global regexp replacement, Gnu Emacs may take its time in repainting
  118. the display. (Similar repainting may take place on bit blits.)
  119.  
  120. With the Gnu Emacs to X interface the mouse becomes even more
  121. powerful.  Some mouse events (basically the ones not grabbed by the
  122. window manager) are passed to Gnu Emacs.  Gnu Emacs is informed of the
  123. reception of such events because it receives the key sequence C-cC-m.
  124. Therefore a user who wishes to use the Gnu Emacs to X interface should
  125. not rebind this key sequence to any function.
  126.  
  127. This key sequence is bound to the lisp function x-mouse-mode which
  128. goes and checks the special X Mouse Queue for mouse events.  Each
  129. control/shift/meta-mouse button sequence is associated with a defined
  130. constant in the lisp file x-mouse.el.  The constants are defined as
  131. follows:
  132.  
  133.     (defconst x-button-right (char-to-string 0))
  134.     (defconst x-button-middle (char-to-string 1))
  135.     (defconst x-button-left (char-to-string 2))
  136.  
  137.     (defconst x-button-s-right (char-to-string 16))
  138.     (defconst x-button-s-middle (char-to-string 17))
  139.     (defconst x-button-s-left (char-to-string 18))
  140.  
  141.     (defconst x-button-m-right (char-to-string 32))
  142.     (defconst x-button-m-middle (char-to-string 33))
  143.     (defconst x-button-m-left (char-to-string 34))
  144.  
  145.     (defconst x-button-c-right (char-to-string 64))
  146.     (defconst x-button-c-middle (char-to-string 65))
  147.     (defconst x-button-c-left (char-to-string 66))
  148.  
  149.     (defconst x-button-m-s-right (char-to-string 48))
  150.     (defconst x-button-m-s-middle (char-to-string 49))
  151.     (defconst x-button-m-s-left (char-to-string 50))
  152.  
  153.     (defconst x-button-c-s-right (char-to-string 80))
  154.     (defconst x-button-c-s-middle (char-to-string 81))
  155.     (defconst x-button-c-s-left (char-to-string 82))
  156.  
  157.     (defconst x-button-c-m-right (char-to-string 96))
  158.     (defconst x-button-c-m-middle (char-to-string 97))
  159.     (defconst x-button-c-m-left (char-to-string 98))
  160.  
  161.     (defconst x-button-c-m-s-right (char-to-string 112))
  162.     (defconst x-button-c-m-s-middle (char-to-string 113))
  163.     (defconst x-button-c-m-s-left (char-to-string 114)).
  164.  
  165. To understand why these constants are so defined, the user should
  166. check out the (C) definition of the lisp function x-mouse-mode in the
  167. src file xfns.c.  (I, Joachim Martillo not RMS, do not claim 
  168. this code handles mouse events in the best way possible, and all
  169. involved with maintaining the Gnu Emacs to X interface would be open
  170. to suggestions for improvement.)
  171.  
  172. Anyway, using these defined constants, the user may bind his own
  173. defined functions to mouse sequences using the define-key command as
  174. below:
  175.  
  176.     (define-key mouse-map x-button-right 'x-mouse-select).
  177.  
  178. Mouse functions are defined like any of the other lisp functions in
  179. Gnu Emacs.
  180.  
  181. Here, exempli gratia, is the lisp definition of x-mouse-select:
  182.  
  183.     (defun x-mouse-select (arg)
  184.       "Select Emacs window the mouse is on."
  185.       (let ((start-w (selected-window))
  186.         (done nil)
  187.         (w (selected-window))
  188.         (rel-coordinate nil))
  189.         (while (and (not done)
  190.             (null (setq rel-coordinate
  191.                     (coordinates-in-window-p arg w))))
  192.           (setq w (next-window w))
  193.           (if (eq w start-w)
  194.           (setq done t)))
  195.         (select-window w)
  196.         rel-coordinate)).
  197.  
  198. When the mouse sequence is received, x-mouse-mode checks out the mouse
  199. queue, sees the defined constant associated with that button event,
  200. looks up that defined constants binding in the mouse-map and then
  201. invokes this lisp function with arg which is a list of the x and y
  202. coordinates of the mouse when the mouse event under question took
  203. place.  The lisp symbol arg is bound to (x-coordinate y-coordinate).
  204.  
  205. The supplied mouse-functions and bindings are:
  206.  
  207.     x-cut-and-wipe-text          
  208.       Function: Kill text between point and mouse; also copy to
  209.             window system cut buffer.  
  210.       Binding:  C-Middle Button.
  211.  
  212.     x-cut-text
  213.       Function: Copy text between point and mouse position into
  214.             window system cut buffer.
  215.       Binding:  S-Middle Button (i.e. Shift-Middle Button).
  216.  
  217.     x-mouse-keep-one-window          
  218.       Function: Select Emacs window mouse is on, then kill all other Emacs
  219.             windows.
  220.       Binding:  C-S-Right Button.
  221.  
  222.     x-mouse-select              
  223.       Function: Select Emacs window the mouse is on.
  224.       Binding:  Right Button.
  225.  
  226.     x-mouse-select-and-split      
  227.       Function: Select Emacs window mouse is on, then split it vertically
  228.             in half.
  229.       Binding:  C-Right Button.
  230.  
  231.     x-mouse-set-mark          
  232.       Function: Select Emacs window mouse is on, and set mark at mouse
  233.                 position.
  234.       Binding:  Left Button.
  235.     x-mouse-set-point          
  236.       Function: Select Emacs window mouse is on, and move point to mouse
  237.             position.
  238.       Binding:  Middle Button.
  239.  
  240.     x-paste-text              
  241.       Function: Move point to mouse position and insert window system cut
  242.                 buffer contents.
  243.       Binding:  S-Right Button.
  244.  
  245. These functions are invoked simply by positioning the mouse and then
  246. pressing the correct key/button combination.
  247.  
  248. The cut and paste functions deserve special remark.  The X server
  249. maintains special buffers where data may be salted away.  One client
  250. may salt data away in a cut buffer.  Then another client could request
  251. this data.  In emacs, data is salted away, by setting the point (you
  252. could use the mouse to set the point) then moving the mouse to the end
  253. (or beginning) of the text to be salted away and pressing shift
  254. middle.  If the text should be wiped out of the buffer as well as
  255. salted away, C-Middle Button should be used instead of S-Middle
  256. Button.  To get the text back into this emacs or another emacs, move
  257. the mouse to where the text should be inserted and invoke x-paste-text
  258. via S-Right Button.  The text can be pasted into any client of the
  259. current X server from the current cut buffer using that client's paste
  260. command.  For xterm the paste command is also S-Right Button.
  261.  
  262. Other Gnu Emacs Lisp Functions
  263.  
  264. Command Line Arguments
  265.  
  266. .emacs File
  267.  
  268. x-switches
  269.  
  270. .Xdefaults
  271.  
  272. 
  273. 1,,
  274. Summary-line: 19-Dec         lbm@ATHENA.MIT.EDU  #GNU Emacs under X Writeup for Manual
  275. Received: from ATHENA (ATHENA.MIT.EDU) by prep; Thu, 19 Dec 85 15:57:34 est
  276. Received: from JASON (JASON.MIT.EDU) by ATHENA (4.12/4.7)
  277.     id AA12646; Thu, 19 Dec 85 15:55:53 est
  278. Received: by JASON (5.15/4.7)
  279.     id AA20416; Thu, 19 Dec 85 15:55:40 EST
  280. Message-Id: <8512192055.AA20416@JASON>
  281. To: rms@prep
  282. Cc: tower@prep
  283. Subject: GNU Emacs under X Writeup for Manual
  284. Date: 19 Dec 85 15:55:33 EST (Thu)
  285. From: Linda B. Merims <lbm@ATHENA.MIT.EDU>
  286.  
  287. *** EOOH ***
  288. To: rms@prep
  289. Cc: tower@prep
  290. Subject: GNU Emacs under X Writeup for Manual
  291. Date: 19 Dec 85 15:55:33 EST (Thu)
  292. From: Linda B. Merims <lbm@ATHENA.MIT.EDU>
  293.  
  294.  
  295. Here's something you can put in the V17 manual to describe GNU Emacs under
  296. X.  I've added a couple of notes to you about things that didn't work
  297. when I tried them.  It has no formatting commands in it.  I
  298. don't know if we followed your naming conventions.  It is important
  299. for us to distinguish between "gnuemacs" and "emacs" for the next
  300. six months while we convert our 2000+ users over from CCA, so I mention
  301. that at MIT's Project Athena, things are a little different for
  302. a short while.
  303.  
  304. I didn't put in anything about X-specific variables.  I don't know
  305. anything about them.  I'm also a bit colloquial in places, to make
  306. my point better with novices (who, for example, understand "cursor" better
  307. than "point".)  I also didn't document the -d display command option.
  308. Nor are there any credits to, for example, Joachim Martillo.  Up to you.
  309.  
  310. Hope this does you good.
  311.  
  312.                               Linda Merims
  313.  
  314.  
  315. ----------------------------------------------------------------
  316. GNU Emacs on X Window System Displays
  317.  
  318.  
  319. GNU Emacs works with the X window system.  It starts
  320. by "popping up" a new window on the screen.  This can be a bit
  321. disconcerting if you're not used to it.  If you're on one of these
  322. terminals, the easiest way to start up GNU Emacs is to type the same command
  323. you would before, but to follow it with a &, as in:
  324.  
  325. emacs  paper.mss &
  326.  
  327. The "&" runs GNU Emacs in the "background," freeing your original
  328. window for other uses.  (There are X-specific options to the Gnuemacs
  329. commands that will be listed later.)
  330.  
  331. NOTE:  GNU Emacs may be invoked by 
  332. different names at different sites.  It is sometimes known
  333. as xemacs.  At MIT's Project Athena where GNU Emacs was first
  334. adapted to X, the correct command is:  gnuemacs  until summer
  335. 1986, when it will become just:  emacs.
  336.  
  337. Soon, you will see a small black box in the upper left hand corner of your
  338. screen that reads, "emacs: 10 x 10".  (This number represents
  339. columns x rows.)  You'll also see a small outline of a window with
  340. a cross in the upper left hand corner of it.  This is where the upper
  341. left hand corner of your window will be.  You can move this cross with
  342. the mouse to any spot on the screen.   You can then do one of three
  343. things:
  344.  
  345. make an 80 column by 24 row emacs window -- click the left mouse button
  346.  
  347. make an 80 column by 65 row emacs window -- click the right mouse button
  348.   (the length will actually be however many lines long your screen
  349.    can hold.  80 by 66 is about the size of an 8 1/2 x 11 piece of paper.)
  350.  
  351. make any size emacs window you want -- hold down the middle mouse button
  352.   and move the mouse to create a window of any size.  As you move the
  353.   mouse, the numbers in the upper left hand corner of the screen and
  354.   the rubber-band outline will expand or contract.  Just release the
  355.   button when the window is the size you want.
  356.  
  357. Unless you make the window in any area that does not overlap any other
  358. windows, you may have problems when you want to get back to a window
  359. obscured by the GNU Emacs window.  You need to know how to use the X
  360. window manager, xwm, to move and shuffle these windows around. For
  361. more information on the window manager, you can type  man xwm, on
  362. any Berkeley 4.3 Unix system with this user-contributed (/usr/new)
  363. utility available.
  364.  
  365. Note that you cannot suspend (C-Z) a GNU emacs X window.
  366.  
  367.  
  368.  
  369. GNU Emacs and the X Mouse
  370.  
  371. When using GNU Emacs on an X terminal, you can take advantage of the
  372. convenient, quick commands for moving point, setting the mark, and
  373. cutting and pasting text.  You issue these commands by pressing
  374. the mouse's buttons alone or in concert with the SHIFT, CTRL, or
  375. SHIFT-CTRL keys as follows:
  376.  
  377. left     set mark ('x-mouse-set-mark) (RMS, this blinked cursor but didn't
  378.                                        actually set anything...lbm)
  379.  
  380. middle   move the cursor (point) to where the mouse is.  This is
  381.          like moving the cursor with C-F or C-N or the arrow keys,
  382.          only immediate.  ('x-mouse-set-point)
  383.  
  384. right    move to the window where the mouse is.  Point is in the same
  385.          place as it was the last time you were in the window.
  386.          ('x-mouse-select)
  387.  
  388.  
  389. SHIFT-left
  390.          undefined
  391.  
  392. SHIFT-middle
  393.          take the text between point and mark and put it into the
  394.          X cut buffer.  The text does NOT disappear from the screen.
  395.          It does NOT go into the emacs kill right.  Used for copying
  396.          text.  Recall text with SHIFT-right below.  ('x-cut-text)
  397.  
  398. SHIFT-right
  399.          paste text from the X cut buffer to before point. ('x-paste-text)
  400.  
  401.  
  402. CTRL-left
  403.          undefined
  404.  
  405. CTRL-middle
  406.          take the text between point and mark and put it into the
  407.          X cut buffer, AND the emacs kill ring.  Text is deleted
  408.          from the screen.  Used for moving text.  Recall text with
  409.          SHIFT-right above, or any emacs kill ring command. 
  410.          ('x-cut-and-wipe-text)
  411.  
  412. CTRL-right
  413.          divide current window in two.  ('x-mouse-select-and-split)
  414.  
  415.  
  416. CTRL-SHIFT-middle
  417.          return to one-window mode, keeping the window the mouse is
  418.          in.   ('x-mouse-keep-one-window)(RMS, this didn't always work...lbm)
  419.  
  420.  
  421.  
  422. Emacs Command X Window Options
  423.  
  424. These command options have meaning to the X window system:
  425.  
  426. -r    use reverse video (white characters on black background)
  427.  
  428. -i    use GNU emacs's bitmap icon (a kitchen sink) if the emacs
  429.       window is iconized instead of the xwm window manager default.
  430.  
  431. -font fontname
  432.       use fontname instead of the default vtsingle
  433.  
  434. -b borderwidth
  435.       make the window border borderwidth pixels wide.  Default is 1.
  436.  
  437. -w windowsize
  438.       instead of relying on the mouse buttons to determine size and
  439.       placement of the GNU emacs window, make it this size.  Size
  440.       is specified as:
  441.     
  442.          =[WIDTH][xHEIGHT][{+-}XOFF[{+-}YOFF]]
  443.  
  444.       The []'s denote optional stuff, the {}'s surround
  445.       alternatives.  WIDTH and HEIGHT are in number of
  446.       characters, XOFF and YOFF are in pixels.  X and YOFF are
  447.       the xy offsets from the upper left corner origin for the
  448.       upper left corner of the window.
  449.  
  450.  
  451. GNU Emacs will check in the .Xdefaults file for default values for
  452. these variables.  (RMS, we're not sure what program name it's
  453. going to be looking for...lbm)
  454.  
  455.  
  456. GNU Emacs under X Variables
  457.  
  458. I don't know what these are.  Sorry.
  459.  
  460.  
  461.