8. Recovery from errors

If troff2page fails on your document, it will display a message giving its best guess on what the problem is and where it occurred in the source document, and will offer to take you there so you can fix it immediately.

    filename:lineno: error description
    Type e to edit file filename at line lineno; x to quit

In the first line, or the error diagnostic line, filename is the particular source file (which need not be the main document file) and lineno is the estimated number of the line in that file that caused the error. (This is a popular error-reporting format and is exploited by text editors for helping the debugging process.)

In the second line, troff2page offers to fire up a text editor with the cursor approximately close to the offending line.

If you type e at the ? prompt, troff2page starts the editor specified in your EDITOR environment variable, or if that is not set, the editor named vi on your system. troff2page calls the editor with two arguments: the first argument is + followed by the line number, and the second argument is the filename. (This argument style works for all vi and emacs clones and I suspect most modern editors take care to recognize it, so it isn’t as restrictive as it sounds.)

SBCL’s warnings

When running troff2page on SBCL, you can get several screenfuls of diagnostic warnings. The conditions warned about are benign, but the verbosity of the messages can be daunting. If you’d rather they weren’t there, add the lines

    (declaim (sb-ext::muffle-conditions style-warning))

either toward the beginning of the troff2page script; or to your SBCL user-init file, which is the file .sbclrc in your home directory. If adding to .sbclrc, the feature expression #+sbcl may be omitted.