🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.epoch.misc
Article #1587

Epoch FAQ

#1587
From: Marc Andreessen
Date: Sun, 08 Mar 1992 15:02
449 lines
16630 bytes
An initial version of an Epoch FAQ follows; please send corrections or
additions to marca@ncsa.uiuc.edu.

Thanks,
Marc

--
Marc Andreessen
Software Tools Group
National Center for Supercomputing Applications
marca@ncsa.uiuc.edu

------------------------------------------------------------------------------
--> Epoch Frequently Asked Questions
      (or at least Occasionally Wondered-About Questions)
    Maintained by Marc Andreessen (marca@ncsa.uiuc.edu)

REALLY IMPORTANT NOTE:

Unless otherwise attributed, information below is based only on my use
and experience with Epoch and is by no means guaranteed to be correct,
complete, or even coherent.  If it works for you, great; if it
doesn't, let me know, but there are no guarantees.

ANOTHER REALLY IMPORTANT NOTE:

Additions or corrections to the questions and answers herein are very
welcome; send mail to marca@ncsa.uiuc.edu.

The latest version of this file will be available via anonymous FTP to
ftp.ncsa.uiuc.edu (141.142.20.50) as /outgoing/marca/Epoch.FAQ.

QUESTIONS AND ANSWERS:

-->  What is Epoch?

Epoch is an adaptation of GNU Emacs with lots of additional support
for features made possible by the X11 windowing system.  These
features include multiple editing windows, arbitrary colors and fonts
(fixed-width and proportional), and selectable zones per buffer with
arbitrary display styles (font, color, underline, stipple).

Epoch, like GNU Emacs, is very customizable; much of this FAQ
describes ways to customize Epoch for specific purposes.

--> What is the latest version of Epoch?

The latest version is 4.0 beta version 1.  Previous versions still in
use by some people include the 4.0 alpha levels and beta version 0,
and version 3.2.

Epoch 4.0b1 is based on GNU Emacs 18.58, which is the most recent
version of GNU Emacs.

--> How can I get Epoch?

Epoch is available via anonymous FTP to cs.uiuc.edu (128.174.252.1) in
pub/epoch-files/epoch.  The main file of interest is
epoch-4.0b1.tar.Z.

According to Simon Marshall (S.Marshall@sequent.cc.hull.ac.uk):

Like GNU & X11 stuff, epoch is available in the UK from
uk.ac.ic.doc.src (00000510200001).  You can log on - there's help to
tell you the different ways of getting source.  Epoch is in
/gnu/epoch/.

--> What's the difference between Epoch and GNU Emacs version 19?

To quote directly from the GNU 'status' file (obtained via anonymous
FTP to prep.ai.mit.edu (18.71.0.38) as /pub/gnu/status):

------------------------------------------------------------------------------
Emacs 18 maintenance continues for simple bug fixes.  Version 19
approaches release, counting among its new features before and after
change hooks, source-level debugging of Emacs Lisp programs, X
selection processing, including CLIPBOARD selections, scrollbars,
support for European character sets, floating point numbers,
per-buffer mouse commands, interfacing with the X resource manager,
mouse-tracking, lisp-level binding of function keys, and multiple X
windows (`screens' to emacs).

Thanks go the Alan Carroll and the people who worked on Epoch for
generating initial feedback to a multi-windowed emacs.  Emacs 19
supports two styles of multiple windows, one with a separate screen
for the minibuffer, and another with a minibuffer attached to each
screen.

A couple of other features of Version 19 are buffer allocation, which
uses a new mechanism capable of returning storage to the system when a
buffer is killed, and a new input system--all input now arrives in the
form of Lisp objects.

Other features under consideration for later releases of Version 19
include:

** Associating property lists with regions of text in a buffer.
** Multiple font, color, and pixmaps defined by those properties.
** Different visibility conditions for the regions, and for various
   windows showing one buffer.
** Hooks to be run if point or mouse moves outside a certain range.
** Incrementally saving undo history in a file, so that recover-file
   also reinstalls buffer's undo history.
** Static menu bars, and better pop-up menus.
------------------------------------------------------------------------------

Epoch currently supports much of the new functionality of GNU Emacs
v19, including some features that apparently won't be immediately
available in GNU Emacs v19 (notably, associating property lists with
regions of text, and multiple fonts/colors/pixmaps defined by those
properties).

--> How can my .emacs file deal with both GNU Emacs and Epoch?

An easy way to handle both GNU Emacs and Epoch within the same .emacs
file is to define a variable 'running-epoch' as follows:

(defvar running-epoch (boundp 'epoch::version))

Then, the rest of your .emacs file can look liks this:

(if running-epoch
  (progn
    ... [Epoch-specific code here] ...
))

...[Emacs code here]...

(After this, when I refer to 'your .emacs file', read that as 'the
Epoch-specific portion of your .emacs file', under the assumption that
you have both general and Epoch-specific parts as detailed above.)

--> How do I get the minibuffer back at the bottom of my edit window.

Start Epoch with the command-line option '-nm'.  Alternately, in your
general .Xdefaults file, specify:

epoch.nonlocal.minibuf: False

--> How do I stop the windows from automatically raising upon entry?

The easiest way to do this, if you're running Epoch 4.0 beta (versions
0 or 1), is to specify the following in your .emacs file:

(setq auto-raise-screen 'minibuf)

If you're running a version of Epoch prior to Epoch-4.0b0, the
following code also works:

(setq auto-raise-screen nil)
(push (function (lambda () (raise-screen (minibuf-screen)))) 
  *select-screen-hook*)

Both of the above solutions still make the minibuffer raise when an
Epoch edit window is entered; if you don't want the minibuffer to
raise itself either, just do the following instead:

(setq auto-raise-screen nil)

--> How do I change the cursor?

Another noticeable change from GNU Emacs is the cursor glyph (which is
a pencil shape).  To change this to a more normal-appearing arrow
shape, put this in your .emacs file:

(cursor-glyph 68)
(cursor-glyph 68 (epoch::minibuf-screen))
(push '(cursor-glyph . 68) epoch::screen-properties)

(Note that you can specify a different cursor glyph for the
minibuffer, if you like.)

Any valid cursor ID number will do; to see the available cursors and
their ID numbers, take a look at the file /usr/include/X11/cursorfont.h.

--> I want to be able to interactively select my foreground color.
How do I do this interactively?

First, define a style for each of your desired foreground colors in
your .emacs file, like so:

(setq red-style (make-style))
(set-style-foreground red-style "red")

Then, define a short command 'goto-style' like so:

(defun goto-style (newstyle)
  "Set current buffer to a given font NEWSTYLE."
  (setq buffer-style newstyle)
  (redraw-display))

Next, bind commands to keys like so:

(global-set-key "\C-c1" (definteractive (goto-style red-style)))

This binds a command that changes the current foreground color to red
to the key sequence C-c 1.

--> I want to be able to switch fonts interactively; how do I do it?

To change fonts, you don't have to define new styles.  Just define a
short command 'goto-font', like so:

(defun goto-font (newfont)
  "Set current buffer to a given font NEWFONT."
  (font newfont)
  (redraw-display))

Then, bind commands to keys like so:

(global-set-key "\C-c1" (definteractive (goto-font "8x13")))

This changes the current edit window's font to "8x13" when the key
sequence 'C-c 1' is entered.

If the font you specify isn't valid for your X server (i.e. if the
font doesn't exist in a directory listed in your X server's font path
and in that directory's fonts.dir file), you will get this message in
your minibuffer:
 
Bad font name

Font names are ordinary X font names; for example, a
middle-of-the-road Helvetica font can be referred to as:

"helvetica-medium-r-normal--14*"

--> How do I define edit screen attributes on a per-mode basis?  Or,
how do I make my C++ edit windows come up with 48 lines and a big
round dot for a cursor?

You can define styles for new edit screens created with
find-file-other-screen (which is, by default, bound to 'C-z 4 C-f' and
'C-z 4 f') based on the initial buffer's mode like so:

(setq epoch-mode-alist
  (append (list
      (cons 'c-mode
        (list
          (cons 'geometry "80x52")
          (cons 'cursor-glyph 94)))
      (cons 'LaTeX-mode
        (list
          (cons 'geometry "90x48")
          (cons 'cursor-glyph 58)))
      (cons 'c++-mode
        (list
          (cons 'geometry "80x48")
          (cons 'cursor-glyph 38))))
    epoch-mode-alist))

--> How can I associate a certain foreground color with a given file,
so every time I load that file my foreground color is automatically
set?

You can easily do this by using GNU Emacs' ability to handle file
variables.  For example, if you have defined style 'red-style' to
specify a red foreground color, and want file 'foobar.c' to always
have the foreground color red, add this to the bottom of 'foobar.c':

^L
/*
Local Variables:
buffer-style: red-style
End:
*/

(Note that '^L' is a newline character; you can enter one in an edit
buffer by typing 'C-q C-l'.)

Then, whenever 'foobar.c' is loaded, the variable 'buffer-style' will
be set to 'red-style', and as a result the foreground color for that
buffer will be red.

--> How do I design my own really funky modeline?

Using the tried-and-true Learning By Example(tm) educational method,
I'll just give the elisp code I use to define my own customized
modeline:

;; Define styles for the modeline.
(setq cyan-style (make-style))
(set-style-foreground cyan-style "#6fcfef")
(setq red-style (make-style))
(set-style-foreground red-style "red")
(setq yellow-style (make-style))
(set-style-foreground yellow-style "yellow")

;; Make display-time display day and date also.
(setq display-time-day-and-date t)

;; Display time, day, and date in modeline.
(display-time)

;; List full filename, with path.
(set-default 'mode-line-buffer-identification
	     '(buffer-file-name ("%f") ("%b")))

;; This actually turns inverse-video _off_ for the modeline.
(setq mode-line-inverse-video t)

;; Set the modeline itself.
(setq default-mode-line-format
  (list red-style "--" 
        ;; Buffer name.
        yellow-style 'mode-line-buffer-identification 
        red-style "-" 
        ;; Buffer status (read-only, unchanged, changed).
        cyan-style "%*%*" 
        red-style "-" 
        ;; Position in buffer.
        cyan-style "%[%3p%]" 
        red-style "--"  
        ;; Current time.
        yellow-style "%M" 
        red-style "--("
        ;; Mode name.
        cyan-style 'mode-name 'minor-mode-alist "%n"
          'mode-line-process 
        red-style ")-%-"))

--> How do I replace the mouse region selection underlining with a
different style?

You can override the variable 'motion::style' with your own style,
like so:

(setq motion::style (make-style))

Now, you can set the various elements of this style as you please.
Several examples follow.

To have just the text foreground color change on mouse selection, do:

(set-style-foreground motion::style "yellow")
(set-style-background motion::style (background))

(Replace "yellow" with any desired X color name.)

To have the selected region appear as reverse video, try:

(set-style-foreground motion::style (background))
(set-style-foreground motion::style (foreground))

To have the slected region appear with an overlayed diagonal stipple
pattern, try:

(set-style-background motion::style "red")
(set-style-background-stipple motion::style
  (make-bitmap 4 4 "\167\273\335\356"))

--> How do I highlight regions of text in a buffer with different
styles?

While the current Epoch distribution contain plenty of support for
zones and styles, the enabling mechanisms that make syntax-directed
highlighting possible, no intrinsic support for such highlighting is
provided.

Three packages that provide varying degrees of support for
syntax-directed highlighting are:

tek-epoch-stuff-1.1.tar.Z (available from archive.cis.ohio-state.edu
or ftp.ncsa.uiuc.edu, see below), which supports comment highlighting
in source code as well as support for the Info documentation browser,
various mail and news packages, and manual pages.

marc-hilite.tar.Z (available from ftp.ncsa.uiuc.edu, see below), which
is an extension to tek-epoch-stuff made by Yours Truly to allow
per-mode regexp-based highlighting.  Thus, you can have all
#define's/#endif's in red, setq's and defun's in green,
int/float/double's in yellow, '-->'s in purple, and so on.

hilit.el.Z (most recent version was posted to gnu.emacs.souces and is
avialable from ftp.ncsa.uiuc.edu, see below), which provides
source-code comment and regexp highlighting.
 
--> My workstation's screen area is overwhelmed by all the windows I
create in my Epoch editing sessions.  How can I squeeze more windows
into my working environment?

This is only a half-facetious question; there's only room on most
workstation screens (usually 1024x768 or 1280x1024 pixels in area) for
a couple of windows with decent-sized fonts.  To help alleviate the
discomfort, try the 'tvtwm' window manager.  (I sound like a
cough-drop commercial.)

Tvtwm, a superset of the twm window manager, allows windows to be
placed on a virtual root window that can be of any size (for example,
3000x3000 pixels).  This virtual root can be navigated via tvtwm's
'panner', a reduced-size overview of your entire environment.

Tvtwm can be found on your local comp.sources.x archive or in the
X11R4 and X11R5 distributions.  Try anonymous FTP to ftp.uu.net
(137.39.1.9) in /usenet/comp.sources.x.

--> Where can I find Epoch-specific elisp packages are available?

Try the following anonymous FTP sites for Epoch-specific elisp
packages:

archive.cis.ohio-state.edu (128.146.8.52)
  /pub/gnu/emacs/elisp-archive/elisp
  [This is main elisp-archive site; it is mirrored at
   ftp.uu.net (137.39.1.9) in /languages/elisp, among other places.]

ftp.ncsa.uiuc.edu (141.142.20.50)
  /outgoing/marca
  [This is Yours Truly's depository of Epoch code; the
   README file gives an overview of what I consider to be
   'essential' Epoch packages, and all of those packages
   are available there.]

ireq-robot.hydro.qc.ca (131.195.2.130)
  /pub/emacs/lisp
  [This is the distribution site for the IMOUSE package.]

icsi-ftp.berkeley.edu (128.32.201.55)
  /pub/elisp

ftp.cs.buffalo.edu (128.205.32.3)
  /pub
  [This is the distribution site for the new Dired, which will
   be included in Emacs v19; it includes support for Epoch.]

wilma.cs.brown.edu (128.148.31.66)
  /pub/hyperbole
  [This is the distribution site for the Hyperbole hypertext
   system, which includes support for Epoch.  Also distributed
   from here is the wrolo 'rolodex' package, a Hyperbole add-on.]

Also see the contrib directory in the actual Epoch distribution.

Also watch the gnu.emacs.sources Usenet newsgroup, as well as the
epoch and epoch-design mailing lists (see below).

--> What Epoch newsgroups/mailing lists are out there?

The Usenet newsgroup gnu.epoch.misc and the mailing list
epoch@cs.uiuc.edu are one and the same.  To join the mailing list,
send a request to epoch-request@cs.uiuc.edu.

If you're interested in the nuts and bolts of Epoch, you can join the
epoch-design mailing list by sending a request to
epoch-design-request@cs.uiuc.edu.  An archive of the epoch-design
mailing list is available at cs.uiuc.edu (128.174.252.1) as
/pub/epoch-files/mailinglist.

------------------------------------------------------------------------------
Technical Details
Message-ID: <9203090702.AA01733@dogfight.ncsa.uiuc.edu.ncsa.uiuc.edu>
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!ncsa.uiuc.edu!marca

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: fc7ee,4e2d100cb1082f1e,start
X-Google-Attributes: gidfc7ee,public
X-Google-ArrivalTime: 1992-03-08 21:13:11 PST
Newsgroups: gnu.epoch.misc
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!ncsa.uiuc.edu!marca
From: marca@ncsa.uiuc.edu (Marc Andreessen)
Subject: Epoch FAQ
Message-ID: <9203090702.AA01733@dogfight.ncsa.uiuc.edu.ncsa.uiuc.edu>
Sender: daemon@cis.ohio-state.edu
Organization: GNUs Not Usenet
Distribution: gnu
Date: Sun, 8 Mar 1992 15:02:25 GMT
Lines: 450