A User's Manual for GNU Emacs' Web-mode Mark Motl & Bart Childs Department of Computer Science TEXas A&M University Revision 3.0October 5, 1998
Summary This is a user's manual for Web-mode, an Emacs mode for the WEB style of Literate Programming. This style of programming was introduced by Don Knuth when he wrote TEX82. The most recent changes include: mouse support, pull down menus, hilit usage, and completion in a number of cases that signi cantly reduce the needed typing. The current versions have the menu and color/hilit codes integrated. We are using Web-mode with Gnu Emacs versions 19.xx on a wide array of computers. We use it on PC class machines that are based on 386 and newer systems and various unix systems. To our knowledge, we do not know of a Macintosh with a full function Emacs that supports ELisp, the version of Lisp that extensions to Emacs are written in. Use, enjoy, and let us know of constructive criticisms. We hope to x errors quickly and will make evolutionary changes only with deliberation. Edsger Dijkstra once said \if you want to make a user interface more dicult to use, add functionality to it." Change for the sake of change is not planned.
Contents
1 Introduction 2 Installation 3 Using Web-mode 4 Book Terminology and Automatic Happenings 5 Movement Within the WEB 6 Movement Among the Buffers 7 Inserting a Section Name 8 Additional Navigation Means 9 Support for Change Files 10 Outline Mode 11 Miscellaneous Functions 12 Web-mode Menus 13 Using Color Within web-mode 14 An Example 15 A Final Note 16 References A Adding Functionality to web-mode B Basic Information Like Variables, etc. C Changes To The WEB Processors D Debugging, Hopefully E Elementary .emacs F Frequently Asked Questions, (FAQ) G Glossary H Help for web-mode I Index
2
3 4 5 6 7 8 9 11 14 15 16 17 28 31 32 32 34 35 36 37 38 39 40 42 42
1 Introduction This document is a companion to web-modeX.el, a collection of GNU Emacs Lisp functions designed to customize GNU Emacs so that it is sensitive to a WEB document. It is assumed that the reader is already familiar with the WEB style of literate programming, the general format of a WEB source, and the rules of WEB, FWEB, CWEB, or a similar one. The intent in the design of web-mode is sensitivity to WEB independent of the high level language. Thus, it works with Knuth's original WEB with Pascal, CWEB, FWEB, and some similar systems. The basic Emacs functionality is maintained along with showing matched delimiters and continuing indentation. The functions that web-mode provides include:
the indices of variables and sections provided by weave, outline editing, navigation by chapter and section, preloading the search string when using indices, and automatic completion in some places.
Most of these commands have convenient key-bindings or can be invoked by the use of function keys and pull-down menus. The soures of this should be accompanied by a le template.tex which can be used to make a convenient overlay for function key usage. Throughout this document, I will use the symbology used by Emacs. For example, the find-file command can be entered two dierent ways C-x C-f
M-x find-file
The rst way of entering the command is to actually type the command as shown above. Press the META key (on some terminals this may be the ESC key); next press the x key; nally, enter the characters find-file followed by a carriage return. An alternate way of issuing this command is to use its associated keybinding as shown in the box to the right of the command above. In this keybinding C- refers to the CTRL key. Press and hold down the CTRL key and then press the x key followed by holding down the CTRL key and then pressing the f key. For all commands mentioned throughout this manual, both forms of invoking the command will be shown if they exist. Some commands, such as M-x what-line
do not have a keybinding and hence must be entered by typing in the command name. All commands that are WEB extensions have been pre xed with \web-". The outline mode commands violate this, but the names were not changed because they were adapted from an existing mode.
3
2 Installation The installation instructions are really quite simple. To simplify this manual we will assume that these instructions are followed. The les web-modeX.el, .emacs, limboL.sty, and limboL.material are required. The .emacs le is the version normally used at Texas A&M and should be adapted to your site(s). If we have done our work correctly, it is the only le you have to edit for each user. There are a number of alternative versions of some of the lines that you may have to edit (commented out of course.) Notice that we use web-modeX.el. The X is in honor of X-windows. The current versions of emacs for Windows-NT and '95 have good support of windowing, pull-down menus, mice, . . . The web-mode.el is still there for version 19 without windowing, it is not supported. Notice that there are two sets of les that have the limbo in the name. The les limboL.material and limboL.sty are associated with the use of LATEX. I do almost all my work using FWEB since it supports the C's and Fortran`s for real work. John Krommes' FWEB has excellent support of LATEX and that is now my default system. Please note the usage of the les fweb.sty, .fweb, and fwebnum.sty. 1. Select a directory for the home of these les which can be shared by all users, say: /usr/local/lib/web. Place limboL.sty in that directory. Place web-modeX.el in the standard place for emacs lisp codes. It is recommended that you use that site-lisp standard directory because then the path does not have to be coded in the .emacs le. Issue the following command from within emacs:
M-x byte-compile-file
The user will be prompted for the name of the le. Respond with web-modeX.el. This will create a new le named web-modeX.elc. (This can no longer be done in batch mode because while compiling it will check on some windows functions that are not available in batch.) Now, make sure that everybody can read and execute the les you have in this directory. Everybody with an appropriate .emacs le in their home directory will automatically be able to use web-mode with their les ending in .web or .w You may have to make some changes as detailed in Appendix E. Appendix E contains changes that are typical `installation setups.' 2. Take BC.emacs, rename it .emacs and place it in your root directory (probably incorporate it into your current version of the same le.) The editing of the .emacs le re ects the name of the directory and some personal preferences. Appendix E is a more detailed description of this le and changes you can make. 3. Each user should select a directory to put some common styles, . . . The les that should go in this directory should be fweb.sty and limboL.material as a minimum. The user may also wish to personalize the limboL.sty le and hard code it into the limboL.material. This is not recommended unless the user never shares work.
4
3 Using Web-mode One purpose of web-mode is to assist in creating and editing WEBs. Another is to edit existing s that may or may not have been created using web-mode.
WEB
3.1 Creating a New WEB If a WEB is being created, Emacs will need to be started with an empty le. For example, if the name of the new WEB is my.web, you would enter the UNIX command % emacs my.web
The defaults set in the le .emacs will specify which le to use a the default outline of the WEB you are creating. I normally use limboL.material, but in some cases I use (with Pascal) limbo.material. You can modify the .emacs startup le to personalize this. The user is prompted for the title of the WEB. This is not intended to be the name of the le, but a better name like, say the title of a book about the program being written. The command invoking the editor showed an assumption that we feel should be honored. We recommend that the names of WEB's end with .web. We also allow the use of the extension .w because that is how CWEB is distributed, but doesn't that seem \illiterate?" We recommend endings like .hweb for included les. We (assume you are using @i commands available in CWEB and FWEB). It seems more literate! These are not available in the original .web because of the Pascal standard(?) of 1980.
3.2 Editing an Existing WEB If you wish to use web-mode on an existing WEB, say primes.web, you would begin by invoking Emacs with the UNIX command % emacs primes.web
When the function web-mode is executed, it will perform some initialization of various data structures. A list of the section names is collected. If web-mode detects that a section name has been used but never de ned, a \stub" section may be inserted at the end of the chapter in which it was rst used (see Appendix E). A stub section is like: @ @^Stub@> @= Web-mode also reads the CHange le that accompanies the WEB currently there is no CHange le, one is created; however, this le is \saved" only if it
5
being edited. If is modi ed.
4 Book Terminology and Automatic Happenings The user should understand that we are using a `book model' for a WEB. The basic element of a WEB is a section which is roughly parallel to a paragraph in a book. The `major sections' or group of sections corresponds to a chapter in a book. Chapter titles will be in the table of contents. We have an extension of the book model in that many sections will have `names' that will appear in an index. Technical books may have subjects of paragraphs in an index. Sections are really more like \pairs of paragraphs." Each section may have documentation, de nitions, and code (must have at least one or it would be trivial.) There are several functions in web-mode that are invoked automatically whenever a particular key is pressed. These functions include: web-AT-sign-processing is invoked whenever the @ key
which is pressed. The function checks to see if the @ is at the beginning of a line. If it is, the next character is read. If this next character is either a space, newline, tab, or asterisk, then the @ in combination with the next character constitutes the beginning of a new section. Another useful function that is invoked automatically is web-newline
which is invoked whenever the newline character is pressed. This function positions point so that the next line has the same indentation as the current line that is being terminated. This will be almost invisible to the user, except for the results. By default, web-mode maintains a journal le. This le contains the user's name, the name of the le being edited, the start and stop times of the editing session, total time in web-mode, and a count of each of the interactive web-mode functions invoked during the editing session. The collection of this le is governed by the Boolean variable web-journal-on which is set to t (true). This can be turned o by changing a line in .emacs to (setq web-journal-on nil). The default of creating \stubs" was done to keep the weave and tangle processors from generating warning/error messages for the neophyte users. This is easily supressed by the obvious editing of the .emacs le, look for \stub". There are many other functions of web-mode that are invoked by key sequences, function keys, and/or pull-down menus.
6
5 Movement Within the WEB The user can goto any section or chapter at any time by issuing either: M-x web-goto-section
C-c g s
S-f1
M-x web-goto-chapter
C-c g c
C-f1
respectively. The user is then prompted for the section or chapter number. Invalid section numbers are useful too. If the user enters zero or a negative section number, then the current section is displayed with its rst line at the top of the screen. If a section number larger than the number of sections is input, then the last section is selected. Sections are always displayed with point moving to the beginning of that section or chapter in the WEB. The command can also be entered with a numeric argument pre x which some experienced Emacs users may wish to use. If the change le has an entry for the destination section, a message is printed in the minibuer stating that the destination section has been edited. (See the section on \Support for CHange Files.) The user can also goto the next or previous section or chapter by entering the commands: M-x web-next-section
C-c n s
S-f2
M-x web-previous-section
C-c p s
S-f3
M-x web-next-chapter
C-c n c
C-f2
M-x web-previous-chapter
C-c p c
C-f4
If there is no next or previous section (or chapter), an appropriate message is displayed in the minibuer; otherwise, point moves to the beginning of the next or previous section (or chapter), appropriately. The user can determine the section or chapter (number) that point is positioned within by the commands M-x web-which-section
C-c w s
S-f4
M-x web-which-chapter
C-c w c
C-f4
Also, see the section on \Support for CHange Files." are
Two additional functions are often used with the other commands in this section. They M-x web-count-sections
C-c # s
M-x web-count-chapters
C-c # c
display in the minibuer the total number of sections/chapters in the WEB document that is currently being edited.
These commands are available in the pull-down \navigate" menus. 7
6 Movement Among the Buffers Several commands facilitate movement among the buers that are active in editing the WEB document. These commands work from the WEB le, CHange le, include les, and buers containing indices. When these commands are executed, the position of point in that buer will be its position during the last visit. If that buer exists and has not been visited, then point will be at the rst character in the buer. The user can switch to the buer containing the CHange le by issuing the command M-x web-goto-buffer-change-file
C-c b c
S-f8
Similarly, the user can switch to the buer containing the WEB le at any time with the command M-x web-goto-buffer-web-file
The user can switch to any of the include les with the command M-x web-goto-buffer-include-file
C-c b w
S-f6
C-c b i
S-f7
This command takes a numeric argument. For example, giving the function an argument of 1 would cause the buer containing the contents of the rst include le command (@i) encountered in the CWEB to become the current buer. Unfortunately, web-mode can be confusing as to which buer you want. In particular, if there are multiple includes, how does one know which one to go to? Fortunately a solution is provided via the command: C-x C-b
M-x buffer-menu
When invoked, this command opens a window containing a list comprised of the following les: the WEB le, the CHange le, and the include les. The user types the command `C-x o' to change the point to the window with the list of les. Then, the user uses the next (and previous) line command to place the point of the desired buer ( le). The user enters an `f' to nd that le. The user may wish to execute the command `C-x 1' to return to a single window. Experienced users of Emacs may know that several other buers will be visible as well. The information kept for using the index of variables and index of section names are buers and that the user may have a number of other buers active too.
These commands are available in the pull-down \Buer" menus. 8
7 Inserting a Section Name Whenever the < key is pressed in the WEB buer, the function web-insert-section-name is invoked. This function must determine whether this is the beginning of a section name or not. The function examines the preceding characters. If an odd number of @'s immediately precede the , are matched. If the delimiters do not match properly, a
descriptive message is printed in a temporary buer. Web-mode also makes it easier to enter M-x web-insert-index-entry
index entries. When the function
is issued, the user is prompted for two things:
C-c i i
1. The type of font to be used (Roman, typewriter, or user-de ned). This determines the opening delimiter to the index entry (either @^, @., or @:) and 2. The text of the index entry. The complete index entry is then placed on a new line in the WEB le (buer). The command
C-c r s
M-x web-rename-section
allows the user to rename a section. Point should be positioned on the name that the user wishes to rename. The user is prompted for the new name. The user is then given the option of renaming only that occurrence, all occurrences, or is queried if each of the remaining occurrences should be renamed. The command
M-x web-goto-section-of-point-other-window
is useful if you really bounce around between windows. The command
M-x web-xdvi
enables the convenient preview of the .dvi les.
C-c g o
C-c x d
One keybinding that Emacs' users are familiar with has been rebound to another function. The keybinding C-x C-c has been bound to the web-mode function M-x web-mode-save-buffers-kill-emacs
C-c x c
f12
Before this function makes a call to Emacs' save-buffers-kill-emacs, it completes the journal le that is maintained by web-mode. This journal le keeps track of what le is being edited, who is editing it, when the editing began, when the editing stopped, and a count of the number of times each of web-mode's interactive functions were used. 16
12
Web-mode
Menus
This section is based upon work done by Leslie Stoneham and was completed in April, 1995. The integration into this manual was done by Bart Childs and has been through only two or three proo ngs. I repeated the process Leslie did in capturing screen images to make the document smaller. We normally use X-windows and will have screens that are 30 or so lines long. I reduced each windows for the capture process. The appearance and location of the cursor is often because of the capture software. Figure 5 was prepared using METAPOST. These captured screen images vary among machines. Emacs provides functions and data structures for customizing the de nitions of commands and key bindings. Data structures called keymaps de ne the bindings between keys and command functions. Later versions of GNU Emacs provide a menu-bar that is de ned in the global keymap. The web-mode menu-bar is simply an extension of the global menu-bar. More speci cally, the web-mode menu-bar is de ned in a local keymap that extends the global keymap.
12.1
Web-mode
Menu-bar
The web-mode menu-bar (Figure 1.) is an extension of the standard GNU Emacs menu-bar. A subset of the web-mode commands are grouped under the menu options, Navigate, View, and Structure. The menus, Process and Synchronize, consist of new commands for synchronizing and processing WEB les.
Figure 1:
Web-mode
Menu-bar
The standard GNU Emacs menu-bar provides four menus for basic editing commands: Buers, File, Edit and Help. The Buers Menu consists of a list of the names of existing buers in the editing session. The order of the buers in the list is based on how recently a particular buer was displayed in 17
a selected window. The Buers Menu can be used to switch to a new buer in the currently selected window. The Buers Menu also includes a command, \List All Buers", for displaying the buer, *Buer List*. *Buer List* displays, in a separate window, the names of all existing buers along with their size, mode, visited le, and an asterisk (if the le has been modi ed).
Figure 2:
Web-mode
Buers
provides several commands to facilitate movement between the WEB le, CHange le, and include les: Web-mode
Command M-x M-x M-x
web-goto-buffer-change-file web-goto-buffer-web-file web-goto-buffer-include-file
Figure 3:
Web-mode
Key Binding
Function Key
C-c b c C-c b w C-c b i
S-f8 S-f6 S-f7
Basic Buer Movement Commands
When web-mode is started, the Buers Menu list includes the WEB and Change le buers. Therefore, it was not necessary to include the commands web-goto-buffer-change-file and web-goto-buffer-web-file in any of the web-mode menus. Instead, a user can select the buer name from the Buers Menu to accomplish the same task. The File Menu consists of commands for manipulating (e.g. save, open, delete) les, buers and frames. The File Menu also includes a command for quitting Emacs. The Edit Menu provides basic editing commands such as cut, paste, copy, undo, and search. Figures for these two items are not included. The Help Menu groups extensive help features on key bindings, functions, global variables, editing modes and more. For example, a user can select \Describe Mode" for a listing and description of interactive web-mode commands. Or the user can request help for a speci c command by selecting \Describe Function". The menus for these last two items are not shown because they are much like (probably identical to) standard Emacs, but that might change. 18
12.2 Navigate Menu Web-mode de nes several commands that move the cursor through the text of the WEB le and CHange le. Movement is based on either the organization of the source le (i.e. chapters and
sections), the section cross references (i.e. de ned-in and used-in links), the organization of the CHange le (i.e. edited sections), or the location of index entries. The Navigate Menu (shown in Figure 4.) is composed of four sub-menus{Web File, CHange File, Index Entry, and Section X Refs, for grouping cursor movement commands.
Figure 4: Navigate Menu The various submenus dealing with navigation are shown in Figure 5. The code and documentation of a WEB are organized into small pieces referred to as sections. Related sections can be grouped into a major section, called a chapter. The Web File sub-menu consists of commands that move the cursor across chapters and sections. Navigation occurs in three directions{forward (next section/chapter), backward (previous section/chapter), and random (goto section/chapter). The menu options \Next Section", \Next Chapter", \Previous Section", and \Previous Chapter" are only enabled when the WEB le is the current buer. However, the \Goto" options are available from any buer that is in web-mode. The sections of a WEB can be associated with an \edited" section in a CHange le. Edited sections override the implementation of the WEB section during the weave and tangle process. CHange les allow users to modify and reuse existing program code and documentation without corrupting the original implementation of the WEB source le. The CHange File sub-menu consists of commands that move the cursor across edited sections. Navigation occurs in three directions{forward (next edited section), backward (previous edited section), random (goto edited section). This sub-menu also has a command (edit section) for creating a new edited section. The edit section option is enabled only from the WEB le. Once invoked the cursor is \navigated" into the CHange le for creating and inserting a new edited section. Note 19
Web File: : : Change File: : : Index Entry: : : Section XRefs: : :
Goto Section: : : Goto Chapter: : : Next Section Next Chapter Previous Section Previous Chapter
C-c C-c C-c C-c C-c C-c
f g n n p p
s c s c s c
S-f1 C-f1 S-f2 C-f2 S-f3 C-f3
Edit (Create) Section Goto Edited Section: : : Next Edited Section Previous Edited Section
C-c C-c C-c C-c
e g n p
s e e e
S-f5
Next Index Previous Index
C-c n i C-c p i
Next Defined-In Previous Defined-In: : : Next Used-In Previous Used-In
C-c C-c C-c C-c
n p n p
d d u u
S-f10 S-f11 C-f10 C-f11 C-f12 S-f12
Figure 5: Navigate Submenus that if the edited section already exists, then the \Edited Section (Create)" command performs the same action as \Goto Edited Section". The options, \Next Edited Section" and \Previous Edited Section", are enabled only in a CHange le. The other option, \Goto Edited Section" is enabled from any web-mode buer. Index entries may occur at several locations within the WEB le. The Index sub-menu consists of commands that move the cursor across the locations of a selected index entry. Navigation is bi-directional { (next index entry) and (previous index entry). At the end of code sections are two types of cross references. One type (used-in) tells what other sections were used by the currently selected section. The other type (de ned-in) indicates other sections that are an extension of the selected section. The Section XRefs sub-menu consists of commands that move the cursor across both types of section cross references. Navigation occurs in two directions{forward (next de ned-in/used-in) and backward (previous de ned-in/used-in).
12.3 View Menu During the WEB process several les are created that can be viewed interactively (i.e. before being typeset) from the editing session. The View Menu contains the web-mode commands for viewing (interactively): the index, the list of section names, the list of chapter titles, and the list of edited sections. The web-mode viewing commands are shown in Figure 6. The View Menu is designed to group all of the web-mode commands that display lists useful for navigation. In fact, to navigate the section cross references and index entries, a user 20
Command M-x M-x M-x M-x
Key Binding web-view-chapter-title-list web-view-section-names-list web-view-edited-sections-list web-view-index
C-c C-c C-c C-c
v v v v
c s e i
Function Key C-f9 S-f9
Figure 6: Web-mode Viewing Commands must rst select a reference or entry from the interactive listing. The key bindings are displayed in the menu as an option for the more experienced web-mode user. Figure 7 is a display of the open View Menu. If the user opens this menu from a buer already containing the list of section names, then the option \View Section Names" is not selectable. Likewise, the other options are not selectable if the current buer is already displaying the speci ed list. Otherwise, the View Menu options are always enabled.
Figure 7: View Menu The rst menu option, \View Section Names", is for interactively viewing the list of section names from the WEB source le. An interactive view of the section names list is shown in Figure 8. Each list entry gives the section name, the de ned-in section numbers, and the used-in section numbers. Calculate the discriminant and solutions (7) (3) Input |a|, |b|, and |c|, |stop| if unsuccessful (5) (3) Output the calculated solutions (9) (3) Variable declarations (4 6 8) (3)
Figure 8: Interactive Section Names Listing The option, \View Chapter Titles", is for viewing the list of chapter titles from the current source le. The interactive view of the chapter titles list is shown in Figure 9. Each list entry gives the chapter title and chapter number. WEB
The menu option \View Index", is for viewing the index le created during the weave process. The index lists the automatic and user-de ned index entries. When viewed interactively, a list of index entries and their locations (i.e. section numbers) are displayed in a buer. An example of the interactive index listing is shown in Figure 10. 21
Chapter# -- Chapter Title 1 1 The quadratic equation 2 1 The program for solving the quadratic equation 3 1 Index
Figure 9: Interactive Chapter Titles Listing a:
4.
b:
4.
c: 4. cmplx: csqrt:
7*. 7*.
discriminant: discriminant:
2. 7*, 8*, 9*.
implicit none: 3. input status: 5, 6. IOSTAT: 5. none:
3.
quadratic: z 1: z 2:
12.4 Structure Menu
3.
7*, 8*, 9*. 7*, 8*, 9*.
Figure 10: Interactive Index Listing
also provides functions useful for assessing the structure or organization of a literate program. Many of the commands outline the WEB le. Other commands count and identify the sections, chapters, and edited sections. Examples of structure commands include: Web-mode
Command M-x M-x M-x M-x
web-count-sections web-which-edited-section hide-body show-all
Figure 11:
Web-mode
Key Binding
Function Key
C-c C-c C-c C-c
C-f5 C-f8
# w h s
s e b a
Structure Commands
Figure 12 displays the open Structure Menu. Typically, the structure information refers to the contents of the WEB le. Therefore, most of the options are only enabled in the WEB le. The only exception, \Which Edited Section", pertains to the contents of the CHange le. Consequently, this option is only selectable in the CHange le. The Structure Menu is not available outside of the WEB and CHange les. 22
Figure 12: Structure Menu The Structure Menu represents a small subset of the structure commands provided by web-mode. The menu was designed to include the most commonly used commands. Later, the means for customization of the menus are discussed.
12.5 Process Menu The processing of WEB source les to create executable and printable versions of a literate program is described in the introduction of this report. The purpose for the Process Menu (shown in Figure 13.) is to provide options for WEB processing the source les from the editing session. Currently, the process commands are only available through the web-mode menu-bar. In other words, the commands invoked by the Process Menu options have no corresponding key bindings.
Figure 13: Process Menu The rst menu option, \WEAVE Source Files", will start a process that creates a TEX le from the WEB source les. The output of the weave process will be displayed in the buer, WEAVE-Output, in a dierent window. Figure 14. displays an example of the editing session after selecting \WEAVE Source Files". The second menu option, \TANGLE Source Files", will start a process that creates a high level language (HLL) le for the WEB source les. The output of the tangle process is displayed in the buer, TANGLE-Output. Figure 15. displays the state of the editing session after selecting \TANGLE Source Files". 23
Figure 14:
WEAVE
Output
Figure 15: TANGLE Output Another menu option, \Compile HLL Program", is used for compiling the high level languge (HLL) le created by the tangle process. To ensure that the HLL le exists and to determine the HLL being used, the WEB source les are initially tangled. The HLL le is then compiled using a conventional compiler. For this menu option to work properly, the user must specify the compiler and options to be used in the .emacs le. This speci cation can also be changed by using the command: C-c s t
M-x web-set-type
24
Figure 16: DVI Output The menu option, \Create A DVI File", compiles the TEX le of the current WEB into a .dvi le. If the TEX le does not exist, the user is prompted to create the .tex le. If the user responds to the prompt with \n", no further action is taken. If the user responds with \y", the .tex le is created using the weave processor. Figure 16 is a result of invoking this. The menu option, \Create A Postscript File", will create a postscript le from a .dvi le for the current WEB le. If the .dvi does not exist the user is prompted to create the .dvi le using the program dvips. Figure 17. displays a result of invoking this option.
Figure 17: Postscript Output The Process Menu also has a sub-menu for previewing the typeset presentation of the WEB document that is currently being edited. Selecting the option, \Preview Typeset Program...", will cause the menu shown in Figure 18. to display. If the user selects, \Preview With Xdvi", a process is started to display the .dvi le of the current WEB in its typeset format. If the .dvi le does not exist, the user is prompted to create it. The other option, \Preview With Ghostview", will start a process to display the postscript le of the current WEB. Again, the user is given the option of creating the le if it does not already exist. 25
Figure 18: Preview Sub-menu The Process Menu was added to the web-mode editor to facilitate WEB processing. Users now have the option of processing directly from the editing session. Users can potentially invoke processing with the click-and-release of a mouse button instead of typing several command lines. The Process Menu options are enabled only in the WEB and CHange les.
12.6 Synchronize Menu The synchronize commands allow a user to coordinate and display the WEB le with either the CHange or high level language (HLL) le. In both cases, the synchronization is based on the location of the cursor in the WEB le. The open Synchronize Menu is shown in Figure 19.
Figure 19: Synchronize Menu A CHange le contains information that override portions of a WEB source le. The CHange le consists of an exact duplication of the lines from the source le to be replace followed by their replacement lines. The CHange le can be used by both the weave and tangle processors to replace the documentation and code of the source le with the contents of the CHange le. 26
Selecting the menu option, \Synch with CHange File", will position the cursor in the CHange le at the exact location from where the command was invoked in the WEB le. Both the WEB and the CHange le are displayed in the selected window. Figure 20. demonstrates the eect of this option.
Figure 20: Synchronization of the WEB and CHange File The HLL le contains only the code of the programming language in use and comments indicating the start and end of a WEB section. Selecting the menu option, \Synch with HLL File", will position the cursor in the high level language le at the beginning of the code contained in the WEB section from where the command was invoked. For example, if the menu option is selected while the cursor is in Section 5 of the WEB document, then the cursor is placed in the HLL le at the beginning of the code that was contained in Section 5. Figure 21 is the result of this type of synchronization. It is sucient to synchronize the HLL le at the the beginning of the section since most sections should contain only of few lines of code.
Figure 21: Synchronization of the WEB and the HLL File Not all of the sections that appear in the WEB le are found in the CHange or HLL le. For example, sections that are composed solely of documentation do not appear in the HLL le. 27
Sections that have not been overridden do not appear in the CHange le. Therefore, if the WEB line or section to be synchronized does not exist in the target le, then the user is given a message and no other actions are taken. The nal option of the Synchronize Menu, \Return to WEB File", will make the buer containing the WEB le the current buer and any other window being displayed will disappear. The option, \Return to WEB le" is enabled for all web-mode buers except the WEB le. However, synchronization can only occur from the WEB le.
13 Using Color Within web-mode has been extended to allow the use of color in the WEB source as well as in the index. This was done by by Tom McCurdy, July, 1995. By default color is turned o and it is only available when using Emacs with a windowing system such as the X Window System, Windows-95, or Windows/NT. To use Emacs in a windowing system requires the use of Emacs 19 or later. Customization of your .emacs le is done with lines containing `hilit' and `color'.
Web-mode
13.1
Hilit
for web-mode
To highlight parts of the screen which have not been colored or to rehighlight the screen use C-l
M-x hilit-recenter
There are several changes to the .emacs le that may be made and are shown in Figure 22. Files larger than 60K will not be highlighted when they are rst read into a buer because of the time taken to highlight large les. However, each time C-l is pressed the entire screen will be highlighted. To highlight the entire buer preface hilit-recenter with C-u: C-u C-l
C-u M-x hilit-recenter
If you wish to increase the maximum le size for automatic highlighting of the entire buer add the lines referencing hilit-auto-highlight-maxout carefully. This line should appear before \(require 'hilit19)" in your .emacs le. As mentioned earlier the use of hilit requires that Emacs is used in conjuction with a windowing system. This highlighting feature relies on the Emacs LISP code hilit19.el written by Jonathan Stigelman. To use hilit and to customize it in other major modes add (and maybe edit) the following Emacs LISP code in Figure 22. If you prefer using a light background change the line: to
hilit-background-mode
'dark
hilit-background-mode
'light
Table 1 is a list of the default colors used by hilit in web-mode. If you wish to change any of these colors you will have to edit the web-mode source. To change these colors in the web-mode source search for the string \defconst web-hilit-default-face-table" and change the colors there. (If you are using the X Window System a list of legal color names and their RGB values can be found in the le rgb.txt which is usually in the directory 28
(defvar hilit-auto-highlight-maxout 60000 "* auto-highlight is disabled in buffers larger than this") (insert " Turning on color hilights.\n") (setq hilit-mode-enable-list '(not text-mode) hilit-background-mode 'dark hilit-inhibit-hooks nil hilit-inhibit-rebinding nil) (require 'hilit19) ;;(insert "Turning on auto-coloration at \n") (defun hilit-return () "Hilit a line when the return key is hit!!!!" (interactive) (if (equal mode-name "Text") (newline) (setq current-point (point)) (beginning-of-line 0) (setq b (point)) (goto-char current-point) (newline) (hilit-rehighlight-region b (point)) ) ) (cond (window-system (global-set-key "\C-m" 'hilit-return) ))
Figure 22: Possible modi cations of the .emacs le
29
Hilit
Colors for WEB Mode
Item Highlighted Section Reference Section De nition Chapter Index Entry Control Codes Preprocessor
Background Color Light Dark Steel Blue4 Cyan Royal Blue Yellow2 Lime Green Green MediumPurple3 Plum1 Dark Goldenrod1 Moccasin Maroon Orange
Table 1: Colors used by hilit in Emacs' WEB mode /usr/lib/X11.) The rst column lists the WEB command category, the second column lists the color of the command for light backgrounds, the third column list the color for dark backgrounds and the last columns list the face used for monochrome backgrounds. After you make changes to the web-mode source you should byte compile the source by issuing the byte-compile-file command from within Emacs and specifying the name of the web-mode source le as the name of the le to compile. If you decide that you like having certain WEB commands highlighted but do not wish to have all six categories of commands highlighted you may turn o highlighting of any of the six categories of WEB commands. To disable highlight of a WEB command category insert the lines of LISP code into your .emacs le which disable colorization for that category of WEB commands. The following Emacs LISP code turns o highlighting for all six categories of WEB commands: (defvar web-hilit-section-reference nil "*Determines if section references (@< .. @>) are hilited under web-mode.") (defvar web-hilit-section-defintion nil "*Determines if section definitions (@< .. @>[+]=) are hilited under web-mode.") (defvar web-hilit-chapter nil "*Determines if chapters (@*) are hilited under web-mode.") (defvar web-hilit-index-entry nil "*Determines if index entries (@[.^:] ... @>) are hilited under web-mode.") (defvar web-hilit-control-codes nil "*Determines if WEB control codes are hilited under web-mode.") (defvar web-hilit-preprocessor-commands nil "*Determines if WEB preprocessor commands (@m, @#define, @#if, etc.) are hilited under web-mode.")
13.2 Colorization of the web-mode Index To add colorization to the web-mode index only requires that the following two lines of Emacs LISP code appear in your .emacs le: (defvar web-color-index t "*Determines if the WEB index is to be colored under web-mode.")
30
Colors for WEB Mode Index Item Highlighted Italics Bold Italics Roman Typewriter Bold De nition Other
Background Color Light Dark Steel Blue4 Cyan Maroon Orange Lime Green Green Medium Purple Plum1 Dark Goldenrod Moccasin Red Pink Slate Gray Azure
Table 2: Colors used in the web-mode index Table 2 lists the default colors used in the web-mode index. If you wish to change any of these colors you will have to edit the web-mode source. To change these colors in the web-mode source search for the string \defconst web-index-default-face-table" and change the colors there. (If you are using the X Window System a list of legal color names and their RGB values can be found in the le rgb.txt which is usually in the directory /usr/lib/X11.) The rst column lists the typeface used in the typeset index created by weave, the second column lists the color of the index entry for light backgrounds, the third column list the color for dark backgrounds and the last columns list the face used for monochrome backgrounds. After you make changes to the web-mode source you should byte compile the source by issuing the byte-compile-file command from within Emacs and specifying the name of the web-mode source le as the name of the le to compile.
14 An Example Let's assume that you are creating main.web which will input les sub 1.hweb and sub 2.hweb. After entering the statement @i sub 1.hweb we suggest that you C-xC-f and respond with the sub 1.hweb. Enter one blank line and C-xb followed by an enter and you will be back into the WEB le. Entering M-x web-mode-reset will ensure that you can now communicate among the les in the preferred manner. This same process is repeated to create the other included le. Of course, if they already existed then you did not need to visit them to create them. Again, we consider it slightly illiterate if these les have an extension of .web! Try it out on NewtonC.web, NewtonF.web, PS Quasi.web and the sources of the dierent WEB systems. This section should be a bit longer or another document of examples should exist. 31
15 A Final Note Any suggestions for enhancements, problems with the existing functions, or criticisms can be submitted to Bart Childs (
[email protected]). Mark Motl is not available through the networks at this time. The use of the pronoun I obviously should be we.
16 References 1. Donald E. Knuth, \Literate Programming," The Computer Journal, vol. 27, no. 2, May 1984, pp. 97{111. 2. Bill Lewis, Dan LaLiberte, and the GNU Manual Group, The GNU Emacs Lisp Reference Manual: Emacs Version 18 for UNIX Users, Edition 1.01, Cambridge, MA: Free Software Foundation, Apr. 1990. 3. Richard Stallman, GNU Emacs Manual, Fifth Edition, Version 18 for UNIX Users, Cambridge, MA: Free Software Foundation, Oct. 1986.
Supplementary Sources
Adrian Avenarius and Siegfried Oppermann, \FWEB: A Literate Programming System for Fortran8x," SIGPLAN Notices, vol. 25, no. 1, Jan. 1990, pp. 52{58. Jon Bentley, \Programming Pearls: Literate Programming," Communications of the ACM, vol. 29, no. 5, May 1986, pp. 364{369. Jon Bentley, Donald E. Knuth, and Doug McIlroy, \Programming Pearls: A Literate Program," Communications of the ACM, vol. 29, no. 6, Jun. 1986, pp. 471{483. Preston Briggs, NuWEB Marcus E. Brown, \An Interactive Environment for Literate Programming," Ph.D. Dissertation, Dept. of Computer Science, Texas A&M University, College Station, TX, Aug. 1988. Marcus E. Brown and Bart Childs, \An Interactive Environment for Literate Programming," Structured Programming, vol. 11, no. 1, Jan. 1990, pp. 11{25. Peter Gragert and ? MapleWEB Peter Gragert and ? ReduceWEB Klaus Guntermann and Joachim Schrod, \WEB Adapted to C," TUGboat, vol. 7, no. 3, Oct. 1986, pp. 134{137. Donald E. Knuth, METAFONT: The Program, vol. D of Computers & Typesetting, Reading, MA: Addison-Wesley Publishing Co., 1986. 32
Donald E. Knuth, TEX: The Program, vol. B of Computers & Typesetting, Reading, MA: Addison-Wesley Publishing Co., 1986. Donald E. Knuth, \The WEB System of Structured Documentation," Stanford Computer Science Report STAN-CS-980, Dept. of Computer Science, Stanford University, Stanford, CA, Sep. 1983. John A. Krommes, \The WEB System of Structured Software Design and Documentation for Fortran, Ratfor, and C," Technical Report, Princeton University, Princeton, NJ, Nov. 1989. Available by anonymous ftp from lyman.pppl.gov in directory /pub/fweb. Silvio Levy, \WEB Adapted to C, Another Approach," TUGboat, vol. 8, no. 1, Apr. 1987, pp. 12{13. Levy and Knuth or is it Knuth and Levy, CWEB 3.0 Norman Ramsey, \Literate Programming: Weaving a Language-Independent WEB," Communications of the ACM, vol. 32, no. 9, Sep. 1989, pp. 1051{1055. Norman Ramsey, \Literate Programming Tools Need Not Be Complex, NOWEB" E. W. Sewell, \How to MANGLE Your Software: The WEB System for Modula-2," TUGboat, vol. 8, no. 2, Jul. 1987, pp. 118{122. E. W. Sewell, Weaving a Program: Literate Programming in WEB, New York, NY: Van Nostrand Reinhold, 1989. Richard M. Stallman, \EMACS: The Extensible, Customizable, Self-Documenting Display Editor," in Interactive Programming Environments, David R. Barstow, Howard E. Shroke, and Erik Sandewall, Eds., New York, NY: McGraw-Hill Book Co., 1984, pp. 300{325. Harold Thimbleby, \Experiences of `Literate Programming' using CWEB (a variant of Knuth's WEB)," The Computer Journal, vol. 29, no. 3, Jun. 1986, pp. 201{211. Ross Williams, FunnelWEB
33
A Adding Functionality to web-mode Don Knuth had two goals for the TEX systems, quality and archival. If you read the history of these systems, you will see that there have been few additions to the system. Really, there have been only two. The original TEX, TEX78, was written in the language, SAIL. When Digital Equipment Corporation decided to stop making the systems that this language was available on, he rewrote it in the WEB system to make it portable. TEX82 has signi cant dierences from TEX78 that were based on signi cant experience. Version 3 of TEX82 also contained a number of changes from its initial version. The many releases of earlier versions of TEX82 only contained xes (I believe). The primary changes that were incorporated in version 3 were based upon the experiences of using TEX worldwide and with many languages. These include: 8-bit character sets, multiple languages in a document, and dierent hyphenation rules for each language. Many of us would have liked other changes incorporated into TEX. However, I now believe this stability has been one of the strongest points of TEX. Alas, this has not been the case with Literate Programming systems. Indeed, web-mode has changed signi cantly and so have some of the WEB systems. Knuth's original WEB has changed the least. The changes in CWEB are logical because of the emergence of C++. However, I believe that most or all the WEB systems would bene t most by becoming xed or at most slowly varying. This will contribute the most toward building a community of Literate Programmers. This version of web-mode supports three dierent WEB systems. These are: Knuth's original Pascal WEB, Knuth and Levy's CWEB (which supports C and C++), and Krommes' FWEB (which supports Fortran 77, Fortran 90, C, C++, Ratfor, Ratfor 90, TEX, and a verbatim mode for language independence). I am acutely aware of the level of complexity of these systems but feel that a low level of simple training makes them easily learned and oer a lot more functionality. Therefore, the incompatible NuWEB and NOWEB systems are not yet supported. Users could add additional WEB systems to this support by the modi cation of the source of web-modeX.el. This is done by coding in Emacs Lisp. To add support of WEB systems that are similar to the supported WEB systems, look for the variable web-web and it should be a tractable challenge. We think these systems should easily be supported: FunnelWEB by Ross Williams ReduceWEB by Peter Gragert and ? MapleWEB by Peter Gragert and ? Any WEB system based upon Ramsey's Spider.
34
B Basic Information Like Variables, etc. Previous versions of this manual included a list of global variables. The reason for this list is to help debugging in case of errors. This is cumbersome to try to keep updated as we begin to have more users and contributors to the evolution of this package. We have replaced this by some instructions as to how to generate a current list and how that is used. The list of global variables is easily generated by nding all lines with the string `defvar' on them. Using grep this is simply: grep defvar web-modeX.el > DefVar
On UNIX-like systems, the le DefVar will contain the list of variables with a little more information. The documentation for the above can be viewed by issuing the command: M-x describe-variable
C-h v
At the prompt, the name of the variable of interest should be entered. The response will be the help text entered when the variable was declared and its current value.
Show some examples C-h f
too 35
C Changes To The WEB Processors One of the best things to do in software is to reuse eective and correct code. The use of the index is one of the best parts of the WEB system. It did not take long for us to decide that we saw no reason for Mark to write lots of elisp code to produce an index when it was already produced by the weave processors. To facilitate the reuse of this a little more, it was decided to have jobname.idx and jobname.scn written separately. The rst is used by web-mode while the second is not. A companion le to this distribution is changes.ch which includes the changes necessary to the most popular weave processors. Short comments about these contents follow.
In the original weave, module 239 must be edited. The current version of this code is 4.???? Another alternative for users of the original weave is available in the code. Look for the string \Gragert" if you wish to use this and not make these changes.
3.0.
Version 2.9 and later versions of CWEB do not require changes. The current version of CWEB is
At this writing, no code changes are required for FWEB. The current version of this code is 1.53. Edit fweb.sty to get the desired results with Fweave. It should look (in part) like this: index.tex "#.idx" modules.tex "#.scn" contents.tex "#.cts"
36
D Debugging, Hopefully This will be a pot pourri of notes that may help some unsuspecting user solve some problems that occur in the use of web-mode. The rst item came about from personal experiences of Bart Childs' helping such users. (There used to be more in this list but they have disappeared due to improvements in web-mode. The users are requested to send in more . . . ) 1. Watching the minibuer gives you an idea as to what web-mode is doing as it builds its pointers and lists. It is not uncommon for WEBs written without web-mode to have problems when used with web-mode for the rst time. In at least one case, it is still not obvious as to why we had the problem. The solution of this case might be a help to other users. The starting of web-mode was nearing an end because it gave a message about collecting \web index entries." Then, the terrible message File mode specification error:
(wrong-type-argument stringp nil)
which seemed totally uncalled for. 2. A method of solution. If the WEB has a good number of user supplied index entries, then you can nd a pretty good bracket of the error easily. This is done by issuing the emacs command: C-hv. Emacs will prompt for the name of the elisp variable you want described. The answer is: web-index-entries-list
and the last entry in it will be the last one processed. If all entries are entered only once, then the error will have happened between the point of the last entry in the list and the next entry that should have been added. 3. I suggest adding a lot of entries like: @.BC 1 CB@> @.BC 2 CB@> ...
After each paragraph. Repeating the C-hv iteration should quickly lead you to the oending item. Sometimes it is just a stray @? Let us hear from you.
37
E Elementary .emacs This will be a brief discussion of the really necessary things and a few suggestions as to what goes in the le .emacs. Some of these may not be in exactly same order as in the le. This was recommended by somebody, just do it. (setq text-mode-hook 'turn-on-auto-fill)
These lines make the invocation of web-mode automatic if the name of the le ends with .web. The second line contains the name of the le where the byte-compiled form of web-mode.el is on your system. (setq auto-mode-alist (cons '("\\.web\$" . web-mode) auto-mode-alist)) ;; the next line also allows .w extensions (setq auto-mode-alist (cons '("\\.w\$" . web-mode) auto-mode-alist)) (autoload 'web-mode "/usr/local/lib/web/web-modeX.elc" "Major mode for editing WEB-based documents" t)
If you are using only one form of WEB, you can prevent the system from asking which kind by setting web-web. The value of 0, 1, and 2 state the original (Pascal), CWEB, and FWEB, respectively. For FWEB: (setq web-web 2)
The next several show suggestions for the location of the tangles and weaves. (setq web-call-program-cweave "/usr/local/bin/cweave") (setq web-call-program-fweave "/usr/local/bin/fweave") (setq web-call-program-weave "/usr/local/bin/weave")
On many systems, these lines do not have to have the directory speci cations in .emacs. The location of the default \limboL.material" le is shown. Individual users may create and use personalized limbo les by editing this line in .emacs (setq web-limbo-material-location "/usr/local/lib/web/limboL.material")
These lines are included for users who don't like our ways. We nd them to be convenient and recommend they be commented or just left out of your .emacs le. (setq web-journal-on t) (setq web-i-do-not-want-to-see-section-names t) (setq web-i-do-not-want-stubs t)
38
F Frequently Asked Questions, (FAQ) Q: How do I get started? A: You need the les web-modeX.el, web-menu.el, web-color.el, .emacs, limboL.sty, and
limboL.material.
The le .emacs should be installed in the user's root directory. There is some obvious editing that should be done to that le based upon the location of a few things. You should also put limboL.sty, limboL.material and byte-compile and put web-modeX.el and web-modeX.elc in appropriate places.
If you are using Knuth's original (Pascal) WEB you should use `limbo*' rather than `limboL*'. If someone knows of a webmac.tex/sty for LATEX, I would quickly change my tune. If you are not using the most recent version of emacs, the menus and color may not be available. Use web-mode.el.
Q: If web-mode is properly installed, how do I get started? A: Simply issue the command ?emacs start.web where the ? is an acknowledgment that not all emacs invocations start the same. The system will prompt you for acceptance of the use of the standard limbo material which you normally accept with (ENTER). You will then be prompted for a title. This should be a few words, say like a book title. Go read the manual and code, document, and be literate!
Q: What causes me to get a message like:
"file-mode-specification-error (wrong-type-argument stringp nil)"
A: That probably happens from a messed up index entry or section name [it should take a lot of work to mess up a section name when you use web-mode]! Get out of the editor saving the web le and try these:
grep -e'@\.' file.web grep -e'@\^' file.web grep -e'@9' file.web
or the combination of all:
grep -e'@[9\.\^]' file.web
If there is not one of the index entry beginnings without an ending, then you should probably email the le to
[email protected] or some other willing fool. Hopefully the experience of nding the answer will make it to this list.
Q: Do I have to edit the .emacs le if I want to switch to a dierent language? For example, I might be using FWEB and normally write C programs but now want to do a Fortran 90 quickie. A: The answer has two parts. First, in the FWEB source you will put a line that contains @n90 to re ect that the output will be appropriate. The exact name of the le can be aected by statements in your .fweb and fweb.sty les. Then, you have probably set the name of the 39
compiler and switches in the .emacs le. This is easily changed during each emacs web-mode session by issuing the command C-c s t and answering appropriately.
Q: Can I edit two WEB les in the same session? A: Not really. The work that web-mode does requires that you have only one WEB system in
its grasp at one time!!!! That is the reason we demand that you have discipline in naming the les: .web, .hweb, and .ch. Actually the last two can be anything except .web.
Q: But I really have to use another WEB at the same time! What can I do? A: OK, you are editing a WEB and you want to cut and paste things from another WEB. That is
easy if you will do it with just a little care. The rst thing is to visit another le with a nondescript name like: C-x C-f junk.junk. This surely will be a new le, if it is not, then f2 followed by C-w will delete it. Then, insert the le you want to work with by C-x i great.web and you will have inserted the contents of great.web. It will think of this as junk.junk and will therefore treat it as an ordinary text le.
Q: What causes the WEB items to disappear from the menu bar? A: You are in another le that is not recognized in the WEB heirarchy. For example, if you run
the tangle process and it shows you the tangle output, the menu bar is back to the default one. You can click the mouse in the WEB window and it will come back. You can then click it in the other window and . . . Maybe that is enough discussion of this.
Q: What causes the menu options to go dim when trying to use the Structure, Process, and Synch items?
A: You are probably in a related part of the WEB system that you are editing such as change le or included le. You must be in the WEB or one of these to get those items in the menu bar.
G Glossary buer | A buer is the basic editing unit. In Emacs, a user can have many buers, however, only one can be edited at any one time.
change le | This le contains information that is used to override portions of the WEB le.
Each \edit" consists of repeating the lines from the WEB le that require modi cation and the new lines that are to replace the old ones. The tangle and weave processors have the ability to scan both the WEB and change les so that the new lines replace the old lines at the appropriate places in the resulting high-level language and TEX codes.
chapter | We use chapter to mean a collection of sections. A chapter is begun by the @* character pair. This may be followed by a digit in FWEB. 40
chapter title | The string of characters following the @* until the rst period followed by
white space (space, tab, new-line). The chapter title is presented in a bold font in the section and in the default font in the table of contents.
completion | The philosophy of completion is that if it is predictable, the computer should be able to nish it. In emacs if you are typing in a command (like after M-x) or a le name (like after C-x C-f you can type enough to make it unique and the le name will be completed. If it is not enough to make it unique, then it will complete it as far as it can and then give you options. de ned-in | Section names are really pseudo-code tags for code. The name is called `used-in' if the section is not followed by an = and `de ned-in' where that character follows the section name. Thus, a section name is `used-in' if the current line is in `code mode' and `de ned-in' if it causes the start of `code mode.'
include le | Some WEB systems allow the inclusion of code through the use of @i commands. This is normally used in a slightly dierent manner than the C header les.
index | The index in a WEB is a generalization of the variable cross references that can be delivered by most compilers. Entries are section numbers and are underlined if the entry is preceeded by @! or if the weave processor recognized a type statement de ning the variable. The user can also supply entries via the @^ @>, @. @>, snf @9 @> constructs. The last is @9 @> in WEB and CWEB.
limbo le/material | A le named containing limbo material. The name is set in the
le. A set of TEX material that aids in the complete presentation of a WEB. The distributed limboL.material and limboL.material include source for a title, abstract, author, and other handy information.
.emacs
minibuer | The bottom line of the screen when using Emacs. This area is used to display
arguments to commands, commands that are typed in from the keyboard, and messages to the user. For commands that require arguments, the minibuer area can be used for prompting as well.
numeric argument | A number which is speci ed before a command to alter the eect of
the command. In many Emacs (and therefore Web-mode commands) this is prompted for. These commands hopefully make logical use of impossible responses. For example, if the user responds with an impossibly large section number, the last section should be displayed.
section | A section begins with the pair of symbols `@*' or `@ .' A section ends when the
next section begins or the end of the le, whichever comes rst. If it begins with an `@*' it will be called a chapter.
section name | Code portions of sections which begin @= de ne the `section name' by the strings between the @< and @> delimiters. Thus, section names are pseudocode descriptions of code function.
used in | see de ned-in. web le | contains the source of the WEB. The le consists of the limbo portion and the 41
individual units that comprise the WEB called sections. A section consists of a commentary, de nition, and code parts, any two of which can be empty. Readers, please suggest other items for this!!!!!
H Help for web-mode The design of Web-mode was based upon having an intelligent user that would reuse reasonable information. For example, many of the lists maintained do not change from one run to the next. If so, then they should be reused. However, if a previous session was aborted at the wrong time, it is possible for one of these lists to be accidentally nil. For example, if a command C-c v s shows no section names, the user can build this list by the following commands: C-c b w
to return to the WEB buer
M-x web-collect-section-names to
build the list again.
Another approach is to exit Emacs and then delete all les associated with the WEB except for
the WEB itself!
This section needs a lot of user feedback as to the most common problems.
I Index
All it takes is work! 42