Article View: gnu.epoch.misc
Article #1590(none)
From: Marc Andreessen
Date: Wed, 11 Mar 1992 03:16
Date: Wed, 11 Mar 1992 03:16
623 lines
22737 bytes
22737 bytes
Following is the FAQ with a round of error fixes and additions. I won't
post it again for a month or so.
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.
=== MORE REALLY IMPORTANT NOTES ===
In the answers that follow, I assume at least a little familiarity
with GNU Emacs Lisp (elisp).
Many of the answers given herein apply only to Epoch 4.0 (and also may
only apply to 4.0 beta level 0 or later). When I know about them,
3.2'isms are mentioned also.
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.
=== EPOCH AND GNU EMACS ===
--> 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 to 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).
=== CONFIGURING EPOCH ===
--> 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.)
If you have a large amount of Epoch-specific code it may be better to
put it in a separate file (e.g., "epoch-specific.el"), possibly
byte-compile it, then load it from your .emacs file like so:
(if (boundp 'epoch::version) (load "epoch-specific"))
--> What if I want to have separate sections for Epoch 3.2 and 4.0 in
my .emacs file?
The variable 'epoch::version' is a string that contains the current
Epoch version ID. For instance, evaluating epoch::version under
Emacs4.0b0 (the first beta level) gives:
"Epoch 4.0 Beta Patchlevel 0"
A simple way to determine if version 4.x is running is to do something
like this:
(string-match " 4" epoch::version)
This will result in 't' if the string " 4" is a substring of
epoch::version (as would be the case when epoch::version is "Epoch 4.0
..."), and 'nil' otherwise.
--> How can I configure Epoch to support full 8-bit character sets?
The variable 'ctl-arrow', which is a buffer-local variable, controls
how control characters are displayed. By setting this variable to
something non-nil and non-t, you get full 8-bit characters. To get
8-bit characters in all buffers, put this in your .emacs file:
(setq-default ctl-arrow 'foo)
[From Philippe Bondono (bondono@vnet.ibm.com).]
=== WINDOWS ===
--> 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
(These techniques only work in Epoch 4.0 and later.)
--> 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.)
There are also X resources for the screen and minibuffer cursor
glyphs; equivalent to the above elisp code would be the following (in
your .Xdefaults file):
epoch.screen.cursor.glyph: 68
epoch.minibuf.cursor.glyph: 68
For either of these approaches, 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.
(See below for details on how to customize the cursor glyph based on
the mode of a screen's initial buffer.)
--> 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 do I iconify my entire Epoch session at once?
By default, 'C-z i' is bound to iconify-screen, which only iconifies
the current edit window. To iconify everything, define a small
function iconify-everything in your .emacs file like so:
(defun iconify-everything ()
"Iconify entire Epoch session at once."
(interactive)
(dolist (s (screen-list))
(iconify-screen s))
(iconify-screen 0)
)
Then bind it to a key sequence (e.g. 'C-z C-i') like so:
(global-set-key "\C-z\C-i" 'iconify-everything)
--> 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.
=== COLORS AND FONTS ===
--> I want to be able to interactively select my foreground color.
How do I do this?
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
this?
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*"
The standard X client 'xlsfonts' will give you a list of the fonts
registered with your X server. The standard X client 'xfontsel' lets
you interactively put together an X font specification based on
attributes (e.g., family, size).
--> 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 technicolor 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 selected 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"))
Also note that, if you like, you can just modify the style bound by
default to motion::style instead of actually creating a new style.
The style bound to motion::style has default settings as follows:
(set-style-foreground motion::style (foreground))
(set-style-background motion::style (background))
(set-style-underline motion::style (foreground))
So, for instance, to get yellow underlining, you could just do:
(set-style-underline motion::style "yellow")
=== MENUS ===
--> Does Epoch support popup menus or menubars?
The base Epoch distribution does not support popup menus or menubars
If you're running the window manager GWM (available via anonymous FTP
to export.lcs.mit.edu (18.24.0.12) in /contrib), you can use the Epoch
contrib 'wm-menu' package (found in the contrib directory in the Epoch
distribution) to have GWM provide menus that pass messages to Epoch.
Unanswered question: Can this be done with any window manager other
than GWM?
You can also run a separate X client that posts a menu and have Epoch
(or for that matter, GNU Emacs) receive commands from it. For an
example of this, see /gnu/emacs/buttons.tar.Z by anonymous FTP to
aix370.rrz.uni-koeln.de (134.95.132.2). [From Philippe Bondono
(bondono@vnet.ibm.com).]
=== HIGHLIGHTING ===
--> 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.
=== EPOCH-SPECIFIC ELISP PACKAGES ===
--> 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 available
separately from here is the wrolo 'rolodex' package, one of the
components of Hyperbole.]
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).
=== OTHER RESOURCES ===
--> 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.
=== ADVANCED QUESTIONS ===
[This section is at the bottom since the questions involve actual
source-code hacking or something equally daring.]
--> Under tvtwm, when I create a new screen, it is mapped relative to
the origin on the virtual desktop, not the window I currently have on
the desktop. How do I fix this?
This problem is present in Epoch4.0 beta level 0, although it appears
to be fixed (???) in beta level 1. The simple solution for beta level
0 is to change the line in src/screen.c from
size_hints.flags |= (gmask & (XValue|YValue)) ? USPosition : PPosition;
to
size_hints.flags |= PPosition;
And set:
UsePPosition "on"
in your .twmrc or .tvtwmrc file.
[From Philippe Bondono (bondono@vnet.ibm.com).]
------------------------------------------------------------------------------
Thanks to the following people for contributing to this FAQ:
Alan Carroll (carroll@cs.uiuc.edu)
Simon Marshall (S.Marshall@sequent.cc.hull.ac.uk)
Philippe Bondono (bondono@vnet.ibm.com)
Bob Weiner (rsw@cs.brown.edu)
Thanks also to all the people who have spent time and effort
developing Epoch and associated packages.
------------------------------------------------------------------------------
------------------------------------------------------------------------------
QUESTIONS WITHOUT ANSWERS (yet):
--> How does I rebind various function/keypad keys in Epoch?
Differences from standard GNU Emacs and GNU Emacs under SunView?
One lead is the file 'amc/keys.el' in the 3.2 contrib directory (which
is still up for anonymous ftp at cs.uiuc.edu). (Thanks to Alan
Carroll and Philippe Bondono.) What exactly is the 'right' thing to
do as far as this goes?
--> Window manager menus with any window manager other than GWM?
Be the first person on your block to volunteer answers; send to
marca@ncsa.uiuc.edu.
------------------------------------------------------------------------------
Technical Details
Message-ID:
<9203110316.AA20364@xongmao.ncsa.uiuc.edu>Path:
arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!ncsa.uiuc.edu!marcaShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fc7ee,711224b9b1d178db,start X-Google-Attributes: gidfc7ee,public X-Google-ArrivalTime: 1992-03-10 21:59:45 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: (none) Message-ID: <9203110316.AA20364@xongmao.ncsa.uiuc.edu> Sender: daemon@cis.ohio-state.edu Organization: GNUs Not Usenet Distribution: gnu Date: Wed, 11 Mar 1992 03:16:00 GMT Lines: 623