home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / X / epoch / Epoch.FAQ < prev    next >
Encoding:
Text File  |  1992-07-01  |  51.4 KB  |  1,350 lines

  1. ----------------------------------------------------------------------
  2. *               Epoch FAQ (Frequently Asked Questions)
  3. *        (or at least Occasionally Wondered-About Questions)
  4.  
  5. *        Maintained by Marc Andreessen (marca@ncsa.uiuc.edu)
  6. *     Last Modified Mon May 18 22:17:07 1992 -- Marc Andreessen
  7.  
  8. If you are viewing this text in a GNU Emacs buffer, you can type
  9. "M-2 C-x $" to get an overview of just the questions.  Then, when
  10. you want to look at the text of the answers, just type "C-x $".
  11.  
  12. To search for a question numbered XXX, type "M-C-s ^XXX:", followed by
  13. a C-r if that doesn't work; type ESC to end the search.
  14.  
  15. The latest version of this file will be always available via anonymous
  16. FTP to ftp.ncsa.uiuc.edu (141.142.20.50) in /outgoing/marca/epoch.
  17.  
  18. Please feel free to send comments, suggestions, additions, and
  19. corrections to marca@ncsa.uiuc.edu.
  20.  
  21. *                   === REALLY IMPORTANT NOTE ===
  22.  
  23. Unless otherwise attributed, information below is based only on Yours
  24. Truly's use and experience with Epoch and is BY NO MEANS GUARANTEED to
  25. be correct, complete, or even coherent.  If it works for you, great;
  26. if it doesn't, let me know, but there are no guarantees.
  27.  
  28. *             === CHANGES IN THIS VERSION OF THE FAQ ===
  29.   
  30.   Here is a list of changes made since the FAQ's last monthly
  31.   posting to gnu.epoch.misc and news.answers:
  32.   
  33.   a) Addition of this section of the FAQ.
  34.   b) F-1: Two more ways to fix the backspace key.
  35.   c) G-2: Patch to make drag style always display.
  36.   d) Z-3: Only applies to X11R5 multiscreen servers, plus workaround.
  37.  
  38. *                       === PREREQUISITES ===
  39.   
  40.   In the answers that follow, I assume at least a little familiarity
  41.   with GNU Emacs Lisp (elisp).  Suggested resources that could be
  42.   considered necessary references for material in this FAQ are:
  43.  
  44. --> The GNU Emacs and Epoch manuals (available online via C-h i).  
  45.   
  46. --> The GNU Elisp manual (available via anonymous FTP from
  47.     prep.ai.mit.edu (18.71.0.38) as /pub/gnu/elisp-manual-1.03.tar.Z).
  48.   
  49. --> The gnu.emacs.help FAQ in the file etc/FAQ (the latest version
  50.     is available in the gnu.emacs.help Usenet newsgroup or via FTP from
  51.     pit-manager.mit.edu (18.172.1.27) in /pub/usenet/gnu.emacs.help).
  52.  
  53. *                          === CAVEATS ===
  54.   
  55.   Many of the answers given herein APPLY ONLY to Epoch 4.0 (and also may
  56.   only apply to 4.0 beta level 0 or later).  When I know about them,
  57.   3.2'isms and 4.0-alpha'isms are mentioned also.  Also, my Epoch
  58.   platform is an SGI IRIS Indigo XS running IRIX 4.0.2; other
  59.   configurations may behave differently.  Please let me know of any such
  60.   differences.  (Now that an official release of 4.0 has been made,
  61.   details about previous versions will be removed at some point in the
  62.   future.)
  63.  
  64. *                    === EPOCH AND GNU EMACS ===
  65.  
  66. A-1: What is Epoch?
  67.   
  68.   Epoch is GNU Emacs on steroids: an adaptation of GNU Emacs with lots
  69.   of additional support for features made possible by the X11 windowing
  70.   system.  These features include multiple editing windows, arbitrary
  71.   colors and fonts (fixed-width and proportional), selectable zones per
  72.   buffer with arbitrary display styles (font, color, underline, stipple,
  73.   pixmap), an optional separate minibuffer window, improved keyboard and
  74.   mouse handling, full 8-bit character set support, and more.
  75.   
  76.   Epoch, like GNU Emacs, is very customizable; much of this FAQ
  77.   describes ways to customize Epoch for specific purposes.
  78.   
  79. A-2: How can I get Epoch?
  80.   
  81.   Epoch is available via anonymous FTP to cs.uiuc.edu (128.174.252.1)
  82.   in pub/epoch-files/epoch.  The main file of interest is currently
  83.   epoch-4.0p1.tar.Z.
  84.   
  85.   According to Simon Marshall (S.Marshall@sequent.cc.hull.ac.uk):
  86.   
  87.   Like GNU & X11 stuff, epoch is available in the UK from
  88.   uk.ac.ic.doc.src (00000510200001).  You can log on; there's help to
  89.   tell you the different ways of getting source.  Epoch is in
  90.   /gnu/epoch.
  91.   
  92.   Epoch is also available from aix370.rrz.uni-koeln.de (134.95.132.2)
  93.   in /gnu/emacs/epoch.
  94.   
  95.   Volunteers for other FTP sites outside the United States, or for
  96.   mail access to Epoch source, please step forward.
  97.   
  98. A-3: What is the latest version of Epoch?
  99.   
  100.   The latest version is 4.0 patchlevel 1.  Previous versions still in
  101.   use by some people include 4.0 patchlevel 0, the 4.0 alpha and beta
  102.   levels, and version 3.2.
  103.   
  104.   Epoch 4.0p1 (a.k.a. 4.0 patchlevel 1) is based on GNU Emacs 18.58,
  105.   which is the most recent version of GNU Emacs.
  106.   
  107. A-4: What are the differences between the various versions of Epoch?
  108.   
  109.   NOTE: Many bugs were also fixed from version to version; for the
  110.   most part, those fixes aren't mentioned here.)
  111.   
  112.   Important differences between 3.2 and 4.0-alpha include:
  113.      [From initial announcement of Epoch 4.0a0.]
  114.   
  115.   a)  Based on 18.57 GNU Emacs.  [3.2 was based on 18.55.]
  116.   b)  Completely rebuilt display code: now supports proper proportional
  117.       fonts.
  118.   c)  Changes from attributes to styles.
  119.   d)  Minibuffer can now be in its own window (traditional Epoch) or in the
  120.       same window as the epoch screens (traditional GNU Emacs).
  121.   e)  Mouse maps now based on Ken Laprade's mouse package.
  122.   f)  Selections rather than cut-buffers (but cut-buffers still work).
  123.   g)  Runs on more platforms.
  124.   
  125.   Important differences between 4.0-alpha and 4.0-beta include:
  126.      [From 4.0-beta README.]
  127.   
  128.   h)  Includes code to build ASCII version of GNU Emacs 18.57.
  129.   i)  Support for sharing lisp directory between Epoch and GNU Emacs
  130.       18.57 installed elsewhere.
  131.   j)  "Buttons" became "zones".  (See question A-5 below.)
  132.   k)  Performance enhancements.
  133.   
  134.   Important differences between 4.0b0 and 4.0b1 include:
  135.      [From 4.0b1 README.]
  136.   
  137.   l)  Based on 18.58 GNU Emacs.
  138.   m)  Bug-fixes for graphical zone support.
  139.   n)  Epoch no longer reads $HOME/.Xdefaults on its own; it assumes
  140.       that Epoch resources are available in the X server's resource
  141.       database.  (This is ICCCM-compliant behavior, which makes Epoch
  142.       more like other X applications).
  143.   
  144.   Important differences between 4.0b1 and 4.0p0 include:
  145.      [From preliminary announcement of 4.0p0.]
  146.   
  147.   o)  Epoch will read $HOME/.Xdefaults on its own if the '-ud' command
  148.       line option is used; otherwise, it uses the X resource database
  149.       only.
  150.   p)  Additional support for 8-bit fonts and hypertext info in the
  151.       contrib directory.
  152.   
  153.   Important differences between 4.0p0 and 4.0p1 include:
  154.      [From announcement of 4.0p1.]
  155.   
  156.   q)  Added support for pasting from Epoch to Open Windows clients.
  157.   r)  Ability to set cursor foreground/background.
  158.   s)  Ability to load standard X bitmap files as well as XPM pixmap
  159.       files.
  160.   t)  Replacement contrib/hyper/info.el for broken 4.0p0 version.
  161.   
  162. A-5: I recently moved to Epoch 4.0b0 (or later), and elisp code that
  163.  worked before has stopped working.  Why?
  164.   
  165.   Change c) for Epoch 4.0b0 is probably the culprit; the term "zone" was
  166.   chosen to replace the term "button", changing the names of all the
  167.   button-related function names and variables.  There are two ways to
  168.   deal with this change:
  169.   
  170.   METHOD #1:
  171.   
  172.     Put the following command at the head of each file of elisp code
  173.     that uses buttons:
  174.     
  175.     (require 'button)
  176.     
  177.     (This simply does a series of fset's to replace the "button" names
  178.     with the new "zone" names.)
  179.     
  180.   METHOD #2:
  181.     
  182.     Convert all references of "button" to "zone".  You can use the
  183.     function convert-current-buffer in epoch-lisp/convert-buttons.el
  184.     (in the Epoch distribution) to do this automatically.
  185.     
  186.     NOTE: There may be additional problems; in particular, since
  187.     attributes were eliminated in Epoch 4.0a0, any use of them will
  188.     have to be eliminated also.  This is less simple than switching
  189.     from buttons to zones.  Fortunately, most Epoch packages on the
  190.     net now support 4.0.  Therefore, I won't bother to come up with an
  191.     answer for this one (unless someone actually needs to know).
  192.     
  193. A-6: I recently moved to Epoch 4.0b1 (or later), and my X resources are
  194.  suddenly being ignored.  Why?
  195.   
  196.   Change n) for Epoch 4.0b1 above has caused some trouble for people
  197.   moving to 4.0b1 (or later).  Previous to 4.0b1, Epoch would always
  198.   extract its X default resources from the user's .Xdefaults file by
  199.   hand; this is no longer the case.  If Epoch 4.0b1 (or later) isn't
  200.   picking up resources like previous versions did on your system, prior
  201.   to starting Epoch do this:
  202.   
  203.     xrdb -merge $HOME/.Xdefaults
  204.   
  205.   This makes the X server's database pick up and maintain all of the
  206.   resource definitions found in $HOME/.Xdefaults.
  207.   
  208.   If you are running Epoch 4.0p0 or later you can use the '-ud'
  209.   command line flag to force Epoch to manually scan $HOME/.Xdefaults.
  210.   
  211.   A second problem is that Epoch 4.0b1 (or later) uses the first word
  212.   in the command that executed Epoch (argument 0) to search the X
  213.   resource database for Epoch resources.  Thus, if you invoke Epoch
  214.   with the name:
  215.   
  216.     epoch-4.0.1
  217.   
  218.   ...Epoch will use the string 'epoch-4.0.1' to search the resource
  219.   database, thereby missing the resources specified by the name
  220.   'epoch'.  The workaround is to use the '-rn' command-line option
  221.   like so:
  222.   
  223.     epoch-4.0.1 -rn epoch
  224.   
  225.   If you are running Epoch 4.0p1 or later you can use the '-name' flag
  226.   (which is standard for X applications) in place of '-rn', like so:
  227.   
  228.     epoch-4.0.1 -name epoch
  229.   
  230.   [From Martin Boyer (mboyer@ireq-robot.hydro.qc.ca).]
  231.   
  232. A-7: What's the difference between Epoch and GNU Emacs version 19?
  233.   
  234.   To quote directly from the GNU 'status' file (obtained via anonymous
  235.   FTP to prep.ai.mit.edu (18.71.0.38) as /pub/gnu/status):
  236.   
  237.   -- BEGIN QUOTE -----------------------------------------------------
  238.   Emacs 18 maintenance continues for simple bug fixes.  Version 19
  239.   approaches release, counting among its new features before and after
  240.   change hooks, source-level debugging of Emacs Lisp programs, X
  241.   selection processing, including CLIPBOARD selections, scrollbars,
  242.   support for European character sets, floating point numbers,
  243.   per-buffer mouse commands, interfacing with the X resource manager,
  244.   mouse-tracking, lisp-level binding of function keys, and multiple X
  245.   windows (`screens' to emacs).
  246.   
  247.   Thanks go to Alan Carroll and the people who worked on Epoch for
  248.   generating initial feedback to a multi-windowed emacs.  Emacs 19
  249.   supports two styles of multiple windows, one with a separate screen
  250.   for the minibuffer, and another with a minibuffer attached to each
  251.   screen.
  252.   
  253.   A couple of other features of Version 19 are buffer allocation, which
  254.   uses a new mechanism capable of returning storage to the system when a
  255.   buffer is killed, and a new input system--all input now arrives in the
  256.   form of Lisp objects.
  257.   
  258.   Other features under consideration for later releases of Version 19
  259.   include:
  260.   
  261.   ** Associating property lists with regions of text in a buffer.
  262.   ** Multiple font, color, and pixmaps defined by those properties.
  263.   ** Different visibility conditions for the regions, and for various
  264.      windows showing one buffer.
  265.   ** Hooks to be run if point or mouse moves outside a certain range.
  266.   ** Incrementally saving undo history in a file, so that recover-file
  267.      also reinstalls buffer's undo history.
  268.   ** Static menu bars, and better pop-up menus.
  269.   -- END QUOTE -------------------------------------------------------
  270.   
  271.   Epoch currently supports much of the new functionality of GNU Emacs
  272.   v19, including some features that apparently won't be immediately
  273.   available in GNU Emacs v19 (notably, associating property lists with
  274.   regions of text, and multiple fonts/colors/pixmaps defined by those
  275.   properties).
  276.   
  277.   A postscript to this answer is a message that Richard Stallman
  278.   (Mr. Gnu himself) posted to gnu.emacs.help in Apr 1992:
  279.   
  280.   -- BEGIN QUOTE -----------------------------------------------------
  281.   Emacs 19 won't support text highlighting, but a later version will.
  282.   
  283.   We have code basically working for attaching arbitrary properties to
  284.   parts of the text, including choice of font and color.
  285.   
  286.   This feature is designed for attributes which are considered part of
  287.   the text itself.  What Epoch provides is highlighting that is part
  288.   of the presentation of the text, not logically part of the text itself.
  289.   That is useful also; I hope we will find the wherewithal to implement
  290.   that along with the other highlighting features.
  291.   -- END QUOTE -------------------------------------------------------
  292.  
  293. *                     === CONFIGURING EPOCH ===
  294.  
  295. B-1: How can my .emacs file deal with both GNU Emacs and Epoch?
  296.   
  297.   An easy way to handle both GNU Emacs and Epoch within the same .emacs
  298.   file is to define a variable 'running-epoch' as follows:
  299.   
  300.   (defvar running-epoch (boundp 'epoch::version))
  301.   
  302.   Then, the rest of your .emacs file can look like this:
  303.   
  304.     (if running-epoch
  305.       (progn
  306.         ... [Epoch-specific code here] ...
  307.     ))
  308.   
  309.   ... [Emacs code here] ...
  310.   
  311.   (After this, when I refer to 'your .emacs file', read that as 'the
  312.   Epoch-specific portion of your .emacs file', under the assumption that
  313.   you have both general and Epoch-specific parts as detailed above.)
  314.   
  315.   If you have a large amount of Epoch-specific code it may be better to
  316.   put it in a separate file (e.g., "epoch-specific.el"), possibly
  317.   byte-compile it, then load it from your .emacs file like so:
  318.   
  319.     (if (boundp 'epoch::version) (load "epoch-specific"))
  320.   
  321. B-2: What if I want to have separate sections for Epoch 3.2 and 4.0 in
  322.  my .emacs file?
  323.   
  324.   The variable 'epoch::version' is a string that contains the current
  325.   Epoch version ID.  For instance, evaluating epoch::version under
  326.   Emacs4.0b0 (the first beta level) gives:
  327.   
  328.   "Epoch 4.0 Beta Patchlevel 0"
  329.   
  330.   A simple way to determine if version 4.x is running is to do something
  331.   like this:
  332.   
  333.     (string-match " 4" epoch::version)
  334.   
  335.   This will result in 't' if the string " 4" is a substring of
  336.   epoch::version (as would be the case when epoch::version is
  337.   "Epoch 4.0 ..."), and 'nil' otherwise.
  338.   
  339. B-3: How can I configure Epoch to support full 8-bit character sets?
  340.   
  341.   The variable 'ctl-arrow', which is a buffer-local variable, controls
  342.   how control characters are displayed.  By setting this variable to
  343.   something non-nil and non-t, you get full 8-bit characters.  To get
  344.   8-bit characters in all buffers, put this in your .emacs file:
  345.   
  346.     (setq-default ctl-arrow 'foo)
  347.   
  348.   [Thanks to Pierre Bondono (bondono@vnet.ibm.com) and Tor Lillqvist
  349.    (tml@tik.vtt.fi) for the following:]
  350.   
  351.   There is also a package in the Epoch contrib directory that deals
  352.   with 8-bit characters better than the above technique.  See the
  353.   directory contrib/keriven in the Epoch distribution.
  354.  
  355. *                          === WINDOWS ===
  356.  
  357. C-1: How do I get the minibuffer back at the bottom of my edit window?
  358.   
  359.   Start Epoch with the command-line option '-nm'.  Alternately, in your
  360.   general .Xdefaults file, specify:
  361.   
  362.     epoch.nonlocal.minibuf: False
  363.   
  364.   (These techniques only work in Epoch 4.0.)
  365.   
  366. C-2: How do I prevent the initial edit window from appearing?  (In
  367.  other words, how do I get only the minibuffer upon startup?)
  368.   
  369.   There is an undocumented variable that controls whether or not an
  370.   initial edit window will be provided.  (This variable is documented as
  371.   of 4.0p0.)  By default, of course, one is; to stop this from
  372.   happening, put the following in your .emacs:
  373.   
  374.     (setq inhibit-initial-screen-mapping t)
  375.   
  376.   This will have no effect if you're using local minibuffers (i.e. when
  377.   the minibuffer is a part of each edit window), as described above.
  378.   
  379.   [Thanks to Chris Love (love@cs.uiuc.edu).]
  380.   
  381. C-3: How do I stop the windows from automatically raising upon entry?
  382.   
  383.   The easiest way to do this, if you're running Epoch 4.0b0 or later, is
  384.   to specify the following in your .emacs file:
  385.   
  386.     (setq auto-raise-screen 'minibuf)
  387.   
  388.   If you're running a version of Epoch prior to Epoch 4.0b0, the
  389.   following code also works:
  390.   
  391.     (setq auto-raise-screen nil)
  392.     (push (function (lambda () (raise-screen (minibuf-screen)))) 
  393.       *select-screen-hook*)
  394.   
  395.   Both of the above solutions still make the minibuffer raise when an
  396.   Epoch edit window is entered; if you don't want the minibuffer to
  397.   raise itself either, just do the following instead:
  398.   
  399.     (setq auto-raise-screen nil)
  400.   
  401. C-4: How do I change the cursor?
  402.   
  403.   Another noticeable change from GNU Emacs is the cursor glyph (which is
  404.   a pencil shape).  To change this to a more normal-appearing arrow
  405.   shape, put this in your .emacs file:
  406.   
  407.     (cursor-glyph 68)
  408.     (cursor-glyph 68 (epoch::minibuf-screen))
  409.     (push '(cursor-glyph . 68) epoch::screen-properties)
  410.   
  411.   NOTE: You can specify a different cursor glyph for the minibuffer,
  412.   if you like.
  413.   
  414.   There are also X resources for the screen and minibuffer cursor
  415.   glyphs; equivalent to the above elisp code would be the following (in
  416.   your .Xdefaults file):
  417.   
  418.     epoch.screen.cursor.glyph: 68
  419.     epoch.minibuf.cursor.glyph: 68
  420.   
  421.   For either of these approaches, any valid cursor ID number will do; to
  422.   see the available cursors and their ID numbers, take a look at the
  423.   file /usr/include/X11/cursorfont.h.
  424.   
  425.   (See below for details on how to customize the cursor glyph based on
  426.   the mode of a screen's initial buffer.)
  427.   
  428. C-5: How do I define edit screen attributes on a per-mode basis?  Or,
  429.  how do I make my C++ edit windows come up with 48 lines and a big
  430.  round dot for a cursor?
  431.   
  432.   You can define styles for new edit screens created with
  433.   find-file-other-screen (which is, by default, bound to 'C-z 4 C-f' and
  434.   'C-z 4 f') based on the initial buffer's mode like so:
  435.   
  436.     (setq epoch-mode-alist
  437.       (append (list
  438.           (cons 'c-mode
  439.             (list
  440.               (cons 'geometry "80x52")
  441.               (cons 'cursor-glyph 94)))
  442.           (cons 'LaTeX-mode
  443.             (list
  444.               (cons 'geometry "90x48")
  445.               (cons 'cursor-glyph 58)))
  446.           (cons 'c++-mode
  447.             (list
  448.               (cons 'geometry "80x48")
  449.               (cons 'cursor-glyph 38))))
  450.         epoch-mode-alist))
  451.   
  452. C-6: How do I make Epoch manage edit window and icon names based on the
  453.  name of the current buffer(s)?
  454.   
  455.   The base Epoch distribution doesn't support this, but there have been
  456.   a number of small packages written that accomplish this.  The one
  457.   Yours Truly uses was written by Derek Ney (derek@boingo.med.jhu.edu)
  458.   and is up for anonymous FTP at ftp.ncsa.uiuc.edu (141.142.20.50) as
  459.   /outgoing/marca/epoch/derek-title.el.Z.
  460.   
  461. C-7: How do I iconify my entire Epoch session at once?
  462.   
  463.   By default, 'C-z i' is bound to iconify-screen, which only iconifies
  464.   the current edit window.  To iconify everything, define a small
  465.   function iconify-everything in your .emacs file like so:
  466.   
  467.     (defun iconify-everything () 
  468.       "Iconify entire Epoch session at once."
  469.       (interactive)
  470.       (dolist (s (screen-list))
  471.         (iconify-screen s))
  472.       (iconify-screen 0)
  473.     )
  474.   
  475.   Then bind it to a key sequence (e.g. 'C-z C-i') like so:
  476.   
  477.     (global-set-key "\C-z\C-i" 'iconify-everything)
  478.   
  479. C-8: Does Epoch support scrollbars?
  480.   
  481.   No; native support for scrollbars is a technical challenge that so far
  482.   no one has taken up for either GNU Emacs or Epoch.
  483.   
  484.   [Thanks to Pierre Bondono (bondono@vnet.ibm.com) for the following:]
  485.   
  486.   Related to this, there is a ``scrolling concept'' inside the IMOUSE
  487.   packages that may be of interest.  IMOUSE can be found in
  488.   contrib/boyer in the Epoch distribution or via anonymous FTP from
  489.   ireq-robot.hydro.qc.ca (131.195.2.130); see question H-1 below.
  490.   
  491. C-9: My workstation's screen area is overwhelmed by all the windows I
  492.  create in my Epoch editing sessions.  How can I squeeze more windows
  493.  into my working environment?
  494.   
  495.   This is only a half-facetious question; there's only room on most
  496.   workstation screens (usually 1024x768 or 1280x1024 pixels in area) for
  497.   a couple of windows with decent-sized fonts.  To help alleviate the
  498.   discomfort of cramped space, try the 'tvtwm' window manager.  (I sound
  499.   like a cough-drop commercial.)
  500.   
  501.   Tvtwm, a superset of the twm window manager, allows windows to be
  502.   placed on a virtual root window that can be of any size (for example,
  503.   3000 by 3000 pixels).  This virtual root can be navigated via tvtwm's
  504.   'panner', a reduced-size overview of your entire environment.
  505.   
  506.   Tvtwm can be found on your local comp.sources.x archive or in the
  507.   X11R4 and X11R5 distributions.  Try anonymous FTP to ftp.uu.net
  508.   (137.39.1.9) in /usenet/comp.sources.x.
  509.  
  510. *                      === COLORS AND FONTS ===
  511.  
  512. D-1: How do I interactively select my foreground color.
  513.   
  514.   First, define a style for each of your desired foreground colors in
  515.   your .emacs file, like so:
  516.   
  517.     (setq red-style (make-style))
  518.     (set-style-foreground red-style "red")
  519.   
  520.   Then, define a short command 'goto-style' like so:
  521.   
  522.     (defun goto-style (newstyle)
  523.       "Set current buffer to a given font NEWSTYLE."
  524.       (setq buffer-style newstyle)
  525.       (redraw-display))
  526.   
  527.   Next, bind commands to keys like so:
  528.   
  529.     (global-set-key "\C-c1" (definteractive (goto-style red-style)))
  530.   
  531.   This binds a command that changes the current foreground color to red
  532.   to the key sequence C-c 1.
  533.   
  534.   The following function allows you to interactive specify a new color
  535.   for the current buffer's foreground:
  536.   
  537.     (defun set-foreground (newfg)
  538.       "Set current foreground color to NEWFG."
  539.       (interactive "sForeground color: ")
  540.       (set-style-foreground buffer-style newfg)
  541.       (redraw-display))
  542.   
  543.   This function is activated by typing:
  544.   
  545.     M-x set-foreground
  546.   
  547.   Or, it can be bound to a key like so:
  548.   
  549.     (global-set-key "\C-z\C-s" 'set-foreground)
  550.   
  551. D-2: How do I switch fonts interactively?
  552.   
  553.   To change fonts, you don't have to define new styles.  Just define a
  554.   short command 'goto-font', like so:
  555.   
  556.     (defun goto-font (newfont)
  557.       "Set current buffer to a given font NEWFONT."
  558.       (font newfont)
  559.       (redraw-display))
  560.   
  561.   Then, bind commands to keys like so:
  562.   
  563.     (global-set-key "\C-c1" (definteractive (goto-font "8x13")))
  564.   
  565.   This changes the current edit window's font to "8x13" when the key
  566.   sequence 'C-c 1' is entered.
  567.   
  568.   The following function allows you to interactively input a font name:
  569.   
  570.     (defun set-font (newfont)
  571.       "Set current font to NEWFONT."
  572.       (interactive "sFont name: ")
  573.       (font newfont)
  574.       (redraw-display))
  575.   
  576.   This function is activated by typing:
  577.   
  578.     M-x set-font
  579.   
  580.   Or, it can be bound to a key like so:
  581.   
  582.     (global-set-key "\C-z\C-s" 'set-font)
  583.   
  584.   If the font you specify with either of these methods isn't valid for
  585.   your X server (i.e. if the font doesn't exist in a directory listed in
  586.   your X server's font path and in that directory's fonts.dir file, or
  587.   isn't available from the font server if you're running X11R5), you
  588.   will get this message in your minibuffer:
  589.    
  590.   Bad font name
  591.   
  592.   Font names are ordinary X font names; for example, a 14-point non-bold
  593.   non-italic Helvetica font can be referred to as:
  594.   
  595.   "*helvetica-medium-r-normal--14*"
  596.   
  597.   The standard X client 'xlsfonts' will give you a list of the fonts
  598.   registered with your X server.  The standard X client 'xfontsel' lets
  599.   you interactively put together an X font specification string based on
  600.   individual attributes (e.g., family, size).
  601.   
  602. D-3: How can I associate a certain foreground color with a file
  603.  so that every time I load that file my foreground color is
  604.  automatically set?
  605.   
  606.   You can easily do this by using GNU Emacs' ability to handle file
  607.   variables.  For example, if you have defined style 'red-style' to
  608.   specify a red foreground color, and want file 'foobar.c' to always
  609.   have the foreground color red, add this to the bottom of 'foobar.c':
  610.   
  611.     ^L
  612.     /*
  613.     Local Variables:
  614.     buffer-style: red-style
  615.     End:
  616.     */
  617.   
  618.   NOTE: '^L' is a newline character; you can enter one in an edit
  619.   buffer by typing 'C-q C-l'.
  620.   
  621.   Then, whenever 'foobar.c' is loaded, the variable 'buffer-style' will
  622.   be set to 'red-style', and as a result the foreground color for that
  623.   buffer will be red.
  624.   
  625. D-4: How do I design my own really funky technicolor modeline?
  626.   
  627.   Using the tried-and-true Learning By Example(tm) educational method,
  628.   I'll just give the (heavily commented) elisp code I use to define my
  629.   own customized modeline:
  630.   
  631.   ;; Define styles for the modeline.
  632.   (setq cyan-style (make-style))
  633.   (set-style-foreground cyan-style "#6fcfef")
  634.   (setq red-style (make-style))
  635.   (set-style-foreground red-style "red")
  636.   (setq yellow-style (make-style))
  637.   (set-style-foreground yellow-style "yellow")
  638.   
  639.   ;; Make display-time display day and date also.
  640.   (setq display-time-day-and-date t)
  641.   
  642.   ;; Display time, day, and date in modeline.
  643.   (display-time)
  644.   
  645.   ;; List full filename, with path.
  646.   (set-default 'mode-line-buffer-identification
  647.              '(buffer-file-name ("%f") ("%b")))
  648.   
  649.   ;; This actually turns inverse-video _off_ for the modeline.
  650.   (setq mode-line-inverse-video t)
  651.   
  652.   ;; Set the modeline itself.
  653.   (setq default-mode-line-format
  654.     (list red-style "--" 
  655.           ;; Buffer name.
  656.           yellow-style 'mode-line-buffer-identification 
  657.           red-style "-" 
  658.           ;; Buffer status (read-only, unchanged, changed).
  659.           cyan-style "%*%*" 
  660.           red-style "-" 
  661.           ;; Position in buffer.
  662.           cyan-style "%[%3p%]" 
  663.           red-style "--"  
  664.           ;; Current time.
  665.           yellow-style "%M" 
  666.           red-style "--("
  667.           ;; Mode name.
  668.           cyan-style 'mode-name 'minor-mode-alist "%n"
  669.             'mode-line-process 
  670.           red-style ")-%-"))
  671.   
  672. D-5: How do I replace the mouse region selection underlining with a
  673.  different style?
  674.   
  675.   You can override the variable 'motion::style' with your own style,
  676.   like so:
  677.   
  678.     (setq motion::style (make-style))
  679.   
  680.   Now, you can set the various elements of this style as you please.
  681.   Several examples follow.
  682.   
  683.   To have just the text foreground color change on mouse selection, do:
  684.   
  685.     (set-style-foreground motion::style "yellow")
  686.     (set-style-background motion::style (background))
  687.     
  688.   NOTE: Replace "yellow" with any desired X color name.
  689.   
  690.   To have the selected region appear as reverse video, try:
  691.   
  692.     (set-style-foreground motion::style (background))
  693.     (set-style-background motion::style (foreground))
  694.   
  695.   To have the selected region appear with an overlayed diagonal stipple
  696.   pattern, try:
  697.   
  698.     (set-style-background motion::style "red")
  699.     (set-style-background-stipple motion::style
  700.       (make-bitmap 4 4 "\167\273\335\356"))
  701.   
  702.   Also note that, if you like, you can just modify the style bound by
  703.   default to motion::style instead of actually creating a new style.
  704.   The style bound to motion::style has default settings as follows:
  705.   
  706.     (set-style-foreground motion::style (foreground))
  707.     (set-style-background motion::style (background))
  708.     (set-style-underline motion::style (foreground))
  709.   
  710.   So, for instance, to get yellow underlining, you could just do:
  711.   
  712.     (set-style-underline motion::style "yellow")
  713.  
  714. *                           === MENUS ===
  715.  
  716. E-1: Does Epoch support popup menus or menubars?
  717.   
  718.   The base Epoch distribution does not have native support for popup
  719.   menus or menubars.  However, there are other ways to use menus with
  720.   Epoch.
  721.   
  722.   METHOD #1:
  723.   
  724.   If you're running the window manager GWM (available via anonymous FTP
  725.   to export.lcs.mit.edu (18.24.0.12) in /contrib/gwm), you can use the
  726.   Epoch contrib 'wm-menu' package (found in the contrib directory in the
  727.   Epoch distribution) to have GWM provide menus that pass messages to
  728.   Epoch.
  729.   
  730.   METHOD #2:
  731.   
  732.   If you're running a window manager that has user-specifiable menus (as
  733.   all of the common window managers do), you can use the xsendevent to
  734.   send events (e.g. keystrokes) to Epoch by activating window
  735.   manager-produced menu entries.
  736.   
  737.   An example menu (in twm format) is as follows:
  738.   
  739.   menu "epoch"
  740.   {
  741.     "Epoch Menu"   f.title
  742.     "Undo"         ! "xse -window ClickWindow 'Ctrl<Key>x' '<Key>u'"
  743.     "Quit"         ! "xse -window ClickWindow 'Ctrl<Key>x' 'Ctrl<Key>c'"
  744.   }
  745.   
  746.   Button3 = c : root : f.menu "epoch"
  747.   
  748.   The epoch menu is activated when Ctrl-Btn3 is pressed on the root
  749.   window.  You theoretically will have to point at an Epoch window and
  750.   click with the left mouse button (after activating a menu entry) for a
  751.   command to take effect.  However, I [Marc] haven't been able to
  752.   actually get the ClickWindow option to work; xsendevent (version 2.0)
  753.   always wants to send the event to the window that contains the
  754.   pointer.  So what I do instead is define a twm titlebutton for the
  755.   epoch menu like so:
  756.   
  757.   menu "epoch"
  758.   {
  759.     "Epoch Menu"   f.title
  760.     "Undo"         ! "xse 'Ctrl<Key>x' '<Key>u'"
  761.     "Quit"         ! "xse 'Ctrl<Key>x' 'Ctrl<Key>c'"
  762.   }
  763.   
  764.   LeftTitleButton "~/epochbitmap.bm" = f.menu "epoch"
  765.   
  766.   ("~/epochbitmap.bm" is a little X bitmap that displays as the button's
  767.   label.)  Now pulling down the menu and activating an entry will send
  768.   the keystrokes to the current window.  This is not an ideal solution,
  769.   since all windows (Epoch or not) in the session will have the menu
  770.   attached to them, but it does work and is quite convenient for use
  771.   with Epoch.
  772.   
  773.   To bind arbitrary commands to menu entries in this manner, you need to
  774.   define a unique keystroke pattern (with global-set-key) for each
  775.   command and then send that keystroke pattern with xsendevent via the
  776.   menu.  See the section on rebind-key (below) for more information on
  777.   this technique.  (Of course, you are also free to have xsendevent send
  778.   a key sequence like 'ESC x u n d o RET' directly to Epoch.)
  779.   
  780.   You can get xsendevent at export.lcs.mit.edu (18.24.0.12) in /contrib
  781.   or at ftp.uu.net (137.39.1.9) in /packages/X/contrib.
  782.   
  783.   [From Philippe Bondono (bondono@vnet.ibm.com).]
  784.   
  785.   METHOD #3:
  786.   
  787.   A completely different technique involves using a separate X client
  788.   that posts a menu and has Epoch (or for that matter, GNU Emacs)
  789.   receive commands from it.  One example of this technique is
  790.   /gnu/emacs/buttons.tar.Z from anonymous FTP to aix370.rrz.uni-koeln.de
  791.   (134.95.132.2).
  792.   
  793.   METHOD #4:
  794.   
  795.   Another method uses xmenu or xmenu2, which are available at any
  796.   comp.sources.x archive.  (If you don't know of such an archive, try
  797.   anonymous FTP to ftp.uu.net (137.39.1.9) in /usenet/comp.sources.x.)
  798.   After you have compiled xmenu or xmenu2, define the following function
  799.   in your .emacs file:
  800.   
  801.   (defun interpret-output (process output)
  802.     (command-execute (car (read-from-string output))))
  803.   
  804.   Then you can define other functions that make specific menus, with
  805.   menu entries bound to commands, like the following example shows:
  806.   
  807.   (defun make-menu ()
  808.     (interactive)
  809.     (set-process-filter (start-process "xmenu" nil
  810.         "/usr/local/bin/xmenu" "-heading" "Epoch Menu"
  811.         "Undo=undo")
  812.       'interpret-output))
  813.   
  814.   This example uses /usr/local/bin/xmenu to post a one-entry menu to the
  815.   screen; the menu entry's label is "Undo" and the action it triggers in
  816.   Epoch is 'undo'.  Specify as many "Label=action" pairs as you like as
  817.   part of the start-process command.
  818.   
  819.   [From Philippe Bondono (bondono@vnet.ibm.com).]
  820.   
  821.   If you use XView/Open Windows, Dev Joneja (dj7@cunixf.cc.columbia.edu)
  822.   has written a menu/button client similar to xmenu; it's available via
  823.   anonymous FTP from ftp.ncsa.uiuc.edu (141.142.20.50) as
  824.   /outgoing/marca/epoch/xvmenu.tar.Z.
  825.   
  826.   Bob Weiner (rsw@cs.brown.edu) says the following concerning menus
  827.   within Hyperbole:
  828.   
  829.   ----------------------------------------------------------------------
  830.   If you use Hyperbole, you know what the Smart Key system is, context
  831.   sensitive key bindings for many Emacs modes and subsystems.  There is
  832.   a Smart Menu system that goes along with this but has not been
  833.   released because it needs some additional menus and some integration
  834.   work.  It is window manager and window system independent, works under
  835.   Emacs, with a slightly customized version that can highlight selected
  836.   menu items and display menus in a separate Epoch screen, and is
  837.   written entirely in Elisp, so no patching is needed.  It provides much
  838.   easier subsystem access for novices and experienced users and has been
  839.   in use at a few sites for the last several years.
  840.   
  841.   I'd like to get it in a form for release but won't have the time for
  842.   several months.  If an experienced Elisp programmer wanted to
  843.   integrate it with Hyperbole and make any other changes, I [Bob, not
  844.   Marc] would be willing to send it out and coordinate on and test the
  845.   final changes.
  846.   ----------------------------------------------------------------------
  847.   
  848.   See the list of FTP sites below for more information on Hyperbole.
  849.  
  850. *                          === KEYBOARD ===
  851.  
  852. F-1: How do I make the backspace key work properly?
  853.   
  854.   This is actually a GNU Emacs question, but it's included in this FAQ
  855.   because it's probably more important to more people than all the
  856.   other questions here.  (One of the great mysteries of GNU Emacs is
  857.   why the backspace key _still_ doesn't do its job.)
  858.   
  859.   Here are four ways to fix this:
  860.   
  861.   METHOD #1:
  862.   
  863.   Put this in your .emacs file:
  864.   
  865.     (rebind-key "BackSpace" nil "\C-?")
  866.   
  867.   This is the cleanest Epoch-specific solution.  It rebinds 
  868.   the X representation for the backspace key directly to that
  869.   of the delete key.
  870.   
  871.   [Thanks to Joe Wells (jbw@bigbird.bu.edu).]
  872.   
  873.   METHOD #2:
  874.   
  875.   Put this in your .emacs file:
  876.   
  877.     (global-set-key "\C-^bdc" 'backward-delete-char-untabify)
  878.     (rebind-key "BackSpace" nil "\C-^bdc")
  879.   
  880.   This rebinds the X representation for the backspace key to the
  881.   appropriate command for deleting a character backward.  Like the
  882.   first method, this is Epoch-specific.
  883.   
  884.   If you don't like to have your backspace key also untabify (i.e.,
  885.   convert tags to spaces on the fly), use this instead of the previous
  886.   global-set-key:
  887.   
  888.     (global-set-key "\C-^bdc" 'backward-delete-char)
  889.   
  890.   METHOD #3:
  891.   
  892.   Put this in your .emacs file:
  893.   
  894.     (global-set-key "\C-h" 'backward-delete-char-untabify)
  895.     (global-set-key "\C-xh" 'help-command) ; override mark-whole-buffer
  896.     
  897.   This makes C-h (the backspace key as well as the Control-h key
  898.   sequence) delete characters backward, and shifts responsibility for
  899.   help to C-x h.  This fix will work for GNU Emacs as well as Epoch.
  900.   
  901.   If you don't like to have your backspace key also untabify (i.e.,
  902.   convert tabs to spaces on the fly), use this instead of the previous
  903.   global-set-key for C-h:
  904.   
  905.     (global-set-key "\C-h" 'backward-delete-char)
  906.   
  907.   METHOD #4:
  908.   
  909.   Outside of Epoch, you can change the X representation of the
  910.   BackSpace key into a Delete by doing this:
  911.   
  912.     xmodmap -e "keysym BackSpace = Delete"
  913.   
  914.   This approach has the disadvantage of not being done inside
  915.   of Epoch for those who prefer customizing lisp code to
  916.   customizing their system environments.
  917.   
  918.   [Thanks to Joe Wells (jbw@bigbird.bu.edu).]
  919.   
  920. F-2: How do I make the keys marked "Page Up" and "Page Down" on an IBM
  921.  Selectric-style keyboard do their jobs?
  922.   
  923.   Using the key rebinding facility discussed below, you can put the
  924.   following two lines in your .emacs file:
  925.   
  926.     (rebind-key "Prior" nil "\M-v") ; Note Prior, not Page Up.
  927.     (rebind-key "Next" nil "\C-v")  ; Note Next, not Page Down.
  928.   
  929.   Similarly, if you want "Home" and "End" to go to the beginning and end
  930.   of the current buffer respectively, do:
  931.   
  932.     (rebind-key "Home" nil "\M-<")
  933.     (rebind-key "End" nil "\M->")
  934.   
  935. F-3: How do I bind keys in the numeric keypad on an IBM Selectric-style
  936.  keyboard to their obvious functions (arrow movement, home, end, etc.)?
  937.   
  938.   Put these lines in your .emacs file:
  939.   
  940.     (rebind-key "KP_Home" nil "\M-<")
  941.     (rebind-key "KP_Up" nil "\C-p")
  942.     (rebind-key "KP_Prior" nil "\M-v")
  943.     (rebind-key "KP_Left" nil "\C-b")
  944.     (rebind-key "KP_Begin" nil "\C-l")
  945.     (rebind-key "KP_Right" nil "\C-f")
  946.     (rebind-key "KP_End" nil "\M->")
  947.     (rebind-key "KP_Down" nil "\C-n")
  948.     (rebind-key "KP_Next" nil "\C-v")
  949.     
  950.   NOTE: This makes the keypad arrow keys work, the keypad PgUp/PgDown
  951.   work, and the keypad Home/End go to the beginning/end of the
  952.   buffer.
  953.   
  954.   Other keys appropriate for rebinding in a Selectric-style numeric
  955.   keypad include KP_Divide, KP_Multiply, KP_Subtract, KP_Add, KP_Enter,
  956.   KP_Insert, and KP_Delete; see below for more details.
  957.   
  958. F-4: What general facilities does Epoch provide for rebinding function
  959.  keys, and how do I use them?
  960.   
  961.   The rebind-key function allows you to rebind any keycode to a new
  962.   string.  An example is probably best to show how this works.  To make
  963.   the key marked "Page Up" (on IBM Selectric-style keyboards) actually
  964.   move the current buffer up a page (like M-v), do:
  965.   
  966.     (rebind-key "Prior" nil "\M-v")
  967.   
  968.   Note that "Prior" is the actual X keysym name for the "Page Up" key;
  969.   to see the X keysym names, refer to /usr/include/X11/keysymdef.h (or
  970.   $OPENWINHOME/include/X11/keysymdef.h on OpenWindows systems).
  971.   (Disregard the leading XK_ in keysymdef.h's definitions for Epoch's
  972.   purposes; thus, X11's "XK_Prior" becomes Epoch's "Prior".  To find out
  973.   which keys are actually active for your keyboard and server, use the
  974.   command "xmodmap -pk".)
  975.   
  976.   The standard function keys are named F1 through F12, the function keys
  977.   on the left side of a Sun-style keyboard are named L1 through L10, and
  978.   so on.  The keypad apparently cannot be addressed by KP_0 through KP_9
  979.   but must be referenced by names like KP_Left, KP_Up, and so on.
  980.   
  981.   A simple two-step approach for binding function keys to commands
  982.   involves binding a key to an arbitrary GNU Emacs key encoding (in the
  983.   following example, C-^ k 1) and then binding that encoding to the
  984.   command.  An example that binds the function key marked "End" to an
  985.   arbitrary command (in this case, end-of-line) follows:
  986.   
  987.     (rebind-key "End" 0 "\C-^k1")
  988.     (global-set-key "\C-^k1" 'end-of-line)
  989.     
  990.   Note that the above is only an example of the two-step method; if you
  991.   really want "End" to do 'end-of-line, do the obvious instead:
  992.   
  993.     (rebind-key "End" 0 "\C-e")
  994.   
  995.   The rebind-key command allows modifiers (e.g. shift, control) to be
  996.   specified; the following example binds Control-"End" to an arbitrary
  997.   command (in this case, end-of-buffer):
  998.   
  999.     (rebind-key "End" 'control "\C-^Ck1")
  1000.     (global-set-key "\C-^Ck1" 'end-of-buffer)
  1001.   
  1002.   For an example of these principles in action, see the file
  1003.   'amc/keys.el' in the 3.2 contrib directory (which is still up for
  1004.   anonymous ftp at cs.uiuc.edu as a separate .tar.Z file) or at
  1005.   ftp.ncsa.uiuc.edu in /outgoing/marca/epoch.
  1006.   
  1007.   [Thanks to Alan Carroll (carroll@cs.uiuc.edu).]
  1008.   
  1009. F-5: I want Epoch to disregard accidental presses of function keys that
  1010.  insert spurious characters (e.g., "-1~") into the buffer.  Does Epoch
  1011.  perchance have some magical way to make this happen?
  1012.   
  1013.   Perchance, Epoch does.  The variable epoch::function-key-mapping, if
  1014.   set to nil, makes Epoch disregard such keys, unless they're explicitly
  1015.   rebound with rebind-key.  You can set this in your .emacs file like
  1016.   so:
  1017.   
  1018.     (setq epoch::function-key-mapping nil)
  1019.   
  1020.   [Thanks to Alan Carroll (carroll@cs.uiuc.edu).]
  1021.   
  1022. F-6: How do I turn the keyboard bell off?
  1023.   
  1024.   The easy answer is to put the following line in your .emacs file:
  1025.   
  1026.     (setq epoch::bell-volume -50)
  1027.   
  1028.   Another possibility, if you like visual bells (i.e., having the
  1029.   entire edit window flash reverse video instead of hearing an audible
  1030.   beep), is to put the following in your .emacs file:
  1031.   
  1032.     (epoch::set-bell t)
  1033.   
  1034.   The malicious answer, for those who, like myself, never want to hear
  1035.   another beep for the rest of time, is to modify src/x11term.c in the
  1036.   Epoch distribution; just change the line that reads:
  1037.   
  1038.     XBell (xs->display,volume);
  1039.   
  1040.   To:
  1041.   
  1042.     /* XBell (xs->display,volume); */
  1043.   
  1044.   Then recompile.
  1045.  
  1046. *                        === HIGHLIGHTING ===
  1047.  
  1048. G-1: How do I highlight regions of text in a buffer with different styles?
  1049.   
  1050.   While the current Epoch distribution contain plenty of support for
  1051.   zones and styles, the enabling mechanisms that make syntax-directed
  1052.   highlighting possible, no intrinsic support for such highlighting is
  1053.   provided.  This situation may change in subsequent releases of Epoch.
  1054.   
  1055.   Three packages that provide varying degrees of support for
  1056.   syntax-directed highlighting are:
  1057.   
  1058.   tek-epoch-stuff-1.1.tar.Z (available from archive.cis.ohio-state.edu
  1059.   or ftp.ncsa.uiuc.edu, see below), which supports comment highlighting
  1060.   in source code as well as support for the Info documentation browser,
  1061.   various mail and news packages, and manual pages.
  1062.   
  1063.   marc-hilite.tar.Z (available from ftp.ncsa.uiuc.edu, see below), which
  1064.   is an extension to tek-epoch-stuff made by Yours Truly to allow
  1065.   per-mode regexp-based highlighting.  Thus, you can have all
  1066.   #define's/#endif's in red, setq's and defun's in green,
  1067.   int/float/double's in yellow, '-->'s in purple, and so on.
  1068.   (A very preliminary version of a reimplementation of marc-hilite,
  1069.   called Lightbrite, can be found here also; it includes partial
  1070.   documentation.  Hopefully Lightbrite proper will be completed
  1071.   sometime this summer.)
  1072.   
  1073.   hilit.el.Z (most recent version was posted to gnu.emacs.souces and is
  1074.   available from ftp.ncsa.uiuc.edu, see below), which provides
  1075.   source-code comment and regexp highlighting.
  1076.   
  1077. G-2: When I use one of the highlighting packages to highlight comments,
  1078.  why doesn't the mouse region selection style always take precedence
  1079.  over the comment style?
  1080.   
  1081.   This question refers to the following: if you highlight all comments
  1082.   in blue and the mouse region selection style is the default
  1083.   (underlining), the comments will be blue and not underlined when they
  1084.   are within the selection zone.
  1085.   
  1086.   For the full technical explanation, refer to the Epoch online info
  1087.   section entitled Epoch->Zones->Zone Plotting.  In short, Epoch has to
  1088.   have some way to decide which style takes precedence for a given
  1089.   character when that character is in two or more zones (since merging
  1090.   styles in that case is neither supported nor particularly logical).
  1091.   
  1092.   Essentially, the algorithm Epoch uses to decide which style is used
  1093.   will only have the 'proper' results (i.e., the underlining will take
  1094.   precedence) if the selected region lies entirely within a comment;
  1095.   the selected area will be underlined and the rest of the comment will
  1096.   be blue.  In a different case, e.g. if the selected region starts
  1097.   before the comment, the comment will be blue and not underlined even
  1098.   though it's selected.
  1099.   
  1100.   Following is a patch devised by Renaud Marlet 
  1101.   (Renaud.Marlet@sophia.inria.fr) that may be useful to people who
  1102.   want to try hacking Epoch's C source to make the drag style always
  1103.   come out on top; as usual, your mileage may vary.  (This patch will
  1104.   work as-is with 4.0b0 or later; if you're still using a 4.0 alpha
  1105.   level you'll have to change "drag-zone" to "drag-button".)
  1106.   
  1107.   -- BEGIN PATCH -----------------------------------------------------
  1108.   *** button.c.old        Sat Mar 28 01:55:11 1992
  1109.   --- button.c    Sat May  9 23:14:19 1992
  1110.   ***************
  1111.   *** 695,700 ****
  1112.   --- 695,709 ----
  1113.       register Lisp_Object buttons, next_b = Qnil;
  1114.       register int first = -1,last = -1;
  1115.     
  1116.   + #if 1
  1117.   +   /* DRAG-BUTTON */
  1118.   +   struct Lisp_Button *drag_button;
  1119.   +   Lisp_Object drag_button_value;
  1120.   +   
  1121.   +   drag_button_value = XSYMBOL(intern("drag-zone"))->value;
  1122.   +   drag_button = XBUTTON(BUTTONP(drag_button_value) ? drag_button_value : Qnil);
  1123.   + #endif
  1124.   + 
  1125.       /* Possible start in list */
  1126.       if (b_first) next_b = *b_first;
  1127.       if (NIL(next_b)) next_b = b->buttons;
  1128.   ***************
  1129.   *** 722,727 ****
  1130.   --- 731,742 ----
  1131.               if (b_end)    *b_end    = last;
  1132.               if (b_return) *b_return = buttons;
  1133.             if (b_first)  *b_first = buttons;
  1134.   +   
  1135.   + #if 1
  1136.   +         /* DRAG-BUTTON */
  1137.   +         if (button == drag_button)
  1138.   +           return button->style;
  1139.   + #endif
  1140.     
  1141.               for (buttons2 = button->next; !NIL(buttons2); buttons2 = button2->next)
  1142.                 {
  1143.   -- END PATCH -------------------------------------------------------
  1144.  
  1145. *               === EPOCH-SPECIFIC ELISP PACKAGES ===
  1146.  
  1147. H-1: Where can I find Epoch-specific elisp packages?
  1148.   
  1149.   Try the following anonymous FTP sites for Epoch-specific elisp
  1150.   packages:
  1151.   
  1152.   aix370.rrz.uni-koeln.de (134.95.132.2)
  1153.     /gnu/emacs
  1154.   
  1155.   archive.cis.ohio-state.edu (128.146.8.52)
  1156.     /pub/gnu/emacs/elisp-archive/elisp
  1157.     [This is main elisp-archive site; it is mirrored at
  1158.      ftp.uu.net (137.39.1.9) in /languages/elisp, among other places.
  1159.      Not much Epoch code exists here; in particular, a much more 
  1160.      recent version of hilit.el.Z is at ftp.ncsa.uiuc.edu, below.]
  1161.   
  1162.   ftp.cs.buffalo.edu (128.205.32.3)
  1163.     /pub
  1164.     [This is the distribution site for the new Dired, which will
  1165.      be included in Emacs v19; it includes support for Epoch.]
  1166.   
  1167.   ftp.ncsa.uiuc.edu (141.142.20.50)
  1168.     /outgoing/marca/epoch
  1169.     [This is Yours Truly's archive of Epoch code; the
  1170.      README file gives an overview of what I consider to be
  1171.      'essential' Epoch packages, and all of those packages
  1172.      are available there.  If I get out of date on any of
  1173.      these and you notice it, please let me know.]
  1174.   
  1175.   icsi-ftp.berkeley.edu (128.32.201.55)
  1176.     /pub/elisp
  1177.   
  1178.   ireq-robot.hydro.qc.ca (131.195.2.130)
  1179.     /pub/emacs/lisp
  1180.     [This is the distribution site for the IMOUSE package.]
  1181.   
  1182.   wilma.cs.brown.edu (128.148.31.66)
  1183.     /pub/hyperbole
  1184.     [This is the distribution site for the Hyperbole hypertext
  1185.      system, which includes support for Epoch.  Also available
  1186.      separately from here is the wrolo 'rolodex' package, one of the
  1187.      components of Hyperbole.]
  1188.   
  1189.   Also see the contrib directory in the actual Epoch distribution.
  1190.   
  1191.   Also watch the gnu.emacs.sources Usenet newsgroup, as well as the
  1192.   epoch newsgroup/mailing list (see below).
  1193.   
  1194.   Please volunteer the names of any sites not on this list.
  1195.   
  1196. H-2: Where can I get a PostScript version of the Epoch manual?
  1197.   
  1198.   Use anonymous ftp to cs.uiuc.edu (128.174.252.1) in 
  1199.   /pub/epoch-files/epoch; get epoch-4.0.epoch-man.ps.Z.
  1200.  
  1201. *                      === OTHER RESOURCES ===
  1202.  
  1203. I-1: What Epoch newsgroups/mailing lists are out there?
  1204.   
  1205.   The Usenet newsgroup gnu.epoch.misc and the mailing list
  1206.   epoch@cs.uiuc.edu are one and the same.  To join the mailing list,
  1207.   send a request to epoch-request@cs.uiuc.edu.  (It is best to read the
  1208.   newsgroup if you have access to it, to save on network resources and
  1209.   the mailing list maintainer's time.)
  1210.   
  1211.   For more general information about Epoch and GNU Emacs, see the list
  1212.   of resources at the start of this file.
  1213.  
  1214. *                     === ADVANCED QUESTIONS ===
  1215.   
  1216.   [NOTE: This section is at the bottom since the questions involve actual
  1217.   source-code hacking or problems with specific machine configurations
  1218.   that Yours Truly cannot personally verify and whose solutions will
  1219.   probably involve some sort of hacking.]
  1220.  
  1221. Z-1: Under tvtwm, when I create a new screen, it is mapped relative to
  1222.  the origin on the virtual desktop, not the window I currently have on
  1223.  the desktop.  How do I fix this?
  1224.   
  1225.   This problem is present in Epoch4.0 beta level 0, although it appears
  1226.   to be fixed as of beta level 1.  The simple solution for beta level 0
  1227.   is to change the line in src/screen.c from
  1228.   
  1229.      size_hints.flags |= (gmask & (XValue|YValue)) ? USPosition : PPosition;
  1230.   to
  1231.      size_hints.flags |= PPosition;
  1232.   
  1233.   And set:
  1234.   
  1235.         UsePPosition "on"
  1236.   
  1237.   in your .twmrc or .tvtwmrc file.
  1238.   
  1239.   [From Philippe Bondono (bondono@vnet.ibm.com).]
  1240.   
  1241. Z-2: Epoch 4.0b1 (or later) (as well as GNU Emacs 18.58) built under
  1242.  HP-UX 8.0 and 8.05 apparently don't recognize the Meta key as Alt.
  1243.  How can this be fixed?
  1244.   
  1245.   Bob Fisher (bob@fisher.depaul.edu) suggests the following command,
  1246.   executed once per session, prior to starting Epoch:
  1247.   
  1248.           xmodmap -e "clear mod1"        \
  1249.                   -e "add mod1 = Meta_R" \
  1250.                   -e "add mod1 = Meta_L"
  1251.   
  1252. Z-3: Why do all of Epoch's colors go away when Epoch is run on an X11R5
  1253.  server with multiple screens?
  1254.   
  1255.   Dana Chee (dana@thumper.bellcore.com) reports that X11R5 has a new
  1256.   SCREEN_RESOURCES property that allows/forces colors to only appear for
  1257.   color screens, but Epoch doesn't look at this property.  This bug
  1258.   will only bite you if you're running on a multi-screen system.  If it
  1259.   happens, there is a workaround; see the xrdb manpage and the xrdb
  1260.   option '-all'.
  1261.   
  1262. Z-4: Even though Epoch 4.0b1 includes fixes to keep the cursor from
  1263.  disappearing (as it does on occasion, especially in a shell, in
  1264.  Epoch 4.0b0), the cursor still disappears sometimes.  Is there a fix
  1265.  for this?
  1266.   
  1267.   First, Epoch 4.0p0 has additional fixes for this problem which
  1268.   presumably will supersede the fix given below.
  1269.   
  1270.   According to Michael Thome (mthome@bbn.com), activating the XFlush
  1271.   code at the end of the CursorToggle routine in 4.0b1's x11term.c seems
  1272.   to fix the problem.  (In other words, '#if 0' on line 737 of x11term.c
  1273.   should be changed to '#if 1'.)
  1274.   
  1275. Z-5: I want Epoch to iconify itself immediately upon starting.  To this
  1276.  end, in my .emacs file I have (epoch::iconify-screen).  But most
  1277.  (~95%) of the time this doesn't work.  How can I make it work all the
  1278.  time?
  1279.   
  1280.   The technical explanation appears to be that the initial Epoch
  1281.   minibuffer and edit screen are unmapped after creation to set some
  1282.   properties for ICCCM purposes and then remapped, and this interferes
  1283.   with the iconification process.
  1284.   
  1285.   One workaround (that may or may not work for you) is to add a sit-for
  1286.   command to your .emacs file right before epoch::iconify-screen; for
  1287.   example:
  1288.   
  1289.     (sit-for 15)
  1290.     (epoch::iconify-screen)
  1291.     
  1292.   [Thanks to Bobby Bodenheimer (bobby@hot.caltech.edu), Simon Kaplan
  1293.   (kaplan@cs.uiuc.edu), and Chris Love (love@cs.uiuc.edu).]
  1294.   
  1295. Z-6: I'm running Epoch on an IBM RISC System/6000 under AIX 3.1 or 3.2
  1296.  and the arrow keys don't work.  How do I fix this?
  1297.   
  1298.   Marc's solution is to hack the Epoch source code; GNU Emacs and Epoch
  1299.   have, for a reason which I have not yet determined, decided to exclude
  1300.   AIX users specifically from those who are entitled to use arrow keys.
  1301.   Go into src/x11term.c and search for 'case KeyPress'.  Shortly
  1302.   thereafter you will see '#ifndef AIX'.  Remove this directive and its
  1303.   corresponding #endif, and the arrow keys will work.
  1304.   
  1305.   It should also be possible (although I have not tried it since I don't
  1306.   use RS/6000's currently) to rebind the arrow keys with rebind-key to
  1307.   C-n/C-p/C-b/C-f without modifying the source code.
  1308.   
  1309. Z-7: Every once in a while Epoch seemingly loses control of the mouse;
  1310.  I can no longer move from window to window or move the cursor within
  1311.  a window with the mouse.  How do I fix this?
  1312.   
  1313.   A temporary fix for this problem is to enter the following elisp code
  1314.   directly into Epoch (via M-x eval-expression):
  1315.   
  1316.     (setq epoch::event-handler 'event::handler)
  1317.   
  1318.   [Thanks to Chris Love (love@cs.uiuc.edu).]
  1319.  
  1320. *                        === CONTRIBUTORS ===
  1321.  
  1322. --> Thanks to the following people for contributing to this FAQ
  1323.     (whether knowingly or not :-) as well as anyone else I may have
  1324.     inadvertently forgotten to list:
  1325.   
  1326.   Bobby Bodenheimer (bobby@hot.caltech.edu)
  1327.   Philippe Bondono (bondono@vnet.ibm.com)
  1328.   Martin Boyer (mboyer@ireq-robot.hydro.qc.ca)
  1329.   Alan Carroll (carroll@cs.uiuc.edu)
  1330.   Nhi Casey (nhi@ariel.aero.org)
  1331.   Dana Chee (dana@thumper.bellcore.com)
  1332.   Alice Chen (alice@innerdoor.austin.ibm.com)
  1333.   Bob Fisher (bob@fisher.depaul.edu)
  1334.   Jerry Graves (jerry@math.ep.utexas.edu)
  1335.   Dev Joneja (dj7@cunixf.cc.columbia.edu)
  1336.   Simon Kaplan (kaplan@cs.uiuc.edu)
  1337.   Tor Lillqvist (tml@tik.vtt.fi)
  1338.   Chris Love (love@cs.uiuc.edu)
  1339.   Simon Marshall (S.Marshall@sequent.cc.hull.ac.uk)
  1340.   Rob McCool (robm@ncsa.uiuc.edu)
  1341.   Michael Thome (mthome@bbn.com)
  1342.   Bob Weiner (rsw@cs.brown.edu)
  1343.   Joe Wells (jbw@bigbird.bu.edu)  
  1344.   
  1345.     Thanks particularly to Jerry Graves for much FAQ work.
  1346.   
  1347.     Thanks also to all the people who have spent time and effort
  1348.     developing Epoch and associated packages.
  1349. ----------------------------------------------------------------------
  1350.