This document is part of the CSG Documentation Tree
Date: 1998 Jul 11 20:42:09
Navigation: home up prev next
Editing CSG-DOC documents while browsing
Each document in the csg-doc collection has an "edit-me" line in the
header and footer. The word "edit" is a hyperlink to this
description, the word "me" is a hyperlink which can make it easy for
you to edit the source document.
Briefly, if you add the line
application/x-editit; /home/csg/bin/editit %s
to your $HOME/.mailcap file (and make sure your browser re-reads it)
then clicking on the link will pop up your favourite editor to edit
the document. After exiting the editor, the source document is
checked back in using RCS (the Revision Control System) and
So, after clinking on "me", making and saving changes, you can just
reload the page to get the new version.
The file that you are given to edit will be called "document" and will
be in a newly created directory in /var/tmp, or where-ever your TMPDIR
variable points. This file will contains a number of sections
deliniated by lines beginning with hyphens. The sections are:
The name of the source document being edited. This can be
changed, which will result in the source file being moved.
This is a place to put an RCS change log entry. Just a brief
description of why you made a change is what is wanted.
When editing a directory, this will contains the contents of
the .conf file for that directory. This file controls
interpretation of the content of the directory to some extent.
This section contains the contents of the .docinfo file. It is
useful for changing title or author or other metadat about the
This section contains the content of the document.
Having all the different parts together makes it easy to have access
to which ever part you want to change, but make it hard for your
editor to help you with edittiing if it knows something about the
particular format of document that you are using. This this mechanism
is particularly useful for plain text documents, which are possibly
the sort which will most often need smallish changes.
A separate mechanism is needed to allow access to a document in a way
which will allow editorial assistance.
There is an RCS tree routed at /home/csg/public_html/source/RCS which
contains revision control information about all documents in the
CSG-DOC collection. The editit program uses RCS to "checkout" files
before editing them, and to "check" them back "in" which finished.
This all happens fairly transparently, but should be remembered as it
means that just diving into the source tree and editting is not a good
The "me" link is actually a link to a cgi script. This script checks
its HTTP_REFERER environment variable to see which page it was called
from, and deduces that name of the source file from that.
It then sends back a file of content-type "application/x-editit" with
the source path name as the first line, and a brief description of
what is going on, incase someone collects the file without having
their .mailcap set properly.
The editit program reads the first line of the file that it is passed
and collects that document and associated files from the CSG-DOC RCS
To determine what editor to use to edit the "document" file, it first
checks the XEDITOR environment variable, and if that is set, it uses
If it isn't set it check the EDITOR environment variable.
If this is set and isn't "emacsclient", then editit runs an xterm with
that editor running in it. If it is "emacsclient", it just runs it
directly as emacsclient doesn't need an xterm.
If no XEDITOR or EDITOR is found, editit runs an xterm with vi as
Navigation: home up prev next
This is /explain/editing in the CSG Documentation Tree
It was generated from the text file /explain/editing
with metadata .ind