home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 4 / FreshFish_May-June1994.bin / bbs / gnu / emacs-18.59-bin.lha / lib / emacs / 18.59 / etc / XDOC < prev    next >
Text File  |  1986-10-10  |  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 rece